Question: For native app login, how to properly setup the redirection to my app
I have a Flutter native app, when running on emulators, they were fine as they used internal browser to login.
But when I test my app on my own Android phone, which has native LINE, to login, it logged in seccessfully and did not pop to my app, it just stay in LINE native app.
Is there any guide or instructions specifying on deeplinking or callback or something on solving this?
same question
Hi @GinoLin980 , Thanks for your report. As I couldn't reproduce this issue on my device (Galaxy Fold4, Android 14). I have a few questions regarding to it.
- Did this occur with the Flutter sample app located in this repository?
- Could you provide the following information: Android device, Android version, LINE App version (and try to upgrade to latest), Flutter LINE SDK version, and the
targetSdkVersionof your app ? - Did this occur in other Android devices or emulators? If so, please share the device/emulator's info.
- Could you download this app and test it to see if there are any login issues on it (using the same device as mentioned in this issue)? https://play.google.com/store/apps/details?id=com.linecorp.twshopping
I have a Flutter native app
Is it a public access app that I can download?
Thanks.
Wow, it's late night for us to have discussion here.
- No, in the example app, it pops to the example app flawlessly on my actual device.
Android device: Galaxy S23+
Android version: Android 14, OneUI 6.1
LINE app version: 15.1.4 (latest)
Flutter LINE SDK version: 2.3.8
targetSdkVersion: minSdk = 24
targetSdk = flutter.targetSdkVersion
- In short, IDK. I don't have any extra actual devices around me, and I didn't try to login in native LINE on emulator since it might broke my chat history on my actual device if I'm not wrong.
- No issues.
- Still in development :(
Example code in my app
Edit: in my app, lineSignIn is called after several Navigator.push() (something like HomePage -> ProfilePage -> LoginPage, then a ElevatedButton calls lineSignIn) I don't know if this matters.
Future<dynamic> lineSignIn(context) async {
Map<String, dynamic> data = {};
try {
final loginOption = LoginOption(false, 'normal'); // 設定登入選項
final result = await LineSDK.instance.login(scopes: ['profile', 'openid', 'email'], option: loginOption); // 執行登入
...
}
Considered myself as a beginner on this SDK and Flutter ecosystem, I might have some improper setup. Feel free to request more info.
As this is not a urgent case, just take it slow and have a great night.
Im facing same issue, with android emulator --> Pixel_6a_API_34, it just created 2 times of access.line.me either i tapped "Allow" or "Cancel" , It just happened in Android and its working fine in IOS
@YkSix I have this issue to case scenario for reproduce
- Open App
- Open LINE App
- Login with LINE from App
- Click allow then LINE toast message login successful
- Issue it still on LINE App not redirect to App
but it work fine if we not do step 2. (that mean kill LINE App first) it not happen issue in step 5.
@YkSix I have this issue to case scenario for reproduce
- Open App
- Open LINE App
- Login with LINE from App
- Click allow then LINE toast message login successful
- Issue it still on LINE App not redirect to App
but it work fine if we not do step 2. (that mean kill LINE App first) it not happen issue in step 5.
For my case solved Root cause is my App disabled deeplink and use app_links Follow document app_links intent-filter look like
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" android:host="www.example.com" android:pathPrefix="/foo" />
</intent-filter>
My update
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="MY_SCHEME" />
<data android:path="MY_PATH" />
</intent-filter>
My Android URL scheme
intent://MY_PATH#Intent;scheme=MY_SCHEME;package=MY_PACKAGE_NAME;
@thanakorn-bird-abbon
Ah, that makes sense! Thank you for the information.
When writing the documentation or designing the workflow and APIs, we must follow and refer only to the official solutions, such as Deep Links. If another solution is used in the app, you'll need to make some adaptations to make it work!
I faced the same problem.
@YkSix I have this issue to case scenario for reproduce
- Open App
- Open LINE App
- Login with LINE from App
- Click allow then LINE toast message login successful
- Issue it still on LINE App not redirect to App
but it work fine if we not do step 2. (that mean kill LINE App first) it not happen issue in step 5.
and try to solved with this solution but it don't work.
@YkSix I have this issue to case scenario for reproduce
- Open App
- Open LINE App
- Login with LINE from App
- Click allow then LINE toast message login successful
- Issue it still on LINE App not redirect to App
but it work fine if we not do step 2. (that mean kill LINE App first) it not happen issue in step 5.
For my case solved Root cause is my App disabled deeplink and use app_links Follow document app_links intent-filter look like
<intent-filter android:autoVerify="true"> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="https" android:host="www.example.com" android:pathPrefix="/foo" /> </intent-filter>My update
<intent-filter android:autoVerify="true"> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="MY_SCHEME" /> <data android:path="MY_PATH" /> </intent-filter>My Android URL scheme
intent://MY_PATH#Intent;scheme=MY_SCHEME;package=MY_PACKAGE_NAME;
The same issue occurs if you open the Line app first, then return to your own app to initiate Line login. After successful authorization, it cannot automatically redirect from Line back to your own app.
I still have
@YkSix I have this issue to case scenario for reproduce
- Open App
- Open LINE App
- Login with LINE from App
- Click allow then LINE toast message login successful
- Issue it still on LINE App not redirect to App
but it work fine if we not do step 2. (that mean kill LINE App first) it not happen issue in step 5.
For my case solved Root cause is my App disabled deeplink and use app_links Follow document app_links intent-filter look like
<intent-filter android:autoVerify="true"> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="https" android:host="www.example.com" android:pathPrefix="/foo" /> </intent-filter>My update
<intent-filter android:autoVerify="true"> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="MY_SCHEME" /> <data android:path="MY_PATH" /> </intent-filter>My Android URL scheme
intent://MY_PATH#Intent;scheme=MY_SCHEME;package=MY_PACKAGE_NAME;
Sorry everyone I still have issue too I think in that day it work because I use back button in Android (equal close app LINE before login from my App)
It make LINE app close.
I have also encountered the same problem. Do you have a solution?
I have also encountered the same problem. Do you have a solution?
I have also encountered the same problem. Do you have a solution?