jorgefspereira / plaid_flutter

Plaid Link for Flutter. Integrates the native iOS, Android and Web SDKs.
https://pub.dev/packages/plaid_flutter
MIT License
67 stars 44 forks source link

Plaid not opening in an add-to-app hybrid model [iOS only] #103

Open prolificcoder opened 12 months ago

prolificcoder commented 12 months ago

Hello we are seeing a strange issue with our add-to-app huge flutter app. Plaid refuses to open, the only relevant error we see is this

2023-06-05 14:20:09.457076-0700  [Presentation] Attempt to present <LinkKit.PlaidLinkViewController: 0x7f94221f2d20> on <SoFi_Mobile.RootContainerViewController: 0x7f9462808f00> (from <SoFi_Mobile.RootContainerViewController: 0x7f9462808f00>) whose view is not in the window hierarchy.

Note that this issue doesn't happen for a pure flutter flow (with the same exact code) but only if there is a native screen during the route.

Also it doesn't happen on Android.

This could be very well be an issue on our side but we are suspecting it could be because this line assumes first class flutter app.

I am also trying create a pure reproduce but would appreciate any thoughts in the meantime.

jorgefspereira commented 12 months ago

Hi @prolificcoder. Your sample to reproduce this issue will be extremely useful. I'll take a look into that. Thanks

prolificcoder commented 12 months ago

@jorgefspereira thank you for prompt response. looks like https://github.com/jorgefspereira/plaid_flutter/issues/101 is getting the same stacktrace as me for the reproduce

[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: MissingPluginException(No implementation found for method open on channel plugins.flutter.io/plaid_flutter)
#0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:308:7)
<asynchronous suspension>
#1      PlaidMethodChannel.open (package:plaid_flutter/src/platform/plaid_method_channel.dart:37:5)
<asynchronous suspension>
#2      PlaidLink.open (package:plaid_flutter/src/core/plaid_link.dart:36:5)
<asynchronous suspension>

Though I am not quite sure if this is the same issue as what we are seeing because the error messages are different.

Point of note, our app navigates between flutter -> native and vice versa few times and this issue only reproduces if there is a native screen in the route eg:

Home (flutter) -> Screen 1 (flutter) -> Screen 2(flutter), click on PlaidLink.open -> Opens plaid sdk normally

but

Home (flutter) -> Screen 1 (native) -> Screen 2(flutter), click on PlaidLink.open -> Opens plaid doesn't open

Also we have videos and other diagnostic information if you would like, I can share them over DM.