line-sdk-ios-swift icon indicating copy to clipboard operation
line-sdk-ios-swift copied to clipboard

After a successful login, the Line app does not redirect to my iOS app directly; instead, it goes to the WebView first

Open kanzt opened this issue 2 years ago • 5 comments

What did you do?

I have created a iOS project and followed the link https://developers.line.biz/en/docs/line-login-sdks/ios-sdk/swift/integrate-line-login/.

What did you expect?

Redirect the user to my iOS app without using a WebView.

What happened actually?

After the user successfully logs in, the Line app redirects the user to a web view before navigating to my iOS app. preview

Sample project

I used the sample project from this repository and only changed the channelID

kanzt avatar Mar 07 '24 08:03 kanzt

Hi,

This is the default and expected behavior when the URL scheme is used, to improve the security of navigating. To bypass this confirm screen, you can try to setup and implement the Universal Link.

https://developers.line.biz/en/docs/line-login-sdks/ios-sdk/swift/universal-links-support/

If you set up a universal link, LINE tries to open your app with the universal link first. If the universal link is invalid, LINE falls back to a URL based on your iOS bundle ID.

onevcat avatar Mar 11 '24 02:03 onevcat

Hi,

This is the default and expected behavior when the URL scheme is used, to improve the security of navigating. To bypass this confirm screen, you can try to setup and implement the Universal Link.

https://developers.line.biz/en/docs/line-login-sdks/ios-sdk/swift/universal-links-support/

If you set up a universal link, LINE tries to open your app with the universal link first. If the universal link is invalid, LINE falls back to a URL based on your iOS bundle ID.

I have followed the link that you provided; it works fine for navigating users to my iOS app. However, the Line SDK gives me an error: 'authorizeFailed(reason: LineSDK.LineSDKError.AuthorizeErrorReason.userCancelled).

kanzt avatar Mar 11 '24 07:03 kanzt

Please make sure you implement the "user activity" related delegate methods in either app delegate or the scene delegate:

https://developers.line.biz/en/docs/line-login-sdks/ios-sdk/swift/universal-links-support/#modify-app-delegate

onevcat avatar Mar 11 '24 08:03 onevcat

https://developers.line.biz/en/docs/line-login-sdks/ios-sdk/swift/universal-links-support/#modify-app-delegate

I already added it, but it still is not working. I got the same error 'authorizeFailed(reason: LineSDK.LineSDKError.AuthorizeErrorReason.userCancelled).'

kanzt avatar Mar 11 '24 08:03 kanzt

@kanzt Sorry for the late reply.

Could you please provide a code snippet that demonstrates how you are configuring the LoginManager and the user activity (which is what the universal link triggers) delegate? Additionally, could you set a breakpoint on the userActivity-related delegate methods to verify if they are being invoked with the appropriate URL, which is then passed to the LoginManager.application(_:open:) method?

Your assistance with this additional information would be greatly appreciated. Thank you.

onevcat avatar Mar 13 '24 01:03 onevcat