line / line/line-sdk-android

Use ActivityResultContracts as onActivityResult is deprecated

Open
#150 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
149
Forks
54
PR merge metrics
No merged PRs in 30d

Description

## 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?

* Line Android SDK needs to override 'onActivityResult'.
* https://developers.line.biz/en/docs/line-login-sdks/android-sdk/integrate-line-login/#handling-login-result
* But 'onActivityResult' is deprecated API.
* The android development environment no longer recommends that developers call the onActivityResult API.

## 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](https://github.com/line/line-sdk-android/assets/17632448/e84a2d12-d9e2-45d4-ab02-bbb71a409e72)

## How to fix

* The Facebook Android SDK is a good example.
* They had a same issue and they fixed it.
* https://github.com/facebook/facebook-android-sdk/issues/875
* https://github.com/facebook/facebook-android-sdk/commit/b48ac0d1339e198cc9d8f5e8b815da4363c6f7b0
* Now they guide the user to:
> If you are using AndroidX activities or fragments, you don't have to override onActivityResult.
* https://developers.facebook.com/docs/facebook-login/android?locale=en_US#9--register-a-callback

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the onActivityResult override required by the LINE Login Android integration, then compare the linked Facebook Android SDK migration and callback guidance. Determine how login results are currently delivered and update the integration path so Android developers no longer need the deprecated API; done means the documented flow avoids the warning while handling login results.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
authentication, mobile
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.