我正在測試使用我的ios響應本機應用程序的firebase消息傳遞的實現,並通過Firebase儀表板發送了通知 - 但它顯示發送了0封郵件。我使用這個庫和他們的示例代碼:Firebase消息傳遞顯示發送了0封郵件
https://github.com/evollu/react-native-fcm
我試圖把在火力消息令牌直接消息我臺測試設備,但也向0的消息。
我該如何調試Firebase中正在發生的事情?我可以在某處看到註冊設備的列表嗎?我已經在蘋果和firebase上配置了APN證書,所以不知道下一步該去哪裏。
我在我的應用程序中獲得一個firebase令牌,所以不知道是否還有其他需要做的事情。
class App extends Component {
componentDidMount() {
FCM.requestPermissions(); // for iOS
FCM.getFCMToken().then(token => {
saveTokenToMyProfile(token);
});
this.notificationListener = FCM.on(FCMEvent.Notification, async (notif) => {
// there are two parts of notif. notif.notification contains the notification payload, notif.data contains data payload
if(notif.opened_from_tray){
//app is open/resumed because user clicked banner
}
this.refreshTokenListener = FCM.on(FCMEvent.RefreshToken, (token) => {
console.log(token)
// fcm token may not be available on first load, catch it here
});
}