Please can someone help me here. I just can’t get this code to work.
I have an app that naturally calls a series of other apps making up my entire web-application.
Part of the service offered is PUSH notifications which I have chosen PushAlert.co .
As the user opens the app they need to be asked if they wish to receive PUSH Notifications.
At whish point I need to catch the subscriber id, as these are the folks we want to send PUSH to.
If a user has said No and they wish to subscribe after, I need to again capture their subscription id.
Below is the code I have but for whatever reason I am unable to get the subscriber ID from the console.
Please can someone help me (and yes I have asked them but their replies are meaningless)…
Here is a link to their online documentation. [JS API - PushAlert](https://PushAlert Documentation)
?> <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> </head> <body > <p id="browserPush"></p> <script type="text/javascript"> (function(d, t) { var g = d.createElement(t), s = d.getElementsByTagName(t)[0]; g.src = "https://cdn.pushalert.co/integrate_c0108a215df8f0f09b1b72a6bfa87417.js"; s.parentNode.insertBefore(g, s); }(document, "script")); (pushalertbyiw = window.pushalertbyiw || []).push(['onReady', onPAReady]); function onPAReady() { console.log(PushAlertCo.subs_id); //if empty then user is not subscribed (pushalertbyiw = window.pushalertbyiw || []).push(['onSuccess', callbackOnSuccess]); function callbackOnSuccess(result) { console.log(result.subscriber_id); //will output the user's subscriberId console.log(result.alreadySubscribed); // False means user just Subscribed // var deviceID = data.device["deviceid"]; let url = "https://www.myiapps.net/v9/Acces_receipt/Acces_receipt.php?fetch_id=" + result.subscriber_id + "substatus=" + result.alreadySubscribed; window.open(url,'_self'); } (pushalertbyiw = window.pushalertbyiw || []).push(['onFailure', callbackOnFailure]); function callbackOnFailure(result) { console.log(result.status); //-1 - blocked, 0 - canceled or 1 - unsubscribed let url = "https://www.myiapps.net/v9/Acces_receipt/Acces_receipt.php?substatus=Failed"; window.open(url,'_self'); } } </script> </body> </html> <?php