Hello, could someone help me understand the logic for how Bubble creates a device for a user with push notifications? For example, does a device only get created when a user signs up? Or on page load? What if the user already has an account and logs in on a different phone?
The logic is simply when a user accepts to receive notification. You can trigger this on page-load or via an action.
Lets say User A using “iphone 4”, opts in to receive notification, this will create a “device” record on your database, obtaining the user and the device information
Lets say the same user finally buys a new Samsung s6, logs in and opts in to receive notification also, a new device record will be created with the user and the mobile details.
Each “device” record is a unique combination of a “user” and their device.
Hope this helps.
So if no records exist, its safe to assume they have not registered, and we can prompt them to allow notifications on page load? Or is there a better way to handle that scenario?
Yes correct. Once they accept, a record will be created.
You can do, on-page-load, or you can do a button trigger. Personally i use a button trigger on a sheet letting people know thay about to activate push notifications. I got this idea from twitter/X
Is there a way to detect if their current device has a record already? for example if i registered 1 device and just got another device, i would need to check if that record for this device exists, and not just check if any record exists
In the device section I see all the push notifications that are sent, more than the devices. Is there any mistake in your opinion or am I misinterpreting?
Not sure what you mean by seeing all push notifications sent - I’m referring to the device records in the device data type
I am not familiar with the Mobile stuff but can’t you so like every other app does?
Every time you install the app, it asks to send notifications and you must accept or deny, then store this device as the current device. Not sure if bubble has such a check tho
Or you can store the “last logged in” device for the user and if the current device is not saved - prompt again
Me too. I see the individual push notifications sent to users.. Or at least I interpreted it like that.. I see more records even for the same user so I took for granted the individual push notifications.. @nick.carroll
So there is no explicit check for if a particular device has granted location permissions yet or not - but, if you request permissions, and you’ve already enabled it, it won’t actually re-request. So in your onboarding, feel free to request without a conditional!
Thanks @nick.carroll , it would be great for us to detect if user turned off notifications - for apps that critically need them to function properly with time sensitive functionality , so that we can do actions if we detect they’re currently turned off
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.