@Catweazle101 wrote:
Hi
I try to implement the PushNotification feature in my app using the OneSignal service.
Everything works at the moment, but now I’m trying to get the PlayerId from the OneSignal service but
I get an error in the try catch.
But the error says nothing :-((This is my code:
var notificationOpenedCallback = function (jsonData) { console.log('notificationOpenedCallback: ' + JSON.stringify(jsonData)); }; window["plugins"].OneSignal .startInit("2f288ebf-95ba-4f06-9348-fe6a63035ccb", "119423241284") .handleNotificationOpened(notificationOpenedCallback) .endInit(); window["plugins"].OneSignal.getIds().then((id) => { alert('playerid: ' + id); });
Attention
I only get an error if I add/use the getIds() method:window["plugins"].OneSignal.getIds().then((id) => { alert('playerid: ' + id); });
What do I wrong?
Is getIds() not the right method?
I didn’t find any method, which gives me the playerId, even on the Api-ReferenceAll tips are welcome
Posts: 2
Participants: 1