N
Novu13mo 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
14 Replies
Pawan Jain
Pawan Jain13mo 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
EvzenSupler11mo 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
EvzenSupler3mo 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?
EvzenSupler
EvzenSupler2mo ago
I craate PR fór this issue https://github.com/novuhq/novu/pull/6794
GitHub
feat(providers): Add onesignal push provider new api by suplere · P...
What changed? Why was the change needed? This provider is by new Onesignal recommendation - new user model API. Here is the doc from Onesignal web. This provider not replace existing player based O...
Novu_Bot
Novu_Bot2mo ago
@EvzenSupler, you just advanced to level 2!
LUCKY
LUCKY2mo ago
I strongly agree that the best option is the external user id, as we use it to identity a user @Pawan Jain @Support do I understand correctly, that as of now, we cannot send a push notification to a onesignal external user id?
EvzenSupler
EvzenSupler2mo ago
The current implementation does not use external_user_id. It uses the old API.
Novu_Bot
Novu_Bot2mo ago
@EvzenSupler, you just advanced to level 3!
LUCKY
LUCKY2mo ago
@EvzenSupler thanks for your explanation, that‘s a real issue for us I am considering to build our own docker images with that fix in there Thank you @EvzenSupler I saw you closed the MR, any reason?
LUCKY
LUCKY2mo ago
@EvzenSupler nice, you created a new one, I actually also just did, what do you think about my MR? I like that you use the new API, I just changed the key with an override, a bit simpler: #6979
GitHub
feat(onesignal): provide the ability to send to include_external_us...
What changed? Why was the change needed? Implements: #3479 (comment), https://discord.com/channels/895029566685462578/1185702635219714219/1185702635219714219 This pull request enhances the function...
LUCKY
LUCKY2mo ago
GitHub
feat(providers): Add possibility to Onesignal choose version api by...
What changed? Why was the change needed? This PR add possibility to Onesignal provider choose between: a) player model b) user model User model documentation Expand for optional sections Special n...
LUCKY
LUCKY2mo ago
I'm happy with your version
SubsKeepr
SubsKeepr3w ago
Can someone explain this? I can't follow it. It should be using the new user-centric model v11 instead of the old device-centric model v9.
Novu_Bot
Novu_Bot3w ago
@SubsKeepr, you just advanced to level 1!
Want results from more Discord servers?
Add your server