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

Open redirect activity with singleTask launchMode #7153

Merged
merged 1 commit into from
Aug 16, 2023

Conversation

carlosmuvi-stripe
Copy link
Collaborator

@carlosmuvi-stripe carlosmuvi-stripe commented Aug 14, 2023

Summary

We started observing deep links not working on DuckDuckGo on Financial Connections:

  • On the SDK, our main activity (FinancialConnectionsNativeActivity) opens a browser to handle bank logins.
  • DuckDuckGo is launched as new task (task == independent set of activities).
  • When a deep link triggers to open back the SDK (RedirectActivity) it opens it on that new task.
  • RedirectActivity relies on singleTop to restore the existing FinancialConnectionsNativeActivity and continue the flow. However, since the activity is in a new task, we're not able to reopen it, so it creates a new instance of it (instead of bringing the existing one to front and calling onNewIntent)

Result -> the user stays in DuckDuckGo. (looks like deeplink didn't' trigger)

image

Solution

Solution: Open the activity observing deep links (RedirectActivity) with singleTask launch mode.

This should ensure that the activity opens in an existing task with the same affinity (same app by default)

image

Testing

Tested this printing the TaskId of FinancialConnectionsNativeActivity and RedirectActivity. They have different ids before singleTask, but they share the same id now. onNewIntent gets triggered as expected, instead of a new onCreate from a new activity instance.

@carlosmuvi-stripe carlosmuvi-stripe merged commit bdd36dc into master Aug 16, 2023
7 checks passed
@carlosmuvi-stripe carlosmuvi-stripe deleted the carlosmuvi/use-existing-task-redirect branch August 16, 2023 16:23
fionnbarrett-stripe pushed a commit that referenced this pull request Aug 17, 2023
carlosmuvi-stripe added a commit that referenced this pull request Aug 30, 2023
(cherry picked from commit bdd36dc)
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 this pull request may close these issues.

None yet

2 participants