Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[flutter_appauth] Feature: Android pendingOperation callback #496

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

mdikcinar
Copy link

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());
        }
      }
    });
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants