[OneSignal Plugin] Bug variable SenderAfter cause 400 Bad Request Error

[OneSignal Plugin] Bug variable SenderAfter cause 400 Bad Request Error

  
Forge Component
(5)
Published on 23 Nov (4 weeks ago) by OutSystems R&D
5 votes
Published on 23 Nov (4 weeks ago) by OutSystems R&D

Hello there's an error with variable SenderAfter inside project OneSignalPlugin, when this variable aren't sent by user the component put DefaultValue equal CurrDateTime(), in systems when the default pattern of Date is DD/MM/YYY this doesn't work because one signal wait for MM/DD/YYYY. It's not necessary to inform this to OneSignal if you send empty OneSignal will send immediately, bu if was necessary to inform the component need ensure the correct form the single conversion date to text won't work.

To correct this I change OneSignalAPI project inside ServerActions/PushNotifications/PostNotification and change the Assign in the option false of Has Deeplink to 

If(DateTimeToDate(SendAfter) = NullDate(), "", SendAfter)

instead of

If(DateTimeToDate(SendAfter) = NullDate(), CurrDateTime(), SendAfter)


It's necessary remove DefaultValue of variable SenderAfter of all methods.


I hope I have helped.

Thank you Alexandre.

I was facing the same issue. although I went a little further I set up site property for the date format and applied the following fix

FormatDateTime(If(DateTimeToDate(SendAfter) = NullDate(), CurrDateTime(), SendAfter), Site.DateFormat)

with Site.DateFormat = 

"dd/MM/yyyy HH:mm:ss UTC-0400"

Since we are using REST it's advice to UCT time.


I hope I helped.



Hi Vitor it's a good option, but the better one is team solve problem inside component. I think someone of developer team can put here what they think about this.