I have created a deep link with auto verify using this as instructed, the
android:exported
tag needs to be set to true for the activity to be launched by the OS. I wanted to know, If I can add a custom/created permission
<permission android:name="com.sample.app.DEEP_LINK_PERMISSION"/>
Add this custom/created permission to the activity tag and still make the deep link work?
<activity
android:name=".sample.ui.CustomActivity"
android:exported="true"
android:permission="com.sample.app.DEEP_LINK_PERMISSION">
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
<data android:host="someValue" />
<data android:path="someValue" />
</intent-filter>
</activity>
After adding the custom/created permission, the deep parse link has stopped working. Is there a way to keep the custom/created permission and make the deep link work?
Adding
android:permission="com.sample.app.DEEP_LINK_PERMISSION"
says "only apps that holdcom.sample.app.DEEP_LINK_PERMISSION
can start this activity". No existing Web browsers are likely to hold that permission. As a result, they cannot start your activity.You have three main options:
More generally, you should step back and consider what your objectives are with this custom permission.