YmChat.setPayload null on flutter iOS

Hello can someone help me I do not know what is wrong with my Flutter iOS version of the app.
If am missing something on the info.plist for the payload to be receive
it works fine on Android

screenshot on app

Greetings

We have checked the issue, this is not reproducible
Can you check following steps to solve the issue

  • Update SDK t latest version (2.2.0)
  • Check from bot side if any custom script is written

If above steps doesn’t help

  • Please provide botID
  • SDK version where issue is reproducible
  • Sample payload where issue is present
1 Like

Hello @Purush
Thank you for responding.
1- yes I am using latest SDK
2 - Bot side has no custom script from what I know


botID - x1657075506812
SDK used - 2.2.0 or 2.1.1

Sample payload: (flutter code)
if (Platform.isAndroid) {
YmChat.setPayload({“integration”: “Flutter - Android”, “CUID”: “123456”});
print(“build on Android”);
} else if (Platform.isIOS) {
YmChat.setPayload({“integration”: “Flutter - iOS”, “CUID”: “123456”});
print(“build on ios”);
} else {
YmChat.setPayload({“integration”: “Flutter”, “CUID”: “123456”});
print(“build on somethingelse”);
}

Hello,
Can you please check weather you are parsing payload before accessing it. As payload will string for mobile users

Please check this solution for accessing payload properly

Hi @Purush
Just want to inform you :slight_smile: we got to fix or pass the payload on iOS
what we found out was that on Android the structure of the payload object was something like data.profile.payload.dataVariable…
while for iOS the payload object was data.profile.payload.payload.dataVariable :smiley:

so what we did we just made a function to de-structure if iOS and return the normal profile.payload

return new Promise((resolve) => {
  const iosPayload =  data.profile.payload.payload || {};
  const profile = {
    ...data.profile,
    payload: {
      ...data.profile.payload,
      ...iosPayload
    }
  }
  resolve(profile); 
}); 

I think we could close this tread or if someone out there would encounter our experience on flutter iOS hope this help :ok_hand:

1 Like