You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently working on a queue app and want users to get a notification when they are first in line.
I am very new to React Native and have never used One Signal before, but decided I wanted to use it.
All code below is part of my componentWillMount() method.
The part before the if-sentence is not working the way I want as I am not receiving any notification when OneSingal.postNotification(contents, data, playerId) is called. How should postNotification be formatted? Because right now nothing happens.
The part inside the sentence results in a error in the emulator when ran. Error is stating that the OneSignal.idsAvaliable() is not a function. I just tried to follow this; #4
const data = null; // some array
const contents = 'You are first in line';
const playerId = '7997ab8f-3029-4e2c-b58e-3072e0284435';
OneSignal.postNotification(contents, data, playerId);
//Checks current users place in line (if 1 a notification should be sent)
if (this.props.place === 1) {
console.log('you are first');
OneSignal.idsAvailable((idsAvailable) => {
console.log(idsAvailable.playerId);
console.log(idsAvailable.pushToken);
OneSignal.postNotification(contents, data, idsAvailable.playerId);
});
}
Any help would be much apreciated. I have gone through basically all information I could find on OneSignal and other similar threads. As I said I dont have much experience and the OneSignal documentation was not very helpful and too abstract. Thanks
The text was updated successfully, but these errors were encountered:
I am currently working on a queue app and want users to get a notification when they are first in line.
I am very new to React Native and have never used One Signal before, but decided I wanted to use it.
All code below is part of my componentWillMount() method.
The part before the if-sentence is not working the way I want as I am not receiving any notification when OneSingal.postNotification(contents, data, playerId) is called. How should postNotification be formatted? Because right now nothing happens.
The part inside the sentence results in a error in the emulator when ran. Error is stating that the OneSignal.idsAvaliable() is not a function. I just tried to follow this; #4
Any help would be much apreciated. I have gone through basically all information I could find on OneSignal and other similar threads. As I said I dont have much experience and the OneSignal documentation was not very helpful and too abstract. Thanks
The text was updated successfully, but these errors were encountered: