Get OneSignal Player ID from a OneSignal SDK

I just buy an app from Nativator, as you can see on the topic below.
But the thing is I want to get the player ID from Bubble in order to send targeted pushs.

I tried this solution from the Bubble Forum, but it’s not working for me, I always get a null value.
I asked Nativator if they could put the player ID as an URL parameter, they said they can’t.

What are the best options to retrieve this Player ID ?
Thanks :heart:

1 Like

No one have faced this issue before?
I’m currently blocked on my app development.

it depends on what plugin you’re using! You need a bridge between mobile wrapper/app and bubble.

Hey @mvandrei, first let me thank you for answering!
I’m using the Copilot free plugin, but it’s like all the other OneSignal plugins I guess? (I mean they are all working with Player ID in order to send notifications through the API)

According to Nativator support :

Getting the player id is done from you end or on your One signal account.

And they definitely won’t help for this, and I thought they would when buying

I don’t know copilot’s one, but as far as I now, I did the only one that can target mobil too + user management: you don’t want to keep a device locked to an account.
You need to detect what kind of device is (laptop or mobile (iOS or Android) in order to run a specific code to get the PID. And you want to do so when the user is logged in, otherwise it has no logic to it.
With my plugin you can add a PID to an account and delete it upon logging out of that account. So you always manage your PIDs the right way.
To be able to do so, you need a bridge between the mobile app wrapper and bubble.
My plugin is OneSignal PRO plugin but be advised, after @bubble.onesignal made their own plugin, even if I asked them a few years back to make one for bubble and I’ve explained to them what a big community and opportunity they have here (read as in market), they changed something in their API and it doesn’t work anymore. Looking for a freelancer now to fix it fast.

Yeah, unfortunately, a lot of ‘good developers’ that believe they are entrepreneur will not provide full support or will hold some information, making you think that you have it included.

In order to get the PID, as I said above, you need to get it from their mobile app. The OS SDK included in iOS/Android will read it, but in order to access it you need to call it from bubble.

It’s like this:

Mobile wrapper → loads bubble app.

Bubble has no idea what device is, needs to find out, then RUN SPECIFIC code for that platform (web, android or iOS).

So. your bubble app will talk to your mobile wrapper, asking via this javascript bridge, what’s the PID.
Then it will save it to your user.
After that, when you send a push notification, you send it to your user that can have one or many more PIDs, depending on how many devices your user is logged in.

@mvandrei Thanks for clarifying!
But do the javascript code can always find the PID (I mean whatever is the wrapper I use)?
If yes I probably made a mistake setting up the javascript code…

Let me know if your plugin goes live again by the way

Hey, no worries.

I am not sure of how webviews are working. I’ve only tested with superview from codecanyon and it worked perfectly!

My plugin is live, but not working currently, will do let you now once it’s fixed. I’m having a hard time finding someone to fix it.

@mvandrei I just tried your plugin in order to get the player ID.
I got this error, is that the problem you reported or it’s something else I’m missing?

as I said, the API changed, and I need to update it. Posted a job offer on the forum and nobody was interested… will keep searching for a dev to fix it. Hopefully today.

You are charged prorated so if you cancel now it won’t charge you at all :slight_smile: or like 0.0something.
Will get back to you once it’s fixed and I will make a proper tutorial on how to use it.
I’m sorry for the inconvenience

Thanks for claryfing.
Don’t apologize for this! That’s already a great thing to have this plugin.

1 Like

Version 1.0.1 is available NOW. Enjoy it!
A full tutorial will be available over the weekend.

Hi @vnihoul77

This issue was solved and we are happy to update your app so you can extract the playerid.


This topic was automatically closed after 70 days. New replies are no longer allowed.