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

[Change] After opening a notification with a URL deeplink, the back button will return to the previous Activity #1598

Merged
merged 1 commit into from
Jun 2, 2022

Conversation

jkasten2
Copy link
Member

@jkasten2 jkasten2 commented Jun 2, 2022

Description

One Line Summary

After opening a notification with a URL deeplink, the back button will return to the previous Activity. Also allow URLs that open the browser to keep task in the task list.

Details

Motivation

It is a better default user experience if the User taps on a notification that deeplinks into that app and it takes them back to the last screen they were on after pressing back. Also with the removal of the FLAG_ACTIVITY_NO_HISTORY the user can resume the app or site they if they background it.
https://app.asana.com/0/1202082526817210/1202301497858860/f

Scope

Only affects notification opens with URLs.

Testing

Unit testing

No existing Unit Test to update. Specific Intent flags are not fully implemented in Robolectric.

Manual testing

Tested on Android 12 and Android 6 emulators. Tested both a deep link URL and a URL that opens the browser. Tested wit the app backgrounded, swiped away, and kicked out of memory. Pressed the back button in each of these cases to ensure the behavior was correct.

Affected code checklist

  • Notifications
    • Display
    • Open
    • Push Processing
    • Confirm Deliveries
  • Outcomes
  • Sessions
  • In-App Messaging
  • REST API requests
  • Public API changes

Checklist

Overview

  • I have filled out all REQUIRED sections above
  • PR does one thing
  • Any Public API changes are explained in the PR details and conform to existing APIs

Testing

  • I have included test coverage for these changes, or explained why they are not needed
  • All automated tests pass, or I explained why that is not possible
  • I have personally tested this on my device, or explained why that is not possible

Final pass

  • Code is as readable as possible.
  • I have reviewed this PR myself, ensuring it meets each checklist item

This change is Reviewable

Removing FLAG_ACTIVITY_NO_HISTORY so the user can see the Activity to go
back to it if they background the app.

Also removed other flags so when the user press the back button on the
device they are taken to the last Activity in the app if the URL is a
deeplink. If the browser is open then it is it's own task and pressing
the back button will then take them to the home screen, however the
app's task will remind in the list so the user can always get back to
where they left off in the app.

There isn't any details into why these flags were added, they date back
to the 2.0.0 release of this SDK:
ce5ad7d#diff-2708f86f77e539cab647ecede9d5fcbead3bf0f954d7f9e536eafbc78ba760d6R792
However given that the user experience is much better in these cases
this is a better default. If the URL is a deeplink the app developer
could always add other Activity setting to their AndroidManifest.xml for
additional control.
@jkasten2 jkasten2 requested review from nan-li and emawby June 2, 2022 08:01
Copy link
Contributor

@nan-li nan-li left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense! LGTM

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.

2 participants