OneSignal FREE plugin for FREE and UNLIMITED Push Notifications šŸ“±

hey @lorenzo,
Iā€™ve fixed it for you. From the lack of reply Iā€™m assuming (and hoping) that it is indeed fixed. Let me know if you need anything else.
@all sorry for my absence, Iā€™m back now, will resume working on the plugin.
If you have any issues, post them here. Also, if it works for you, please give it a 5 stars on the plugin page. From 611 installs, canā€™t all be wrong/not working :slight_smile:

IMPORTANT UPDATE.
The script has been updated to allow sending push notifications to Multiple Player IDs of the same user account.
So if a user has more than 1 devices, it will send the push notification to all.
The update is live.
The only thing left to figure out now is how to save multiple IDs. Maybe I am too tired right now and canā€™t make the workflowā€¦ wellā€¦work :slight_smile:
Iā€™ll be back tomorrow with a refreshed mind.
If you have any ideas, feel free to contribute. Thanks
Thanks to @Reduble.com for the update on the plugin.

L.E. YES, by multiple devices I mean everything: mobile (phone and tablet) different or same Operating System, and desktop (safari, chrome, etc). One push notification to all at once.

1 Like

hie there, would like to thank you for the information on push notifications you have presented to this Forum, I wanted to ask though on Player ID for individual push notifications, its to my understanding from your tutorial that a user is only assigned a unique player ID once they login right? So before a user logs in how do i create a workflow which gives the command to send a push notification to a particular person, yet the player id hasnt been created yet? example im creating an app like Uber wr when a Client requests a Ride a push notification is supposed to be sent to a specific driver but problem is since this unknown specific driver would not have logged in at the time im creating this app how then do i write the workflow when the player id hasnt been created yet?

Hi.
You cannot register a guest as you donā€™t know who that is, unless youā€™d use cookies for example which is mot that reliable if the cookie expires or the user clears cache and cookies.
Iā€™ve fixed the multiple device usage, just stated that in the previous post.
I will prepare documentation for that also.
Since my huge disappointemnt where Iā€™ve spent thousands on USD on countless hours and even gave extra minutes up to 1 hour from 10 hour pack because I thouht it would be nice to do so since sometimws Iā€™ve exceesed the hour by a few minutes each time, now I found out that I should take another hour for a 10 sec question-fix.
So that changes everyrhing.
The plugin will remain free forever, as I promised, I am a man of my word.
I will make free documentation for the last update - documentation that others are not offering, not even on templates!!!
But for any help, you will have to either ask here and someone will help you, or pay per hour my help. 1 hour - 100usd. I can set it up from scratch or help you fix the one signal push notification setup only. And it will be tested only with superview.
It can take me 1 minute or 59, I will charge 1 hour. If it exeeds 60 minutes, starting with minute 61 there will be another 100usd PREPAID.

I AM TRULY sorry I have to so this, but it seems the only way.
Enjoy the free plugin and free documentation.
I will provide the documentation later after I figure something, how to properly register the multi PlayIDs.

https://bubble.io/page?type=page&name=index&id=onesignalplugin&tab=tabs-1

Here you go. Updated plugin to register (and send to) multiple PIDs. This is okay for a case where the user would login to its own account from multiple devices: iPhone, iPad, Android phone and/or tablet, etc.
Still need to test some features but it should work for now! Consider it in beta for the next 24-48 hours.
I will implement the desktop code to register the PID also.
So now you only need ONE javascript for iOS and Android. The same UPDATED javascript will work for desktop browsers also.
Enjoy!
L.E. For some reason the expressions cannot be pasted from my app (as intended) to yours, directly! Even though all the plugins and elements were installed before pasting the workflows.
So if anyone has any idea for a fix, go for it, otherwise read the workflow and recreate it on your page.
Start with SET workflow and then go to page is loaded. Before that be sure you have the toolbox (and javascript to bubble) installed and also the OneSignal plugin installed and updated to latest version.

First off, thank you for all your hard work in developing this plugin, as well as for your patience in assisting the rest of us. I cannot imagine how frustrating it must be at times to have to answer all of our questions as if you were being paid to do so.

Having said that, I have what is probably a silly question. I copied your workflows and named my field in the User table to match your workflows. I carefully compared the setup of your application to mine to ensure I had implemented the expressions exactly how they were stated in your application.

I am sure I am missing something simple because the javascript is sending the value ā€œandroid_idā€ to the javascript bubble element (using a text field, I can view the value of the javascript bubble element). I am guessing that the javascript bubble element is expecting a different value, which is why I am not seeing a text appear in my ā€œPIDmultipleā€ field within my User table.

Do you have any recommendations to offer this newbie? I appreciate you taking the time to read my post, and I especially appreciate the free plugin and documentation.

I should probably add that I am only interested in making a web app, and therefore I only configured the two Web Push Platforms within OneSignal.

Hey,

Sorry, I didnā€™t have the time to take it out of beta, still need to test it on Android. It works just fine on iPhone, but I still need to do the testing on android.
Consider it in beta still, and I will come back with an update the next following days.

Sounds great, mvandrei. Also, just to clarify, I am mostly interested in the ability to push to a web browser, as opposed to an app.

Thanks again.

well that part is already working. You just have to configure/setup onesignal plugin to work with all browsers, not just some.

Hey! Did you find a solution for this? I can only get ā€œandroid_idā€ value when page is loaded on chrome. I try to enable push notifications on chrome and eventually in iOS and Android. I just thought it would be easiest to start with browser.

yes, the ā€œandroid_idā€ was just a test, static text.
I will update the code tomorrow. Need to be sure everything works perfectly.
Again, the code works with superview, should work with others that use the same implementation of onesignal, but I canā€™t guarantee.

Actually, you know what, hereā€™s the code. Maybe youā€™re in a rush. itā€™s still under BETA until I test it and be sure it works perfectly.

/* 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(detail.id)) ? -1 : parseInt(detail.id);
                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 name = detail.name;
                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() {
    window.bridge.post('onesignaltoken', {}, (results, error) => {
        id = results.token;
    })
}

if(device.ios()){
   getOneSignalToken();
console.log("its ios");
}else{
console.log("its not ios");
id = android.getOneSignalRegisteredId();
}
setTimeout(function codeAddress() {
    bubble_fn_1(id);
}, 1000);

and /* wk.bridge.min.js | v0.2 */(function() { if (window.isIOS) {    - Pastebin.com as backup if you canā€™t take it from here.
Please note that you only need ONE javascripttobubble now, it will save from Android OR iOS in that and take it to the db from there.
No need for different javascripttobuuble elements like A and B.

I added this code from pastebin. Hmmā€¦ I didnā€™t get any value this time when I tried to open page on Chrome on Mac.

ā€¦ do you guys EVEN read the description?

THIS ONLY WORKS WITH SUIPERVIEW WRAPPER FOR ANDROID & iOS!!!

How would you expect it to work on Chrome on mac?
I will make it available for desktop browser in a short while, we need to update the code to also register a PlayerID from desktop browser, but itā€™s NOT ADDED as for now.
L.E. Iā€™ve also updated the bubble project page so you can copy the updated worflows.

1 Like

Hey, Sorry man. Yes I did read it. I appreciate what you are doing. I just got a bit confused with a step 4.0 and what is working and what is not. That is why I directed my question to destryhunt.dh in a first place. I do get that it works with Superview but not with browsers 100%. I just bought Superview so Iā€™m able test it with it too.

You are doing an amazing job!

Great, good luck with the superview. Feel free to come back if you need any help.
The browsers will work soon. Maybe on Wednesday the soonest. No promises!

Thanks! I will go through Superview videos etcā€¦ I should have everything set up correctly. Looking forward to get browsers on board too.

Ps. You should set up a donation option for this plugin.

I will, others told me this, but I need to have it 100% functional first. I wasnā€™t looking for money when I did this, I just created it for meā€¦ and gave it for free to others, but I know the feeling when thanks itā€™s not enough and you want to donate :slight_smile: I will put it in an account for the humanitarian projects and itā€™s still a win.

1 Like

Do not forget that OneSignal is a big privacy concernā€¦

then go to another service that does the same, but you pay for each message :slight_smile:

I have no intention on using such a service, I just wanted to warn others that the cost of this service is their users dataā€¦