我正在测试使用我的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
});
}