Gsk
Gsk

Reputation: 193

URL Scheme (imdb:///, linkedin://) not launching app in Android device

I have tested this scheme URL (imdb:///, linkedin://) app home page can't launching in Android device. but both home page/specified page app scheme URL works fine in iOS.

(imdb:///title/tt1931435/, linkedin://profile/{id}) this specified app page launch perfectly in Android device.

I can't understand why this different in scheme URL?

Appreciate your inputs on how to resolve this

Upvotes: 0

Views: 1829

Answers (1)

tasomaniac
tasomaniac

Reputation: 10342

In iOS you directly register your app to open for scheme's. When you do that, whatever you give after imdb://, the app opens. You can open it with either imdb:// or imdb://something

But in Android the behavior is different. You don't simply register for the scheme, you register for the complete path or path prefix or even use regex. When imdb:///title/tt1931435/ opens the IMDB app, simple imdb:// may not open the app directly.

The developers behind IMDB app probably wanted the app to be open only from the movie screens but not from the main screen.

Edit: After your comment I looked up AndroidManifest.xml files of both Facebook and IMDB and the result is the below

IntentFilter in IMDB application:

        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:scheme="imdb" android:host="" android:pathPattern="/title/tt.*" />
        </intent-filter>

IntentFilter in Facebook application:

        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:scheme="fb" />
        </intent-filter>

In Facebook, there is only "fb" and this means all the url's that starts with fb:// will open the app. But in IMDB, they provided android:pathPattern, which means only the URL's that fit that pattern will open the app.

Upvotes: 5

Related Questions