Skip to content

Commit d2e594e

Browse files
committed
Integrate Latest @ 170282474
Changes to messaging/testapp ... - Updated testapp to display deep link if one was provided. CL: 170282474
1 parent c5d6c72 commit d2e594e

3 files changed

Lines changed: 30 additions & 0 deletions

File tree

messaging/testapp/AndroidManifest.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,17 @@
2828
<action android:name="android.intent.action.MAIN" />
2929
<category android:name="android.intent.category.LAUNCHER" />
3030
</intent-filter>
31+
32+
<!-- To take advantage of deep links in Firebase Messages on Android, your
33+
app must be configured to listen for links to your domain. Update the
34+
URLs in the following intent-filter to enable links for your app. -->
35+
<intent-filter>
36+
<action android:name="android.intent.action.VIEW"/>
37+
<category android:name="android.intent.category.DEFAULT"/>
38+
<category android:name="android.intent.category.BROWSABLE"/>
39+
<data android:host="CHANGE_THIS_DOMAIN.example.com" android:scheme="http"/>
40+
<data android:host="CHANGE_THIS_DOMAIN.example.com" android:scheme="https"/>
41+
</intent-filter>
3142
</activity>
3243

3344
<service android:name="com.google.firebase.messaging.cpp.ListenerService"

messaging/testapp/readme.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,22 @@ with:
125125
and download the SDK and NDK if the locations are not yet set.
126126
* Android Studio will write these paths to `local.properties`.
127127
128+
**Optional: Configure your deep link URL**
129+
130+
- To enable your app to receive deep links via FCM, you will need to add an
131+
intent filter to your AndroidManifest.xml in the native activity that
132+
associates your domain with your app.
133+
134+
```
135+
<intent-filter>
136+
<action android:name="android.intent.action.VIEW"/>
137+
<category android:name="android.intent.category.DEFAULT"/>
138+
<category android:name="android.intent.category.BROWSABLE"/>
139+
<data android:host="your-domain-here.example.com" android:scheme="http"/>
140+
<data android:host="your-domain-here.example.com" android:scheme="https"/>
141+
</intent-filter>
142+
```
143+
128144
**Build & Run**
129145
130146
- Open `build.gradle` in Android Studio.

messaging/testapp/src/common_main.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ extern "C" int common_main(int argc, const char* argv[]) {
7777
if (!message.message_id.empty()) {
7878
LogMessage("message_id: %s", message.message_id.c_str());
7979
}
80+
if (!message.link.empty()) {
81+
LogMessage(" link: %s", message.link.c_str());
82+
}
8083
if (!message.data.empty()) {
8184
LogMessage("data:");
8285
for (const auto& field : message.data) {

0 commit comments

Comments
 (0)