line / flutter_line_sdk

A Flutter plugin that lets developers access LINE's native SDKs in Flutter apps with Dart.
https://developers.line.biz/
Apache License 2.0
213 stars 43 forks source link

[Only iOS]PlatformException(3003, User cancelled or interrupted the login process., [:], null) #48

Closed crosser2020 closed 2 years ago

crosser2020 commented 3 years ago

Is it a security issue?

If you believe you have discovered a vulnerability or have an issue related to security, please DO NOT open a public issue. Instead, send us a mail to dl_oss_dev@linecorp.com.

What did you do?

Press the LINE Login button on iOS.(Android is ok)

What did you expect?

When I called the line login instance at flutter_line_sdk: ^1.3.0

What happened actually?

PlatformException(3003, User cancelled or interrupted the login process., [:], null)

Your environment?

iOS 14.7, iPhone 12 pro.

Sample project

https://apps.apple.com/us/app/crosser-make-global-friends/id1565490273

onevcat commented 3 years ago

It seems that LINE SDK for Flutter did not get a chance to handle the login result. By default, LINE SDK for Flutter would register itself as an application delegate. If everything goes fine, its application(_:open:options:) method will be called when navigated back to your app. It takes responsibility of receiving the auth code URL and continue the login. You can try to add a break-point there to see if it can be hit. (I guess it won't happen.)

The most possible reason, if you are not modifying the Flutter Runner project yourself, is one or more of other plugins also listen to this method, but returning a wrong value: once one of these "open url listeners" returns a true, the system would think it has found a handler for this URL and won't call other listeners anymore. So, you may need to check which of your other plugins is playing this bad-boy role and intercepts LINE's URL.

Tips:

If you are calling LineSDK.instance.setup("${your_channel_id}") after some other plugins' setup method, a quick way now is making LINE's setup happens at the first. But it won't really "fix" a potential issue in other plugins, you still need to try to find it later.

crosser2020 commented 3 years ago

Hi! Thanks for your reply.

This issue is only happened in iOS. Android is working perfectly. It's occurred when user has a LINE app in their iOS device in this flow. LINE app opened -> Accept Auth -> Open the app(open our app - CROSSER) -> PlatformException(3003, User cancelled or interrupted the login process., [:], null).

I have changed the LineSDK.instance.setup("${your_channel_id}") calling location before calling other plugin's setup method but it's still not working in iOS.

It would works when user has no LINE app in their device.

onevcat commented 2 years ago

It is not reproducing at all, so I am guessing it is a very rare case or environment related. Until we can get more information on this, I am closing it since there is no more we can help.

Before that, I would suggest set onlyWebLogin (https://pub.dev/documentation/flutter_line_sdk/latest/flutter_line_sdk/LoginOption/onlyWebLogin.html) to prevent using LINE and only open a web view to perform the login.