Push notification 调用addPushTokenListener时,如何检索expo令牌而不是ios令牌?

Push notification 调用addPushTokenListener时,如何检索expo令牌而不是ios令牌?,push-notification,firebase-cloud-messaging,apple-push-notifications,expo,expo-notifications,Push Notification,Firebase Cloud Messaging,Apple Push Notifications,Expo,Expo Notifications,我正在使用expo通知,一切正常,直到我意识到我需要通过调用notifications.addPushTokenListener来更新expo令牌,因为expo刷新了一个新的令牌,而旧的令牌将停止工作。这就是我所做的 // with this I get an expo token Ok let token = await Notifications.getExpoPushTokenAsync(); // type expo { data: "ExponentPushToken

我正在使用expo通知,一切正常,直到我意识到我需要通过调用notifications.addPushTokenListener来更新expo令牌,因为expo刷新了一个新的令牌,而旧的令牌将停止工作。这就是我所做的

// 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”刷新令牌,而不是IOS,因为我正在使用expo

世博推送通知是否使用相同的令牌?
是否仅为FCM/APN调用了“addPushTokenListener”?

请尝试在推令牌侦听器中调用
getExpoPushTokenAsync()

import*作为来自“世博会通知”的通知;
通知。addPushTokenListener(响应=>{
Notifications.getExpoPushTokenAsync()。然后(expoTokenResponse=>{
//…做事
});
});

Notifications.addPushTokenListener(异步()=>
const expoTokenResponse=wait Notifications.getExpoPushTokenAsync();
//…做事
});