Georg Jähnig
Georg Jähnig

Reputation: 799

React Native: Not receiving intent from other Android app

I want my React Native app to be able to receive URL intents from another apps. So for instance, when I scan a URL with a QR code scanner and want to open it, among my installed browsers will also appear my React Native app.

I followed the instructions of Linking:

Having done this, I expected that after scanning a http://www.example.com/gizmos with my QR scanner and trying to open it, the scanner would offer me also my React Native app. However, it does only show my previously installed browsers.

Is my expectation wrong? Or can do something to make this happen?

Upvotes: 1

Views: 1430

Answers (1)

Christian
Christian

Reputation: 26387

It's not enough to catch the action android:name="android.intent.action.MAIN" but you need to catch android:name="android.intent.action.VIEW"

<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:host="www.example.com" android:scheme="http" />
</intent-filter>

Upvotes: 1

Related Questions