[OneSignal Plugin] Bad Request when user is not loged

[OneSignal Plugin] Bad Request when user is not loged

  
Forge Component
(9)
Published on 19 Oct by OutSystems R&D
9 votes
Published on 19 Oct by OutSystems R&D

Hi,

I'm sending a notification to UserId when i write a message in a chat.

If the User Reciver is loged, all work fine, but if this user log out and log in with another user, the "SendPushNotificationToUserId" action return 400 Bad Request.

How can i send notification and when the user log in recive it?

Thanks.

Hi,


I'am also encountering this issue as of the moment. Any progress so far on the changes you made?

I'am also on the impression that the user will receive the notification when he/she logged in the application.

Alberto De Vargas wrote:

Hi,

I'm sending a notification to UserId when i write a message in a chat.

If the User Reciver is loged, all work fine, but if this user log out and log in with another user, the "SendPushNotificationToUserId" action return 400 Bad Request.

How can i send notification and when the user log in recive it?

Thanks.

Hi Alberto,


in my opinion, you can "unregister" device when the user logout.

So the user will not receive the push notification when the user logout


Thanks.

Dicky Wang wrote:

Alberto De Vargas wrote:

Hi,

I'm sending a notification to UserId when i write a message in a chat.

If the User Reciver is loged, all work fine, but if this user log out and log in with another user, the "SendPushNotificationToUserId" action return 400 Bad Request.

How can i send notification and when the user log in recive it?

Thanks.

Hi Alberto,


in my opinion, you can "unregister" device when the user logout.

So the user will not receive the push notification when the user logout


Thanks.


Hi Dicky Wang,


But when the user logged in again, will he/she receive the notification?


Regards,

Jay

JaySmooth wrote:

Dicky Wang wrote:

Alberto De Vargas wrote:

Hi,

I'm sending a notification to UserId when i write a message in a chat.

If the User Reciver is loged, all work fine, but if this user log out and log in with another user, the "SendPushNotificationToUserId" action return 400 Bad Request.

How can i send notification and when the user log in recive it?

Thanks.

Hi Alberto,


in my opinion, you can "unregister" device when the user logout.

So the user will not receive the push notification when the user logout


Thanks.


Hi Dicky Wang,


But when the user logged in again, will he/she receive the notification?


Regards,

Jay

Hi Jay,


Yes, the user will receive again because the device id and player id will detected again in onesignal, and don't forget you must put the "register" push notification, after the user login in the application.


Thanks.


Thanks @Dicky Wang! Will surely try it out. Thanks :)

Alberto De Vargas wrote:

Hi,

I'm sending a notification to UserId when i write a message in a chat.

If the User Reciver is loged, all work fine, but if this user log out and log in with another user, the "SendPushNotificationToUserId" action return 400 Bad Request.

How can i send notification and when the user log in recive it?

Thanks.

Did you manage to fix this? Would like to know the solution..