Forge Component
(2)
Published on 2019-01-14 by Daniel Martins
2 votes
Published on 2019-01-14 by Daniel Martins

Hi all,

I have installed this sample in my phone (the OS version is 11.6.18, Android 9.0 in a Samsung A50, MABS version 6) and have encountered the following:

- When I click on "Send to me", I get "400 Bad Request". In the integration report of Service Centre, the error is "{"errors":["You must include which players, segments, or tags you wish to send this notification to."]}".

- When I click on "Send to all", no error appears but also no push notification. The integration log of Service Centre gives: {"errors":["You must include which players, segments, or tags you wish to send this notification to."]}.

There is clearly an issue on giving the users to OneSignal, so I checked the OneSignal console and found the following:


If I understand it correctly, there are two reasons why this might be happening:

1. the app is not synchronizing with OneSignal properly

2. the fetching of the UserId at the registration step is not working

I have read the official documentation but cannot find a solution. Does anybody have an idea?

Thank you for any help!

Hi Sofia,

On the App you need to use the Client Action RegisterWithUser to register the device, associating it with a User Identifier.


You can do this the Login Client Action, per example.

David Rodrigues wrote:

Hi Sofia,

On the App you need to use the Client Action RegisterWithUser to register the device, associating it with a User Identifier.


You can do this the Login Client Action, per example.

Hi David, 


Thank you for your answer. I have already done it, passing GetUserId() as the user identifier. Below you can see that I call the RegisterWithUser action on the login, and that this action calls Initialize() passing the necessary parameteres.  Therefore I am a bit lost.


Are you using the app through Outsystems Now or did you install the apk on your device?


  • Use the with CheckOneSignalPlugin client action to confirm that the OneSignal Plugin is iniatializing on your device.
  • Check if the AppId is correct
  • Use the debugger to confirm that the your device is registering your device.


David Rodrigues wrote:

Are you using the app through Outsystems Now or did you install the apk on your device?


1. Use the with CheckOneSignalPlugin client action to confirm that the OneSignal Plugin is iniatializing on your device.

2. Check if the AppId is correct

3. Use the debugger to confirm that the your device is registering your device.


Hi David,

1. Did this, the OneSignal plugin is correctly initialized.
2. It is, in the integration log there is no error indicating otherwise.

3. The debugger tells me that the reason why my users are not registering is because the Initialize action in the OneSignal plugin detects "Failed to register: missing oneSignal UserId or PushToken". I have checked both Firebase and OneSignal and everything appears to be ok. Is there any place where I have to fill in my OneSignal UserId (so not the app id nor the REST key) that may be causing this?

Thank you for your time.


Hi Sofia,

In ServiceCenter -> Monitoring -> Integrations log you will be able to see the detail of the response that you are getting and why results in the 400 Bad request response.

Do you mind to share the detail of your integrations and what is in the response?


Best regards,

Daniel Martins

Additionally,

Please check the if you filled properly the Site Properties, and check the usage of the LocalSetting (Local Storage Entity):



This logic is important because it will be responsible to hold the right values for the Register and RegisterWithUser actions that are called during login and application ready events.

Somehow you are not passing the right values to these actions.

Hope it helps you.



Daniel Martins wrote:

Hi Sofia,

In ServiceCenter -> Monitoring -> Integrations log you will be able to see the detail of the response that you are getting and why results in the 400 Bad request response.

Do you mind to share the detail of your integrations and what is in the response?


Best regards,

Daniel Martins

Dear Daniel,


Thank you for your answer. Please find the attachment with the error log of the integrations. I have checked the local settings and site properties and cannot find the issue.


Hi Sofia,


Errors in OneSignal response:

{"id":"","recipients":0,"errors":["All included players are not subscribed"]}

{"errors":["You must include which players, segments, or tags you wish to send this notification to."]}


These errors indicate exactly that you don't have any subscribers.

You are not registering your devices successfully. That logic is done in the sample by making use of the LocalSetting local storage entity that is supposed to be filled with the values retrieved by the site properties, either you are not using the latest sample version or you are using a version somehow adapted by you and you missed that step.

Please review this logic that is called On Application Ready and SyncOnLogin logic.