简体   繁体   中英

Should I use intents or App Links to connect two native apps in Android?

I have a simple requirement. Native app A needs to start an Activity in native app B. Per Google Dev docs there are two ways to do it: 1. Use Implicit Intents 2. Use App Links

Which is a better approach from security standpoint?

From a security standpoint App Links would be the better approach. With app links you setup a url that links to a domain you own. That url is configured in both your client app and on the server that hosts the domain. If the user doesn't have the app installed, that supports the app link, then you are directed to the website instead of the app.

With Implicit Intents , any app can register that intent. If more than one app has that intent registered, then an app chooser is displayed, for the user to decide which app should open that intent. Also, if no app is installed that is registered for that intent, then you need to check for that otherwise an exception will be thrown indicating that there is no app to handle your intent execution.

The downside to App Link is that it's only supported on Android 6.0 (API level 23) and higher and it requires an extra configuration on the website domain.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM