title: Exporting(bridging) method from Objective-C to React native with Promise : returns null only
body: <p>I'm trying to export objective-c methods to react-native with Promise, but when I check the return value at react-native, it's always null, even though objective-c returns a correct data.</p>
  
  <p>Here is my objective-c method.</p>
  
  <pre><code>RCT_EXPORT_METHOD(checkEmail:(NSString *)email 
      resolver:(RCTPromiseResolveBlock)resolve 
      rejecter:(RCTPromiseRejectBlock)reject)
  {
      @autoreleasepool {
          [GRPCCall useInsecureConnectionsForHost:kHostAddress];
  
          AccountService *client = [[AccountService alloc] initWithHost:kHostAddress];
  
          EmailCheckRequest *request = [EmailCheckRequest message];
          request.email = email;
          NSLog(@"Requested Email: %@\n", request.email);
  
          [client checkEmailWithRequest:request handler:^(EmailCheckResponse *response, NSError *error) {
              NSLog(@"Email Check result: %d\n", response.ret);
              if (response) {
                  NSLog(@"Resolved response\n");
                  resolve(response);
              }
              else {
                  NSLog(@"Rejected response\n");
                  reject(@"no_events", @"There was no event", error);
              }
          }];
      }
  }
  </code></pre>
  
  <p>And the react-native side method definition is like this.</p>
  
  <pre><code>checkEmail = (email:string) =&gt; {
      console.log('Network Check Email is called');
      return this._network.checkEmail(email);
  }
  </code></pre>
  
  <p>or</p>
  
  <pre><code>checkEmail = (email:string) =&gt; {
      return new Promise((resolve, reject) =&gt; {
          console.log('Network Check Email is called');
          this._network.checkEmail(email).then((res) =&gt; {
              console.log('check email result: ' + res);
              resolve(res);
          });
      });
  }
  </code></pre>
  
  <p>I tested both cases, but the return value of checkEmail is always <strong>Null</strong>.</p>
  
  <pre><code>async _checkEmailDuplication() {
      try {
          console.log('Check Email Duplication is called');
          const res = await MyNetwork.checkEmail(this.state.email);
          console.log('Check email return value: ' + res);
          if (res === 0) {
              console.log('Available Email');
              return false;
          }
          else {
              console.log('Email Duplication Check Error');
              this.state.errMsg = WSStrings.errCodes[res];
              return true;
          }
      }
      catch (e) {
          console.error('Check Email Call Error', e.message);
          this.state.errMsg = e.message;
          return true;
      }
  }
  </code></pre>
  
  <p>The below is the log from Xcode, when I run the above code.</p>
  
  <pre><code>2017-07-18 00:51:43.781 [info][tid:com.facebook.React.JavaScript] Check Email Duplication is called
  2017-07-18 00:51:43.782 [info][tid:com.facebook.React.JavaScript] Network Check Email is called
  2017-07-18 00:51:43.839 [5782:110747] Requested Email: xxx@xxx.com
  2017-07-18 00:51:43.872 [5782:109339] Email Check result: 2
  2017-07-18 00:51:43.872 [5782:109339] Resolved response
  2017-07-18 00:51:43.873 [info][tid:com.facebook.React.JavaScript] check email result: null
  2017-07-18 00:51:43.874 [info][tid:com.facebook.React.JavaScript] Check email return value: null
  2017-07-18 00:51:43.874 [info][tid:com.facebook.React.JavaScript] Email Duplication Check Error
  </code></pre>
  
  <p>It does not get the correct return code, but just <strong>NULL</strong> and can't go to the next step.</p>
  
  <p>Is there any grammatical error at Objective-C code or react-native code?</p>
  
  <p>I have no Objective-C background knowledge and I don't have enough experience in Promise and bridge of react-native, so if someone can help me, that will be highly appreciated.</p>