[OneSignal Notification Plugin] How can i get PlayerId from OneSignal

[OneSignal Notification Plugin] How can i get PlayerId from OneSignal

  
Forge Component
(5)
Published on 2016-12-14 by Alexandre Costa
5 votes
Published on 2016-12-14 by Alexandre Costa

Hi,

after register device, i would like to save playerid but there is no output in plugin.

how can i get this output?

regards

fkaratay wrote:

Hi,

after register device, i would like to save playerid but there is no output in plugin.

how can i get this output?

regards

Hi please take a look at the demo.

http://www.outsystems.com/forge/component/1698/onesignaldemo/




I tried looking into that demo but the player ID always returns null.


I am using the below Javascript just like the demo. 

window.plugins.OneSignal.getIds(function(ids) {
    $parameters.playerId =  ids.userId;
});

Also how if the "DeviceID" mapped to the registered user? I cant find the corrilation between device ID and playeID.

Hi, you can send tags to OneSignal...

My approach is to send userid in "userid" tag.

Then I can send notification to that specific userid using tag as filter.

I think the problem is that I dont have access to the OneSignal APIs. It seems more likely that the API calls are failing because they cannot be found more than anything else. 


When I add the OneSignal plugin, does it contain the Javascript code required to run these APIs? I dont see it. All I see is the Extensible consifguration which points to a GitHub repo. 

After I add this GitHub repo as a plugin and rebuild the application I still seem unable to use the APIs. Can anyone successfully use these APIs?

The OneSignal API only contained Rest Api call which cannot be made public.

I think it only served as an example on how to send a push notification using rest api.

You can download OneSignal Plugin Demo to see how to send push notifications. 

If you're stack is .Net then maybe use the brand new official OneSignal plugin. (I didn't like it because it does not support both stacks since I have clients with Java stack too)