反应原生的信号android推送令牌为空

时间:2018-05-20 20:23:42

标签: android react-native onesignal

我正在使用react-native-onesignal而我正在获取推送令牌为空。 enter image description here

 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)
}

另外在用户的onesignal网站上我收到错误google play services library错误 enter image description here

0 个答案:

没有答案