Xcreen / RestSMS

RestSMS starting a Rest-API-Service on your Android-Device for sending SMS
https://xcreen.space
MIT License
82 stars 24 forks source link

Error message when trying to send text message #3

Closed 955s closed 2 years ago

955s commented 2 years ago

root@HK3:~# curl -X POST http://172.29.29.4:8080/send -H 'Cache-Control: no-cache' -H 'Content-Type: application/x-www-form-urlencoded' -d 'message=Hello%20World&phoneno=%2B8610001'

Error 500

HTTP ERROR: 500

Problem accessing /send. Reason:

    java.lang.NullPointerException: Attempt to invoke virtual method 'void android.telephony.SmsManager.sendTextMessage(java.lang.String, java.lang.String, java.lang.String, android.app.PendingIntent, android.app.PendingIntent)' on a null object reference


Powered by Jetty://
Xcreen commented 2 years ago

Sorry for the late response, which android device and version you are using? It looks like it cant initialize the SmsManager. There was a change in version 2.2.0, can you test with 2.1.0 and check if that works?

955s commented 2 years ago

Thanks for changing the version

Xcreen commented 2 years ago

I was able to reproduce the problem on a android 6 device.
It should now be fixed with version 2.2.1.