Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SendSMS.send got 4 arguments, expected 3 #19

Open
efelem opened this issue Jul 21, 2017 · 1 comment
Open

SendSMS.send got 4 arguments, expected 3 #19

efelem opened this issue Jul 21, 2017 · 1 comment

Comments

@efelem
Copy link

efelem commented Jul 21, 2017

Hello,

When running in releaseMode on real Android devices (tested on HTC one, samsung galaxy s7, samsung galaxy s5) the app crashes at the moment we run SendSMS.send.

When connecting the device to the phone and running adb logcat gives a NativeArgumentsParseException: SendSMS.send got 4 arguments, expected 3 the full error looks like this :

.... AndroidRuntime: FATAL EXCEPTION: mqt_native_modules
.... AndroidRuntime: Process: com.sp00t, PID: 1903
.... AndroidRuntime: com.facebook.react.bridge.NativeArgumentsParseException: SendSMS.send got 4 arguments, expected 3
.... AndroidRuntime: 	at com.facebook.react.bridge.BaseJavaModule$JavaMethod.invoke(BaseJavaModule.java:318)
.... AndroidRuntime: 	at com.facebook.react.cxxbridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:136)
.... AndroidRuntime: 	at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
.... AndroidRuntime: 	at android.os.Handler.handleCallback(Handler.java:751)
.... AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:95)
.... AndroidRuntime: 	at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
.... AndroidRuntime: 	at android.os.Looper.loop(Looper.java:154)
.... AndroidRuntime: 	at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:196)
.... AndroidRuntime: 	at java.lang.Thread.run(Thread.java:762)

The code sending the sms looks like this :

    Alert.alert(
      `${title}`,
      message,
      [
        {
          text: I18n.t('send'),
          style: 'cancel',
          onPress: () => {
            SendSMS.send({
              body: I18n.t('smsText'),
              recipients: smsList.map(contact => contact.phone),
              successTypes: ['sent', 'queued']
            }, (completed, cancelled, error) => {
              console.log(`SMS Callback: Completed: ${completed} Cancelled: ${cancelled} Error: ${error}`)
            })
          }
        },
        {
          text: I18n.t('cancel'),
          onPress: () => {
          }
        }
      ]
    )

Changing the API version does not seem to help (tested with 3 different android SDK version in the build.gradle.
Interestingly It works on the emulator

@sibelius
Copy link

is this still happening to you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants