flutter_appauth icon indicating copy to clipboard operation
flutter_appauth copied to clipboard

[flutter_appauth] Feature: Android pendingOperation callback

Open mdikcinar opened this issue 3 months ago • 0 comments

As i mentioned here android has a lifecycle issue. In this pr i tried to solved it simply by adding HAS_PENDING_OPERATION invoke method for this situation.

I think it can be solved clearly with adding a callback method maybe but i didn't want to touch the code base too much and just focused to solve it simply.

In the app side i just did this quickly and solve the problem

 final MethodChannel methodChannel = const MethodChannel('crossingthestreams.io/flutter_appauth');

  @override
  void initState() {
    super.initState();
    methodChannel.setMethodCallHandler((methodCall) async {
      if (methodCall.method == 'hasPendingOperation') {
        final arguments = methodCall.arguments;
        if (arguments case {'accessToken': String _}) {
          unawaited(context.read<AuthenticationCubit>().login());
        }
      }
    });
  }

mdikcinar avatar May 17 '24 23:05 mdikcinar