N
Novu11mo ago
harrisyn

OneSignal issues

Hi, I have recently attempted to integrate OneSignal with Novu, and I am not sure the documentation answered some questions well enough or I probably didn't understand it well enough. I went as far as adding the credentials from onesignal in and that bit is fine, I added the sdk to my frontend application and have setup novu to set the device token. now this is where it gets confusing. I use the user ID for registering subscribers in novu, and this id is what I assumed the device token will be, except it is used as external_id in onesignal, and I would need to retrieve the onesignal_id or player_id in order to have the correct device token. this would mean I will have to make a separate api call to my backend in order to store the device token and this step seems redundant to me. I noticed that the onesignal implementation in novu uses the include_player_ids for device tokens, so the external id will not work, however onesignal supports the include_external_user_ids as an alternate to include_player_ids, and that would negate the need to fetch and use player_ids completely. At this point, I wonder, would it make sense to have an option as part of the configuration of onesignal to indicate if you use player_id or external_ids and that switches between include_player_ids and include_external_user_ids ? or have I completely missed something in my analysis?
No description
3 Replies
Pawan Jain
Pawan Jain11mo ago
Hi @harrisyn onesignal provider was added by some from the community. We need to check this with onesignal official docs if it can be changed the way you have suggested. we will update you about this
EvzenSupler
EvzenSupler9mo ago
Hello, now Onesignal works with Subscription ID. And use notification API from Onesignal - with DEPRECATING: include_player_ids. Correct one options is : include_subscription_ids. This is easy correction - rename include_player_ids to include_subscription_ids. https://documentation.onesignal.com/reference/create-notification
OneSignal Documentation
Create notification
Sends notifications to your users
EvzenSupler
EvzenSupler4w ago
But as @harrisyn wrote, the best option is use external_id -Onesignal recommendation. The user can be logged in on several devices and can receive notifications in several places. When using the Login function, an external ID is stored on Onesignal (in most cases, it is a user ID from the application database). And then it is used in the function as recommended: replace include_subscription_ids to include_aliases with { "external_id": option.target}. In step user novu.subscribers.setCredentials will be set Onesignal external ID as deviceTokens. In my opinion, this solution would better correspond to the current recommendation to use Onesignal integration. And it would not even require major interventions in the current solution. Any news about Onesignal providers?
Want results from more Discord servers?
Add your server