OneSignal / OneSignal-Xamarin-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your Xamarin app with OneSignal. https://onesignal.com
Other
105 stars 50 forks source link

Default FirebaseApp failed to initialize because no default options were found. #168

Closed srdmnc closed 4 years ago

srdmnc commented 4 years ago

Description: I can't receive notification even after setting up OneSignal into my Xamarin Forms Application.

Environment

  1. v3.5.0
  2. Nuget

Steps to Reproduce Issue:

  1. Add version 3.5.0 of the Xamarin SDK to your project
  2. Initialize the SDK with your App ID
  3. Attempt to receive a push notification

Stacktrace: [FirebaseApp] Default FirebaseApp failed to initialize because no default options were found. This usually means that com.google.gms:google-services was not applied to your gradle project. [FirebaseInitProvider] FirebaseApp initialization unsuccessful

[OneSignal] Unknown error getting FCM Token [OneSignal] java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.google.firebase.iid.FirebaseInstanceId.getToken(java.lang.String, java.lang.String)' on a null object reference [OneSignal] at com.onesignal.PushRegistratorFCM.getToken(PushRegistratorFCM.java:83) [OneSignal] at com.onesignal.PushRegistratorAbstractGoogle.attemptRegistration(PushRegistratorAbstractGoogle.java:97) [OneSignal] at com.onesignal.PushRegistratorAbstractGoogle.access$100(PushRegistratorAbstractGoogle.java:37) [OneSignal] at com.onesignal.PushRegistratorAbstractGoogle$1.run(PushRegistratorAbstractGoogle.java:84) [OneSignal] at java.lang.Thread.run(Thread.java:761)

And I'm also seeing Google Play Services Library Error in the affected device in my One Signal project

Screen Shot 2019-10-18 at 1 38 00 PM

rgomezp commented 4 years ago

Please reach out to our support channel at OneSignal.com for faster help

srdmnc commented 4 years ago

@rgomezp , I already reached out to the support channel of OneSignal.com, almost a week and this bug is still not resolved that's why I posted it here.

Why close this issue? It is still not resolved yet.

RafaelAraujo91 commented 4 years ago

I have the same issue here. @srdmnc , Did you find a solution?

GKG4 commented 3 years ago

Hello, I am not sure if you guys are still facing this issue. I generated new ServerKey from Google Firebase Console and updated it at OneSignal App Settings, and it worked.