Question

One signal integration doesn't worki - webhook response error 400

  • 5 August 2021
  • 3 replies
  • 71 views

Badge

Hello,

I have a problem because I tried to integrate onesignal with revenuecat, and followed OneSignal integration guide, userid is set correctly but when the purchase is made or renewed webhook of onesignal is in “Retrying” status forever. And it gives response error 400 and this is the output:

{  "CF-Cache-Status": "DYNAMIC",  "CF-RAY": "67a058b2ad045d8b-IAD",  "Connection": "keep-alive",  "Content-Length": "41",  "Content-Type": "application/json",  "Date": "Thu, 05 Aug 2021 13:24:34 GMT",  "Expect-CT": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"",  "Server": "cloudflare",  "access-control-allow-origin": "*",  "alt-svc": "h3-27=\":443\"; ma=86400, h3-28=\":443\"; ma=86400, h3-29=\":443\"; ma=86400, h3=\":443\"; ma=86400"}

 

This is the HEADER, the body is empty.

I will be grateful for any sugestions.

 


3 replies

Userlevel 3
Badge +7

Hey @DavidCz!

I’m seeing on our end the following error:

{"errors":["No user with this id found"]}

Can you confirm the user that you’re trying (the $onesignalId) exists in OneSignal?

Badge

Oh alright, I am setting oneSignal externalUserId as the same we use throughout our app and the same we use with revenue cat so when I Purchases.setOneSignalId I also set our user id. But I understand now that this won’t work?

Also it is a shame that this error that you are seeing doesn’t show on our end so I would already try with different user id yesterday if I knew that :D

 

EDIT:
@cody Unfortunately it is still not working after setting the “original” OneSignalID which I can find and exists in OneSignal 

Userlevel 3
Badge +7

@DavidCz,

The OneSignal ID should be from the OneSignal SDK directly:

if let onesignalId = OneSignal.getUserDevice()?.getUserId() {
Purchases.shared.setOnesignalID(onesignalId)
}

Can you confirm that’s how you’re setting the ID? Additionally, can you ensure you’ve made a new purchase after setting this property so the attributes can re-sync with our backend?

I’d also recommend trying with a brand new installation, sandbox user and OneSignal user.

Reply