hansemannn / titanium-firebase-cloud-messaging

Use the Firebase Cloud Messaging SDK in Axway Titanium 🚀 Edit
Other
43 stars 31 forks source link

Problem on call to register For PushNotifications #87

Closed riggerit closed 5 years ago

riggerit commented 5 years ago

Hi @m1ga ,

thank you for your great work! I think your modules are really well done.

I've got a problem when I try to register the device. I did a lot of tests and at the end if I copy and paste your example code, when calling the method:

fcm.registerForPushNotifications ();

I receive this error message:

"[ERROR] TiExceptionHandler: (main) [22,1454] /alloy/controllers/index.js:152 [ERROR] TiExceptionHandler: fcm.registerForPushNotifications(), [ERROR] TiExceptionHandler: ^ [ERROR] TiExceptionHandler: Error: Attempt to invoke virtual method 'com.google.android.gms.tasks.Task com.google.firebase.iid.FirebaseInstanceId.getInstanceId()' on a null object reference"

I tried in every possibile way but I I couldn't find the solution ... :-(

These are my versions:

Thanks if you can help me.

I also report the app log:


[ERROR] TiExceptionHandler: (main) [22,1454] /alloy/controllers/index.js:152

[ERROR] TiExceptionHandler: fcm.registerForPushNotifications(),

[ERROR] TiExceptionHandler: ^

[ERROR] TiExceptionHandler: Error: Attempt to invoke virtual method 'com.google.android.gms.tasks.Task com.google.firebase.iid.FirebaseInstanceId.getInstanceId()' on a null object reference

m1ga commented 5 years ago

please try this: https://github.com/hansemannn/titanium-firebase-cloud-messaging/issues/82

riggerit commented 5 years ago

Thank you!! Solved, now it works.