line / line-sdk-android

LINE SDK for Android lets you integrate LINE into your Android app to create a more engaging experience for your users.
https://developers.line.biz/en/docs/android-sdk/
Apache License 2.0
133 stars 45 forks source link

Fix: sample app line login btn listener not called #135

Closed Xanonymous-GitHub closed 1 year ago

Xanonymous-GitHub commented 1 year ago

Description

We have found that the LINE login button (LineLoginButton) used in the sample app did not successfully register a login result callback listener. Therefore, this PR fixed this issue and also made some minor adjustments to other content.

To solve the issue of loginListener's onLoginSuccess and onLoginFailure not being called after login, we used the LoginDelegate provided by the SDK itself. Specifically, we passed the login activity's Intent and its relative params to LineLoginButton by calling loginDelegate.onActivityResult(...), allowing it to internally call the registered loginListener. For more information about LoginDelegate, please go to here.

In addition to this change, we also adjusted some of the other code in the sample app, such as the view model, to reflect these changes.

The minimum kotlin version of SDK has been upgraded to 1.7.20, and the gradle has been upgraded to 7.6.