tkporter / react-native-sms

SMS composer with callbacks for iOS and Android
248 stars 101 forks source link

resultCode is 0 (e.g. Activity.RESULT_CANCELED) when SMS message is successfully sent on Android #61

Open chico opened 6 years ago

chico commented 6 years ago

When I test on my Android device but when the SMS is sent then the resultCode is always 0 (e.g. Activity.RESULT_CANCELED). Any ideas why?

I log the resultCode in the onActivityResult method.

@Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
      if (resultCode == Activity.RESULT_CANCELED) {
        Log.i("APP", "SMS CANCELLED");
      }
      super.onActivityResult(requestCode, resultCode, data);
      SendSMSPackage.getInstance().onActivityResult(requestCode, resultCode, data);
    }
dancherb commented 5 years ago

I'm getting this when trying to send to multiple recipients (using Gazfay's code here that fixes a bug with sending to multiple - https://github.com/tkporter/react-native-sms/issues/35), though a single recipient seems to work fine