Reputation: 357
I'm using react-native-onesignal and I'm getting push token is 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
Upvotes: 0
Views: 1588
Reputation: 260
You should replace ONESIGNAL_APP_ID with the app id from your onesignal account (can be found in settings -> keys & id's tab after logging in to onesignal account)
Upvotes: 2