I have the following in my AndroidManifest.xml file for my app on Google Play:
<activity
android:name="com.enigmadream.picturecode.Viewer"
android:exported="true"
android:label="@string/title_activity_viewer"
android:parentActivityName="com.enigmadream.picturecode.Editor" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.enigmadream.picturecode.Editor" />
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data
android:host="picturecode.enigmadream.com"
android:scheme="http" />
</intent-filter>
</activity>
And I thought it was working just fine. It still seems to work just fine if you click on a link from Google+ - it offers the option to launch my app instead of the browser when you click on a link that uses the server name picturecode.enigmadream.com
. But when I click on a link to picturecode.enigmadream.com from within Facebook or Chrome, it doesn't offer the option, and instead just navigates to the page in Chrome. What am I missing?
You need to use your own scheme (eg. picturecode://). Facebook and Chrome can both probably deal with the http scheme on their own and so don't check to see if any other activities can handle it. The upshot of this is that you may not need to have the host in place either, for a shorter URI. Just
picturecode://01sv...
. You can of course also keep this filter in place as well. If a browser gets to the page, just have a link that goes to the correct URI, or even just automatically redirect if possible.For reference, you can see Google Play work this way using the market:// scheme.