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

Add deep linking support #1805

Merged
merged 2 commits into from
Jul 31, 2018
Merged

Conversation

csduarte
Copy link

@csduarte csduarte commented Jun 22, 2018

Summary

Allow permalinks to open the mobile app.

The app checks for platform specific configuration on app install. If no configuration is found then the deep linking code sits silently and permalinks act as just regular links.

Setup for iOS
  • Create an apple-app-site-association file in the .well-known directory at the root of your server. It should be accessible by navigating to https://<your-site-name>/.well-known/apple-app-site-association. *** There should NOT be a file extension ***
  • In order to handle permalink deep links paste the following JSON into the apple-app-site-association file. Make sure to place your app ID in the appID property:
{
    "applinks": {
        "apps": [],
        "details": [
            {
                "appID": "<your-app-id-here>",
                "paths": ["**/pl/*"]
            }
        ]
    }
}
  • Make sure to add the associated domains entitlement to your app via the Apple developer portal
  • Add an entitlement that specifies the domains your app supports via the Xcode entitlements manager.

Before installing the app with the new entitlement make sure that you can view the contents of the apple-app-site-association file via a browser by navigating to https://<your-site-name>/.well-known/apple-app-site-association. The app will check for this file on install and if found will allow outside permalinks to open the app.

Official documentation can be found using the following link:

Setup for Android

Configuring deep links for Android is done much easier when using the App Links Assistant in Android Studio. Please refer to the following link for adding deep links via the App Links Assistant:

Screenshots

kapture 2018-06-22 at 14 41 11

@enahum enahum added the 2: Dev Review Requires review by a core commiter label Jun 22, 2018
@enahum enahum added this to the 1.10 milestone Jun 22, 2018
@enahum
Copy link
Contributor

enahum commented Jun 22, 2018

@jarredwitt is there documentation needed for this?

@jarredwitt
Copy link

@enahum updated the PR description to include some instructions for setup. The setup is pretty specific for each platform since it deals with the app ID's as well as some required file uploads to the server. The good thing about the setup is that it sits silently in the background if a configuration is not found. Let me know if you need help/have issues testing.

@enahum
Copy link
Contributor

enahum commented Jun 24, 2018

It would be great to submit the PR to the docs and the developer docs ;)

@enahum
Copy link
Contributor

enahum commented Jun 24, 2018

Will this work with multiple servers if the app id is the one we provide or people wanting to use this will need to build their own apps?

@jarredwitt
Copy link

jarredwitt commented Jun 27, 2018

@enahum sorry for the late response, not sure on the multiple servers front. My guess is maybe? For iOS the apple-app-site-association file it only requires that the appID be present so I think if users are using the build from the app store then they would only need to upload the apple-app-site-association file to their server with the MM appID set and I think it'll work. Not sure on Android, but I think if the file is signed using the MM keystore then it should work the same way as long as that file is also uploaded to the server.

@jarredwitt
Copy link

@enahum actually forgot that comment. It'll require users to build their own app if they want to support other servers since you have to specify the site url in the entitlements file at build time for iOS and Android.

@enahum enahum added this to the 1.11 milestone Jun 29, 2018
Copy link
Contributor

@enahum enahum left a comment

Choose a reason for hiding this comment

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

just one minor comment, also can you please submit a PR to the https://github.com/mattermost/mattermost-developer-documentation repo on how to set up universal links when building from source?

@@ -58,6 +58,15 @@ export default class ChannelPostList extends PureComponent {
this.contentHeight = 0;
}

componentDidMount() {
this.mounted = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

is there a reason for this?

Copy link

@jarredwitt jarredwitt Jul 18, 2018

Choose a reason for hiding this comment

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

Copy link
Contributor

@enahum enahum left a comment

Choose a reason for hiding this comment

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

Plz don’t forget about the docs for this feature

@enahum enahum added 4: Reviews Complete All reviewers have approved the pull request Docs/Needed Requires documentation and removed 2: Dev Review Requires review by a core commiter labels Jul 20, 2018
@enahum enahum merged commit 26950ab into mattermost:master Jul 31, 2018
@dseawel dseawel deleted the universal-links branch December 7, 2018 18:28
@lindy65 lindy65 added the Tests/Not Needed Does not require tests label Apr 14, 2019
chuttam added a commit that referenced this pull request Jan 1, 2020
#1805 enabled support for deep links for iOS. The link parsing mechanism remains the same for both platforms, but this commit enables registration of the URL scheme to the Android OS so that deep links can be accessed.
migbot pushed a commit that referenced this pull request Jan 6, 2020
#1805 enabled support for deep links for iOS. The link parsing mechanism remains the same for both platforms, but this commit enables registration of the URL scheme to the Android OS so that deep links can be accessed.
@amyblais amyblais added Docs/Done Required documentation has been written and removed Docs/Needed Requires documentation labels Jun 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4: Reviews Complete All reviewers have approved the pull request Docs/Done Required documentation has been written Tests/Not Needed Does not require tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants