Skip to content

Jetpack Focus: Open web links with Jetpack - Add custom scheme deep link receiver#17495

Merged
develric merged 5 commits intotrunkfrom
issue/17494-custom-scheme-deep-link-receiver
Nov 21, 2022
Merged

Jetpack Focus: Open web links with Jetpack - Add custom scheme deep link receiver#17495
develric merged 5 commits intotrunkfrom
issue/17494-custom-scheme-deep-link-receiver

Conversation

@zwarm
Copy link
Copy Markdown
Contributor

@zwarm zwarm commented Nov 19, 2022

Parent #17494

The purpose of this PR is split the deep link receiver intent into two handlers; one for the custom wordpress:// scheme and the other for web/app links.

Modifications Include

  • DeepLinkingCustomIntentReceiverActivity was introduced as the handler for the wordpress:\\ scheme deep links. Its sole purpose is to track and then forward the request toDeepLinkingIntentReceiverActivity for handling as normal.
  • Event DEEPLINK_CUSTOM_INTENT_RECEIVED was added to track the activity
  • AndroidManifest,xml was updated to separate the intent filters.
  • There were no changes made to DeepLinkingIntentReceiverActivity.

To test:
Prepare device

  • Uninstall any versions of JP/WP on your device
  • Install both JP and WP prealpha versions from this PR
  • Login to both apps
  • Navigate to Me > App Settings > Privacy Setting > and enable Collect Information
  • Decompress and download the attached links_helper.html file to your device (github doesn't support html file attachments)

links_helper.html.zip

WordPress scheme test

  • Open the links_helper.html in a browser
  • Tap on the “WordPress Stats” Link
  • ✅ Verify that the WordPress app was launched
  • ✅ Verify that the log contains: 🔵 Tracked: deeplink_custom_intent_received

Jetpack scheme test

  • Open the links_helper.html in a browser
  • Tap on the “Jetpack Stats” Link
  • ✅ Verify that the Jetpack app was launched
  • ✅ Verify that the log does not contain: 🔵 Tracked: deeplink_custom_intent_received

Test that Web links are still functioning

  • Navigate to the app settings for WordPress on the device
  • Enable the pre-alpha app to handle verified web links links. On a pixel device you will find this under Open By Default > Tap + Add Link > Check all three checkboxes and then click Add
  • Open the links_helper.html in a browser
  • Tap on the “WordPress.com Stats 1234” Link
  • ✅ Verify that the WordPress app was launched
  • ✅ Verify that the log does not contain: 🔵 Tracked: deeplink_custom_intent_received

Regression Notes

  1. Potential unintended areas of impact
    wordpress:// deep links are not handled correctly

  2. What I did to test those areas of impact (or what existing automated tests I relied on)
    Manual testing

  3. What automated tests I added (or what prevented me from doing so)
    Added DeepLinkingCustomIntentReceiverViewModelTest

PR submission checklist:

  • I have completed the Regression Notes.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@wpmobilebot
Copy link
Copy Markdown
Contributor

WordPress📲 You can test these changes on WordPress by downloading wordpress-installable-build-pr17495-c30d29d.apk
💡 Scan this QR code with your Android phone to download and install the APK directly on it.
AppWordPress
Build FlavorJalapeno
Build TypeDebug
Commitc30d29d
Note: This installable build uses the JalapenoDebug build flavor, and does not support Google Login.

@wpmobilebot
Copy link
Copy Markdown
Contributor

Jetpack📲 You can test these changes on Jetpack by downloading jetpack-installable-build-pr17495-c30d29d.apk
💡 Scan this QR code with your Android phone to download and install the APK directly on it.
AppJetpack
Build FlavorJalapeno
Build TypeDebug
Commitc30d29d
Note: This installable build uses the JalapenoDebug build flavor, and does not support Google Login.

Copy link
Copy Markdown
Contributor

@AjeshRPai AjeshRPai left a comment

Choose a reason for hiding this comment

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

@zwarm

I have gone through the code changes and have tested the changes by following the test instructions. Everything looks good to me 👍🏼 .

One log message I noticed while testing the changes

  • Open the links_helper.html in a browser
  • Tap on the “Jetpack Stats” Link
  • Verify that the Jetpack app was launched
  • Notice the following log message
    Tracked: deep_link_not_default_handler, Properties: {"interceptor_classname":"com.google.android.apps.chrome.IntentDispatcher"}

Is that something expected?.

I am approving but not merging the PR so that @develric can have a look. Please merge when convenient.

@zwarm
Copy link
Copy Markdown
Contributor Author

zwarm commented Nov 21, 2022

Notice the following log message
Tracked: deep_link_not_default_handler, Properties: {"interceptor_classname":"com.google.android.apps.chrome.IntentDispatcher"}
Is that something expected?.

Yes, that's a pre-existing capture from WPMainActivity

Thanks for the review. :)

Copy link
Copy Markdown
Contributor

@develric develric left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @zwarm! LGTM as well and the behaviour is as described 👍 ! :shipit:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants