Skip to main content

I have set up an integration between OneSignal and RevenueCat, checked over the App ID and API key, both are correct. I recently found out that our app was not setting the OneSignal ID and on the Purchases SDK for flutter (8.0.1). We fixed this and checked that the user does indeed have a valid OneSignal ID and it should be sending the given data tags to OneSignal.

 

however it seems that when i look through the integration logs that RevenueCat sends empty body to OneSignal and in turn gets a 404 reply with the given error below (the webhook to our backend sends the update correctly so theres no issue there). Note: i have not change any of the tag names so they are default

{"errors"::{"code":"subscription-0","title":"Subscription not found"}]}

 

Any idea why this is happening?

 

EDIT: seems flutter SDK still only supports old device centric (9.0) version of RevenueCat, does this mean the integration does not work at all in that case unless we set it manually?

seems i found the issue - oneSignal is switching to user centric approach in their API, however most SDKs they have dont support this new approach (ex. the flutter SDK and most server side SDKs).

The issue is, that oneSignal Flutter SDK returns {externalId, onesignalId} however the oneSignalId is the new user centric user id (not subscription ID, so its not the same as ReveneuCat “onesignal ID”) and since RevenueCat SDK is also behind, the helperMethod setOnesignalId() is also not correct usage then (since it expects subscription ID in that field)

 

Solution - use to set the correct user ID and the integration start working again

Purchases.setAttributes({'\$onesignalUserId': userState.onesignalId!});

 


Glad to hear you got it working! We do have support for both the device-centric and user-centric OneSignal SDK versions, but you do have to configure your app differently depending on your OS SDK version.