Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ActivityResultContracts as onActivityResult is deprecated #150

Open
bhbac-nhnent opened this issue Aug 7, 2023 · 1 comment · May be fixed by #162
Open

Use ActivityResultContracts as onActivityResult is deprecated #150

bhbac-nhnent opened this issue Aug 7, 2023 · 1 comment · May be fixed by #162

Comments

@bhbac-nhnent
Copy link

Is it a security issue?

  • No

What did you do?

  • Integrating LINE Login.

What did you expect?

  • Do not appear 'deprecated' warning

What happened actually?

Your environment?

  • Normal Android development environment.

Sample project

  • Just create new Android project from Android Studio and write 'onActivityResult' override function in Activity class.
    • image

How to fix

@vincent-paing
Copy link

vincent-paing commented Jan 31, 2024

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

vincent-paing added a commit to vincent-paing/line-sdk-android that referenced this issue Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants