Iām using dropsource to wrap my bubble app. Does anyone know what the js bridge would be to get the player id to populate from onesignal? The ones in this thread or in pastebin donāt seem to be working.
I was not within a wrapper. It was intended for a PWA - progressive web app (added to home screen app). Managed to make it work for desktop browser notification but not for PWAā¦
Hey @mattmazzega! Still no luck with finding a solution for the PWA?
Was stuck on that myself a month or two ago, and now coming back from a hiatus to try again (was planning to have an iOS download, but just stick with a PWA for android)
Hi @merav.leviten
For PWA on Android, notifications are working. With PWA on IOS, notifications are not possibleā¦
Hi, can anyone suggest me how to send push notifications only to the specific category of the user using OneSignal?
Excellent work putting this together @mvandrei
I bet many bubblers have benefited from this post and your plugin.
The code provided for the web didnāt work for me, Although, I manged to get it to work using the below code:
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
bubble_fn_1(userId)
});
}
});
Iāve been using a single āspaceā in the URL field so a push doesnāt load a URL at all, which has worked for the past 3 months - thanks Jameson! However, this hack has recently been causing my hybrid apps to crash if the user receives the push while the app is open.
Iām using SuperView as the web wrapper for iOS. Havenāt changed anything - same iOS devices iPhone 5 and 7, iOS 11.3 (hasnāt been updated since Iāve used the single āspaceā trick). Just thought Iād post this here in case others have a similar issue. Will update if I find a solution.
Edit: Havenāt changed anything again, but push notifications are no longer causing my app to crash Concerning inconsistent behaviour, if I work out why this is, Iāll update here.
Some tips for using the Javascript to Bubble:
Make sure it is āvisibleā on the page, although it can be tiny and underneath something else.
If you enable the āeventā option, you can start a workflow from the event triggered by running bubble_fn_1(value)
. The workflow will then run at the right time to ensure having the value passed in.
Iāve also played with the REST API, and found if you leave out the url, clicking the notification opens the root domain of the app, i.e. https://myapp.com or https://myapp.bubbleapps.io (no version_test).
This seems fairly useless, so may as well point to a page and parameters that have some meaning to the notification.
@mvandrei there are a lot of possible combinations of parameters for the create notification API call.
I suggest making (another call) the entire JSON body as the only parameter, and have something like what you have now as a sample value. Its harder for the Bubbler to edit, but much more flexible. The only downside is having to put the APP-ID into each call in the workflow.
Iām trying to develop a web app (mobile). The prompts (bells) for allowing notifications do show up, however the user never gets registered despite me clicking to subscribe many times. I canāt figure out what is going on and Iām not familiar with any JS.
Edit: The problem was that there was no OneSignalSDKWorker.js file. Canāt find mysite.com/OneSignalSDKWorker.js
Is this something wrong with the plugin or my setup on Bubble or OneSignal?
If your app is on a paid Bubble plan, you can host the three files OneSignal looks for.
If your app is on the free plan, you can use OneSignalās ānon-httpsā option, where they host the files for you on a subdomain of their site named after your app.
Thanks! Mine is on a paid plan and Iāve tried the hosting files in the root directory option under SEO/Metatags, but it doesnāt seem to work. I still canāt access mysite.com/OneSignalSDKWorker.js, it returns the 404 page.
How does one go about hosting the files to make sure it shows?
Some possible traps in this topic:
Thank you! That solved my issue.
Hey guys! Has anyone found an elegant way to send an individual push message to multiple users? (i.e. when a user messages a list of friends)
I thought that scheduling the API workflow on a list might be handy, but it wonāt trigger external actions, i.e. this plugin.
I suggest use the API Connector Plugin, make your own API call to OneSignal ānotificationsā ā¦
This is what I put in the value, approximately ā¦
{ "app_id" : "APP-ID", "data": {"foo": "bar"}, "contents" : {"en" : "text"}, "include_player_ids" : ["PLAYER1","PLAYER2"], "url" : "https://example.com", "headings" : {"en" : "title"}, "ios_badgeType" : "Increase", "ios_badgeCount" : "1" }
This setup for the API call lets you use most of the options as described in OneSignalās API doc. They recommend setting up āSegmentsā or groups of users to send to at the same time.
Yes you could schedule an API workflow to do the API call as above.
: )
Hello, Iām also having issues to get the player ID from android devices, I tried this but I donāt get the player Idā¦
Could you please tell me what do I need to be able to get the player ID?
Thanks
Hey @merav.leviten,
Did you find an easy and elegant solution? I have the same issue right now, did you go through the API Connector as suggested by @mishav?
I cannot create segment on OneSignal as the group is dynamic and changes often. I would like to send directly individual messages to a dynamic list of users. Your input is much appreciated.
Best,
Daniel
Hey @mvandrei,
first of all thanks a lot for your free OneSignal plugin
Second, Iām facing an issue following your instructions.
I can do everything except use CURRENT USER in the field WORFLOW DATA
So, I think itās for this reason that it does not save anything in my DB.
Should maybe add also the JS BRIDGE code from the web view documentations?