简体   繁体   English

反应原生onesignal android push令牌为null

[英]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.

相关问题 React Native:Null不是对象-推送通知(OneSignal) - React Native: Null is not an object - Push notification (OneSignal) React Native:不要求Android上的推送许可(OneSignal) - React Native: Not asking for push permission on Android (OneSignal) React Native Push Notification onRegister令牌为null - React Native Push Notification onRegister token is null OneSignal - Android React Native 中未显示弹出通知 - OneSignal - Popup Notifications not showing in Android React Native Android onesignal推送通知错误 - Android onesignal push notification error 针对Android的React Native Push通知 - React Native Push Notification for Android 尝试在 React Native 中从我的 Android 设备获取推送令牌时出现“无法获取设备的 GCM 令牌”,但出现此错误: - "Couldn't get GCM token for device" when trying to get the Push Token from my Android device in React Native but I get this error: 无法解析:com.onesignal:onesignal:3.12.3 on Native Android - Failed to resolve: com.onesignal:onesignal:3.12.3 on Native Android Android 应用程序在 OneSignal 推送通知上崩溃 - Android App crashes on OneSignal push notification Android从GCM迁移到oneSignal推送通知 - Android migration from GCM to oneSignal push notification
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM