0

I want to integrate Firebase Push Notification in my app so I set below code for that. I integrated the following code for notification:

http://www.androidhive.info/2012/10/android-push-notifications-using-google-cloud-messaging-gcm-php-and-mysql/

When I run it with my credentials and API key I am getting Firebase reg id blank every time. Any idea how can I solve this?

yedpodtrzitko
  • 7,507
  • 2
  • 34
  • 38

1 Answers1

0

You can refer to this link: Firebase (FCM) how to get token

I solved it by referring the answer by activesince93. His answer stated that

New Firebase token is generated (onTokenRefresh() is called) when:

  1. The app deletes Instance ID
  2. The app is restored on a new device
  3. The user uninstalls/reinstall the app
  4. The user clears app data.

I believe his answer is from this doc by google: Access the device registration token

I can get the Firebase reg id after I uninstall and reinstall my app. Hope it helps.

woliveirajr
  • 9,213
  • 1
  • 36
  • 48