Forum Documentation Showcase Pricing Learn more

OneSignal FREE plugin for FREE and UNLIMITED Push Notifications 📱


if it works for you, keep it :slight_smile:
But I doubt it, the iOS and Android snippets are different. I posted the ones that worked for me higher up the thread.


It works! i did exactly what you did


Got them!

Here are the ones that worked for me finally:


 /* wk.bridge.min.js | v0.2 */
   (function(){if(window.isIOS){return}window.isIOS=function(){return navigator&&navigator.userAgent&&(/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent))}}());
   (function(){if(window.bridge){return}window.bridge=function(){var callbacks=[],callbackID=0,registerHandlers=[];document.addEventListener("PacificDidReceiveNativeCallback",function(e){if(e.detail){var detail=e.detail;var id=isNaN(parseInt(;if(id!=-1){callbacks[id]&&callbacks[id](detail.parameters,detail.error);delete callbacks[id]}}},false);document.addEventListener("PacificDidReceiveNativeBroadcast",function(e){if(e.detail){var detail=e.detail;var;if(name!==undefined&&registerHandlers[name]){var namedListeners=registerHandlers[name];if(namedListeners instanceof Array){var parameters=detail.parameters;namedListeners.forEach(function(handler){handler(parameters)})}}}},false);return{"post":function(action,parameters,callback,print){var id=callbackID++;callbacks[id]=callback;if(window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.pacific){window.webkit.messageHandlers.pacific.postMessage({"action":action,"parameters":parameters,"callback":id,"print":print||0})}},"on":function(name,callback){var namedListeners=registerHandlers[name];if(!namedListeners){registerHandlers[name]=namedListeners=[]}namedListeners.push(callback);return function(){namedListeners[indexOf(namedListeners,callback)]=null}},"off":function(name){delete registerHandlers[name]}}}()}());

console.log('window loaded');
var id;
function getOneSignalToken() {
'onesignaltoken', {}, (results, error) => {
               id = results.token;
setTimeout(function codeAddress() {




function getOneSignalToken() {
     alert("RegisterId:" + android.getOneSignalRegisteredId() );

var token; token = android.getOneSignalRegisteredId();

They were copied from various places from this post, which I’ve now lost track of :joy:

Thank you again to everybody for your help!


Hi @mvandrei

I tried your plugin and after trying everything on this page , I’M unable to have any notifications on web or mobile… :sob:
In fact I never have the prompt of notification or anything…
Do the bridge JavaScript change anyhow ?


Troubleshooting starts with checking your devices are actually assigned a playerid in onesignal. Is this the case?


Hi Vincent! No, the javascript returns nothing, and on my OneSignal panel, no user has been added…


Does your app prompt to allow to send notifications? At that point (given that your onesignal and firebase settings are correct in your app (not the bubble app)) the device should get registered in onesignal.

is this iOS or Android?


No, It not even prompt me for notifications. However, here is the thing, I’m trying to do it in the case of Progressive webapp (i.e. added to the home screen app), so it’s not wrapped into a webview.


Neverthelees, I’m also trying to get web notification in Chrome desktop with no luck too…


Sounds like a problem with the browser notification setup within onesignal? I haven’t setup browser notifications yet… :frowning:


Ok…to understand: have you set up notifications only for apps that you have published on stores through webview?


Yes. I have looked at browser notifications but I haven’t implemented this. But since the devices are not getting registered with onesignal I think the issue is with not having onesignal webpush setup correctly.


Right…thanks for the help! I don’t reallt see what can be missing in my Onesignal config :frowning: Looks pretty easy, just to add a script in the header…but still nothing


Yeah, I’d imagine you’d be able to figure that out! Is there another site you can test it with? Plain html or wordpress? Sorry, can’t help you out further as I haven’t tried this yet.


Unfortunately not…just downloaded firefox and…it’s working here! So I need to understand why chrome is not triggering the prompt…


Could it be the popup blocker?


Well done! it was the popup blocker!


Now I need to effectively pass the playerID to Bubble. As my javascript still returns nothing


If someone get stucked too, Got the playerID back with this JS :

OneSignal.isPushNotificationsEnabled(function(isEnabled) {
if (isEnabled) {
// user has subscribed
OneSignal.getUserId( function(userId) {
console.log('player_id of the subscribed user is : ’ + userId);
// Make a POST call to your server with the user ID


on what platform?
If you want to get it from mobile, you need that wrapper from SuperView. it has the code implemented and the JS is adapted to that code to get it.
Can’t say it will work for other wrappers.
As for desktop browsers, you need to configure BOTH options Safari AND chrome&firefox.