问题
I'm trying to switch the push message service. The new push service is Firebase. I have JSON with tokens from parse.com, but can't find how to import it in Firebase.
回答1:
I'm pretty sure you can't just import the tokens used by parse.com to Firebase Cloud Messaging for use. What should be done is to register your client app users to FCM by adding it to your app.
More details can be found in the Migrate your Parse Android App to Firebase (or if you're using iOS) docs:
Suggested Migration Strategy: Migrating Device Tokens
At the time of writing, the Parse Android SDK uses an older version of the FCM registration tokens, not compatible with the features offered by Firebase Notifications.
You can get a new token by adding the FCM SDK to your app; however, this might invalidate the token used by the Parse SDK to receive notifications. If you want to avoid that, you can set up the Parse SDK to use both Parse's sender ID and your sender ID. In this way you don't invalidate the token used by the Parse SDK, but be aware that this workaround will stop working when Parse shuts down its project.
来源:https://stackoverflow.com/questions/39992636/how-import-device-token-into-firebase-i-have-json-from-parse-com