How to convert a FCM token to APNS token?

こ雲淡風輕ζ 提交于 2020-01-02 02:41:45

问题


We consider migrating from Firebase Cloud Messaging to build our own push engine. We need to migrate the users converting FCM tokens to get the raw APNS token. How can that be done?

I can only find a procedure to convert APNS to FCM tokens. https://developers.google.com/instance-id/reference/server#create_registration_tokens_for_apns_tokens

Any way to decode the FCM tokens?


回答1:


You can get the token from react-native-firebase with the following way.

  firebase
    .messaging()
    .ios.registerForRemoteNotifications()
    .then(() => {
      console.log('REGISTER FOR REMOTE NOTIFICATIONS');

      firebase
        .messaging()
        .ios.getAPNSToken()
        .then(token => {
          console.log(
            'APNS TOKEN AFTER REGISTRATION FOR BACKGROUND',
            token,
          );
        });
    });


来源:https://stackoverflow.com/questions/51972714/how-to-convert-a-fcm-token-to-apns-token

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!