briankabiro/react-native-get-sms-android

null is not an object at basic example

Rictus opened this issue · 3 comments

Hi,

I'm a complete noob at building android application but I want to use react-native-get-sms-android to read sms only.

What I did :

  • react-native init myapp
  • cd myapp
  • yarn add react-native-get-sms-android
  • Add all permissions in android/app/src/main/AndroidManifest.xml
  • Copy from here to myapp/App.js just to get a working example
  • Launch android virtual device (Nexus one API 28)
  • Once virtual device is ready : react-native run-android

The app gets correctly loaded into the virtual device. I allow ,through the popup, my app to read sms. And then the crash :
null is not an object (evaluating '_reactNativeGetSmsAndroid.default.list')

I have checked those two closed issues :

  • 36 : I assume I have correctly copy pasted from example (hope it's a working example, though!)
    12 : I assume I'm not using Expo. Am I correct ? If not, I may need an explaination.

Otherwise, I just can't get the basic example working. Where is my fault ?

Oh my .. I thought I did!
Now, sending sms is OK. Reading them, I don't know, nothing is displayed but I will dig in. I think it works.
Thank you mikehardy.

It is so easy to forget, and such a frequent source of issues that the entire CLI and linking process is being re-written for the v2.0 of the react-native CLI to implement "auto-linking". You're not alone ;-)