【发布时间】:2020-08-24 22:43:16
【问题描述】:
我正在处理博览会通知,一切正常,直到我意识到我需要通过调用 Notifications.addPushTokenListener 来更新博览会令牌,因为博览会会刷新一个新的并且旧的将停止工作。这就是我所做的。
// with this I get an expo token Ok
let token = await Notifications.getExpoPushTokenAsync();
// type expo
{
data: "ExponentPushToken[6CoxIjM15ilo2_ZDTWzeTh]"
type: "expo"
}
// but when I want to retrieve on refreshed token I get an IOS token
Notifications.addPushTokenListener(function(response){
console.log(response);
});
// I get an IOS type token and I do not need that, I need an expo token eventough I am in a ios physical device
{
data: "a9ee9433ea8a3e883cb7f5f1eb0d1bada4eed5473713153534aa2abb5cf6268f"
type: "ios"
}
当我使用 expo 时,我需要的是一个“expo”刷新令牌而不是 IOS。
世博推送通知的令牌是否相同? 是否仅针对 FCM/APN 需要“addPushTokenListener”?
【问题讨论】:
标签: push-notification firebase-cloud-messaging apple-push-notifications expo expo-notifications