[英]react native onesignal android push token is null
I'm using react-native-onesignal and I'm getting push token is null. 我正在使用react-native-onesignal并且推送令牌为null。
async componentDidMount() {
const { currentState } = AppState
OneSignal.init(ONESIGNAL_APP_ID)
OneSignal.configure();
OneSignal.registerForPushNotifications();
OneSignal.addEventListener('received', this.onReceived)
OneSignal.addEventListener('opened', this.onOpened)
OneSignal.addEventListener('ids', this.onIds)
}
onReceived = (notification) => {
console.log("Notification received: ", notification)
}
onOpened = (openResult) => {
console.log('Message: ', openResult.notification.payload.body)
console.log('Data: ', openResult.notification.payload.additionalData)
console.log('isActive: ', openResult.notification.isAppInFocus)
console.log('openResult: ', openResult)
}
onIds = (device) => {
console.log('Device info: ', device)
}
in addition in onesignal website under users I get the error google play services library error 另外在用户下的onesignal网站上,我收到错误谷歌播放服务库错误
您应使用onesignal帐户中的应用程序ID替换ONESIGNAL_APP_ID(登录到onesignal帐户后,可以在“设置->键和ID”标签中找到)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.