Why iOS TransportSDK reconnection behaviour is different from Android SDK?

According to TransportSDK(v2.7.0) doc, the SDK will try to reconnect until it reaches the reconnectionTimeoutInSeconds:

However, for iOS SDK, it turned to Error state(com.genesys.cloud.messenger.transport.core.ErrorCode.NetworkDisabled) within 1 minute though reconnectionTimeoutInSeconds was set to 300 seconds.

This is the relevant log:

2024-07-31 15:55:02.611112+0800 CCaaS-Demo[89456:28950252] 🟢 Info: (MMSDKTransport State Machine) State changed from: Configured, to: Reconnecting
2024-07-31 15:55:02.611670+0800 CCaaS-Demo[89456:28950252] 🟢 Info: (MMSDKTransportReconnectionHandler) Trying to reconnect. Attempt number: 0 out of 10
2024-07-31 15:55:02.611690+0800 CCaaS-Demo[89456:28950252] 🟢 Info: (MMSDKTransportMessagingClient) connectAuthenticatedSession
2024-07-31 15:55:02.617456+0800 CCaaS-Demo[89456:28950252] 🟢 Info: (MMSDKTransportWebSocket) deactivateWithCloseCode(code = 1001, reason = Closing due to error code -1009)
2024-07-31 15:55:02.617476+0800 CCaaS-Demo[89456:28950252] 🟢 Info: (MMSDKTransportWebSocket) deactivate()
2024-07-31 15:55:02.617530+0800 CCaaS-Demo[89456:28950252] 🔴 Error: (MMSDKTransportWebSocket) onFailure(message: [-1009] The Internet connection appears to be offline.)
2024-07-31 15:55:02.619943+0800 CCaaS-Demo[89456:28950252] 🟢 Info: (MMSDKTransport State Machine) State changed from: Reconnecting, to: Error

Could you help check why the same Kotlin code works differently on iOS and Android, please?
If this issue should be fixed in TransportSDK, please share the release plan, thanks.

Hi Ficow,

Could you share the following details:

  • Are you using the 2.7.0 version?
  • Which Xcode version do you use?
  • On which Device model and OS version do you experience this?
  • Please, describe the Steps to reproduce the issue.
  • Is this only occuring on iOS?

Thanks,

Hi David, thanks for your quick support.

Below are my answers:

  • Are you using the 2.7.0 version?
    Yes

  • Which Xcode version do you use?
    Version 15.0 (15A240d)

  • On which Device model and OS version do you experience this?
    iPhone 12, iOS 15.4.1

  • Please, describe the Steps to reproduce the issue.
    1.Connect to a conversation to make TransportSDK be Configured state;
    2.Turn on Airplane mode on iPhone, and keep observing the console until the previously attached logs appear;

  • Is this only occuring on iOS?
    Yes, we did not find such issues on Android. SDK can reconnect up to 60 times on Android within 5 mins.

Thanks for the details! I will investigate.

In the process steps: Don't you turn off the Airplane mode after a while? Otherwise the Android won't reconnect either.

We tried on Android. It can retry 60 times until it fails.
Then SDK will turn to Error state. This is the behavior we expected.

Hi David,
Any updates, please?

Hi Ficow,

We've opened a ticket to investigate the issue. I can not provide timelines for now.
Once we have updates, I will share.

Hi David,
Thanks for the info. Could you provide the link to the ticket, please?

Hi Ficow,

It's an internal ticket for the engineering team. I can't provide assess to that.

Hi David,
Any updates for this ticket, please?

The team is still investigation the issue.
We will keep you posted.

1 Like

Hi David,
Could you share the latest progress, please?

Hi Ficow,

This is still in progress. Due to the summer season the review takes more time.
Thanks for your patience!

Hi David,
Could you share the latest progress, please?

Hi Ficow,

The team is now investigating the possibilities to refactor the socket handling.
In general, the iOS and Android platforms are handling the socket connections/disconnections differently.

1 Like

Hi David,
Thanks for the info.
Besides socket connections/disconnections, could you help confirm if any other TransportSDK features implemented differently on iOS and Android, please?

The Transport SDK developed in Koltin Multiplatform language.
The codebase of the SDKs is nearly identical.

Besides Network handling I'm not aware of any other differences.

Got it. Thanks for the info.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.