RodrigoSMarques / flutter_branch_sdk

Flutter Plugin for create deep link using Branch Metrics SDK. This plugin provides a cross-platform (iOS, Android, Web).
https://branch.io
MIT License
100 stars 90 forks source link

PlatformException 1003 - network error on startListening() #294

Closed dgilperez closed 6 months ago

dgilperez commented 9 months ago

I am seeing some instances of that error in production using 7.02, which are probably perfectly normal. On other SDKs, I use to retry those network errors are they are most likely transient.

In order to do that, the startListening method could better return a future, so we can wait for that result to process correctly, or catch that particular PlatformError and then retry it with some backoff strategy.

Is that even possible here? Would you consider doing that? Any alternative?

Thanks :)

RodrigoSMarques commented 9 months ago

@dgilperez

This error is returned by the native SDK.

In flutter I'm just throwing the exception to the application.

I have to evaluate what Branch suggestion is to deal with these cases.

RodrigoSMarques commented 6 months ago

The native SDK is launched before the Dart/Flutter code runs.

If the SDK encountered a network problem at startup, the only way to restart communication is to restart the application or put it in the background and return again.

The native SDK does not provide a method for this.