wallet-mobile-sdk icon indicating copy to clipboard operation
wallet-mobile-sdk copied to clipboard

Flutter bug fixes and enhancements

Open quetool opened this issue 1 year ago • 0 comments

Summary

Why am I opening this PR? I have found an issue on your felix/isConnected-flutter branch (which I assume is the one you used to publish the latest Flutter SDK) where you are using the compilation directive #if DEBUG on your Swift's side plugin and this is breaking the app on Profile/Release mode.

The affected line is this one => https://github.com/MobileWalletProtocol/wallet-mobile-sdk/blob/71e5e38f46b35efe62485fc4a39bdfb7a0e92900/flutter/ios/Classes/SwiftCoinbaseWalletSdkFlutterPlugin.swift#L70

You have this directive also on branch 2.0 but you don't have in on main branch (the whole guard statement is missing on main branch).

The thing is that by not returning a result() to flutter (because of the compilation directive) on Profile/Release mode the App stucks on await CoinbaseWalletSDK.shared.configure call. This is causing a lot of troubles for users.

So, this PR basically merges the changes from felix/isConnected-flutter to main (without the compilation directive) and adds a few more valuable things.

Such as:

  • Updated dependencies
  • Added ownPublicKey and peerPublicKey methods (Android side should be checked properly)
  • Added WatchAsset() object for rpc request
  • Updated example files accordingly

Furthermore, it raise a concern in regards of the whole CoinbaseWalletSDK.shared.configure method, which is: Do we really needed? My conclusion is no. configure method shouldn't be called from Flutter side since the calling could happen too late raising an error when opening the app from terminated state.

So, since Flutter requires anyway iOS platform specific code https://github.com/MobileWalletProtocol/wallet-mobile-sdk/tree/main/flutter#ios-only it makes sense to call configure on native side as well as it is currently done for iOS native SDK https://github.com/MobileWalletProtocol/wallet-mobile-sdk/tree/main/ios#setup Same situation for Android https://github.com/MobileWalletProtocol/wallet-mobile-sdk/tree/main/android#setup

How did you test your changes?

  • Smoke tests and manual tests

quetool avatar Mar 22 '24 09:03 quetool