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

Use ActivityResultContracts as onActivityResult is deprecated #150

Open bhbac-nhnent opened 11 months ago

bhbac-nhnent commented 11 months ago

Is it a security issue?

What did you do?

What did you expect?

What happened actually?

Your environment?

Sample project

How to fix

vincent-paing commented 5 months ago

I read the docs and seems like you don't need to override onActivityResult if you use the login button they provide out of the box. But for customized solution, you would need to. My 2 cent is this should be part of the code sdk since the API is already extensible but changing to contract would limit the extensibility.

Implementing this in ActivityResultContract seems fairly simple. Here's the code that I wrote if you want to use in your app. I also submitted a PR just in case maintainers want to make this part of core sdk