ios - 我使用手机时没有收到“onPushTokenReceivedCallback”
问题描述
当我使用我的 iPhone 时,我没有得到令牌。当我使用模拟器时,我得到了令牌。我使用 nativescript-firebase-plugin 并在 main.js 中执行 firebase.init 功能。
我已经尝试了我在这个错误上找到的所有东西,或者我什至不知道它是否是一个常见错误。完整的初始化看起来像这样
firebase.init({
showNotifications: true,
showNotificationsWhenInForeground: true,
onPushTokenReceivedCallback: (token) => {
console.log(`onPushTokenReceivedCallback: ${token}`);
appSettings.setString('firebasemessagekeytoken', token);
},
onMessageReceivedCallback: (message) => {
console.log(`onPushTokenReceivedCallback: ${message.title}`);
}
})
.then(() => {
console.log('[Firebase] Initialized');
})
.catch(error => {
console.log(`error: ${error}`);
});```
解决方案
推荐阅读
- r - 从 R 中的维基百科中提取特定表格
- python - 如何在csv文件的每个逗号后添加换行符?
- python - 来自另一个df的具有多个条件的熊猫数据框布尔索引
- database - 为什么我应该为集合和文档使用生成的 ID(例如:firestore)
- weka - 应用任何过滤器时,Weka 工具不会出现任何变化
- r - R错误:新列会在现有列之后留下孔;如何解决这个问题?
- python - 如何在 for 循环中从 PRAW 访问帖子
- python - 如何传递来自不同 tkinter 小部件的多个参数?
- c - for 循环内的整数在每行增加 2,语句与它没有任何关系
- mysql - Mysql语法错误,问题是触发器后的END