-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Fix Deep Links not working on Android 12+ #10128
Fix Deep Links not working on Android 12+ #10128
Conversation
Correct all the links in the description. It is |
Oops. Just did it. |
Did you test it thoroughly? Video does not show click on expensify links. |
Yes. I tested it out using my own domain. The reason why I didn't show it using Expensify links is because they're not verified (therefore they won't work). We must host the I hosted that file using my domain and it worked. Moreover, I checked the links using |
Ok, Then please create the assetlinks.json file and put it in https://github.com/Expensify/App/tree/main/.well-known. Then add the necessary config to allow it to be deployed on a web server. I think you can follow Let us know what should be done internally. |
@@ -29,23 +29,24 @@ | |||
<activity | |||
android:name=".bootsplash.BootSplashActivity" | |||
android:theme="@style/BootTheme" | |||
android:launchMode="singleTask"> | |||
android:launchMode="singleTask" | |||
android:exported="true"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
android:exported="true"> | |
android:exported="false"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The value for android:exported
must be set to true
, otherwise the links won't open the app.
According to Android docs:
If the app component includes the LAUNCHER category, set android:exported to true. In most other cases, set android:exported to false.
Our app component includes the LAUNCHER category
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh! I see.
Just added the file and config for deployment. For QA: this can only be tested after deployment, since it requires the |
"target": { | ||
"namespace": "android_app", | ||
"package_name": "com.expensify.chat", | ||
"sha256_cert_fingerprints": ["2E:65:6F:1C:34:F5:7E:BF:FC:C0:2D:A3:14:0E:83:FE:61:51:F2:9B:5D:59:58:61:C4:4D:A9:99:0C:CA:F4:8E"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this correct? Or we have to change it. The gpg key in the codebase is encrypted if you used that to get the signature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I extracted it from the New Expensify's APK from the Play Store, so it should probably work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AndrewGable Could you please verify this? https://developer.android.com/training/app-links/verify-site-associations#web-assoc .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AndrewGable might be a bit slow to respond this week… He's getting married 😅 💍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, definitely he won't be able to respond. In that case, @deetergp Could you please check the signature? https://developer.android.com/training/app-links/verify-site-associations#web-assoc has details to get the signature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.. Please let's double check this..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @luacmartins
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add working app videos for each platform.
The Deep Link feature is only for the native mobile apps (Android & iOS). Nonetheless, I can add some videos just showing the app working for other platforms. |
@@ -960,7 +960,6 @@ | |||
LD_RUNPATH_SEARCH_PATHS = "/usr/lib/swift $(inherited)"; | |||
LIBRARY_SEARCH_PATHS = ( | |||
"\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", | |||
"\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because keeping that path after updating the npm package urbanairship-react-native
causes a compilation error for iOS. This was commented in this issue.
I think keeping only the line above should be enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I had updated to [email protected]
and not to the latest version to avoid incompatibilities. However, apparently we could (and should) update to a higher version — in this case [email protected]
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing to keep in mind is that we use the macOS-11
image to build the iOS app.
App/.github/workflows/platformDeploy.yml
Line 131 in 06b378d
runs-on: macos-11 |
IMO, macOS_11
does have Xcode 13 so it should be fine. But we should be careful.
"${PODS_ROOT}/Airship/Airship/AirshipMessageCenter/Resources/UAMessageCenterActions.plist", | ||
"${PODS_ROOT}/Airship/Airship/AirshipMessageCenter/Resources/UAMessageCenterListCell.xib", | ||
"${PODS_ROOT}/Airship/Airship/AirshipMessageCenter/Resources/UAMessageCenterPlaceholderIcon.png", | ||
"${PODS_ROOT}/Airship/Airship/AirshipMessageCenter/Resources/UAInbox.xcdatamodeld", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resource bundle changes.
Just added the working videos for each platform. |
I noticed that @janicduplessis is already doing some of the work for me in #9841. Specifically:
Therefore I should probably drop my some of my changes and only:
|
We can but relying on that PR is not a very safe choice. I would still prefer to upgrade separately. It's fine if that PR overwrites your changes. |
Got it. The PR we mentioned was already merged so, should we stick with my changes (which are using a RN version that is older than the current one in |
Please merge main into this and retest. |
This reverts commit 6a1741f.
Merged main and tested. Working as expected. |
android/build.gradle
Outdated
compileSdkVersion = 31 | ||
targetSdkVersion = 31 | ||
compileSdkVersion = 30 | ||
targetSdkVersion = 30 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought we need 31 for Android 12
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
targetSdkVersion = 31
is necessary and is already in main. It seems like here you're suggesting to change it to 30?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my bad this is an old commit. All good on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am 100% with the changes here so I am approving this. But I am not able to test these changes exactly.
I can build the app with local signature and test domain using a local server but not with the correct config which can only be tested if I password to that signing key.
cc: @deetergp
PR Reviewer Checklist
- I have verified the author checklist is complete (all boxes are checked off).
- I verified the correct issue is linked in the
### Fixed Issues
section above - I verified testing steps are clear and they cover the changes made in this PR
- I verified the steps for local testing are in the
Tests
section - I verified the steps for Staging and/or Production testing are in the
QA steps
section - I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
- I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
- I verified the steps for local testing are in the
- I checked that screenshots or videos are included for tests on all platforms
- I verified tests pass on all platforms & I tested again on:
- iOS / native
- Android / native
- iOS / Safari
- Android / Chrome
- MacOS / Chrome
- MacOS / Desktop
- I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
- I verified proper code patterns were followed (see Reviewing the code)
- I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e.
toggleReport
and notonIconClick
). - I verified that comments were added to code that is not self explanatory
- I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
- I verified any copy / text shown in the product was added in all
src/languages/*
files - I verified any copy / text that was added to the app is correct English and approved by marketing by tagging the marketing team on the original GH to get the correct copy.
- I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
- I verified the JSDocs style guidelines (in
STYLE.md
) were followed
- I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e.
- If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
- I verified that this PR follows the guidelines as stated in the Review Guidelines
- I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like
Avatar
, I verified the components usingAvatar
have been tested & I retested again) - I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
- I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
- If a new component is created I verified that:
- A similar component doesn't exist in the codebase
- All props are defined accurately and each prop has a
/** comment above it */
- Any functional components have the
displayName
property - The file is named correctly
- The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
- The only data being stored in the state is data necessary for rendering and nothing else
- For Class Components, any internal methods passed to components event handlers are bound to
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor) - Any internal methods bound to
this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
) - All JSX used for rendering exists in the render method
- The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
- If a new CSS style is added I verified that:
- A similar style doesn't already exist
- The style can't be created with an existing StyleUtils function (i.e.
StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)
- If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like
Avatar
is modified, I verified thatAvatar
is working as expected in all cases) - If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
- I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.
🎀 👀 🎀 C+ reviewed
@tomivs @parasharrajat @AndrewGable Can you please share couple links we should validate for sure as part of this PR. |
@mvtglobally this PR must be QA tested after deployment, because it requires a file to be uploaded to the server. Nonetheless, here are some links to test: You could also visit https://tomivs.com/linki/ and click the links directly from there. |
Details
Upgrading targetSdkVersion, a couple npm packages and AndroidManifest.xml in order to make Deep Links work on Android 12+.
Fixed Issues
$ #9628
Tests
NOTE: It's necessary to host the file "new.expensify.com/.well-known/assetlinks.json" for new.expensify... links to work (as well as staging).
PR Review Checklist
Contributor (PR Author) Checklist
### Fixed Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
filesSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
displayName
propertythis
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)PR Reviewer Checklist
The Contributor+ will copy/paste it into a new comment and complete it after the author checklist is completed
### Fixed Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
).src/languages/*
filesSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
have been tested & I retested again)/** comment above it */
displayName
propertythis
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)QA Steps
NOTE: It's necessary to host the file "new.expensify.com/.well-known/assetlinks.json" for new.expensify... links to work (as well as staging).
Screenshots
Web
WebDeepLinks_AirshipiOS_16_4.MOV
Mobile Web
MobileWebDeepLinks_AirshipiOS_16_4.MOV
Desktop
DesktopDeepLinks_AirshipiOS_16_4.MOV
iOS
iOSDeepLinks_AirshipiOS_16_4_0.mp4
Android
deep-links-android-12.mp4