aws-amplify / aws-amplify/amplify-android

Pinpoint notifications: Deep link doesn't work

Open
#2,814 8 comments 0 reactions 0 assignees View on GitHub
documentation feature-request Push Notifications
Dominant language
Java
Stars
287
Forks
132
Avg merge
2d 2h
Merged PRs (30d)
45

Description

### Before opening, please confirm:

- [X] I have [searched for duplicate or closed issues](https://github.com/aws-amplify/amplify-android/issues?q=is%3Aissue+) and [discussions](https://github.com/aws-amplify/amplify-android/discussions).

### Language and Async Model

Kotlin, Kotlin - Coroutines, RxJava

### Amplify Categories

Notifications

### Gradle script dependencies

```kotlin
amplify = "2.14.12"

amplify = { module = "com.amplifyframework:core-kotlin", version.ref = "amplify" }
amplifyCognito = { module = "com.amplifyframework:aws-auth-cognito", version.ref = "amplify" }
amplifyPushPinpoint = { module = "com.amplifyframework:aws-push-notifications-pinpoint", version.ref = "amplify" }
amplifyAnalyticsPinpoint = { module = "com.amplifyframework:aws-analytics-pinpoint", version.ref = "amplify" }
amplifyRx = { module = "com.amplifyframework:rxbindings", version.ref = "amplify" }

implementation(libs.amplify)
implementation(libs.amplifyCognito)
implementation(libs.amplifyPushPinpoint)
implementation(libs.amplifyAnalyticsPinpoint)
implementation(libs.amplifyRx)
```

### Environment information

```
# Put output below this line
------------------------------------------------------------
Gradle 8.4
------------------------------------------------------------

Build time: 2023-10-04 20:52:13 UTC
Revision: e9251e572c9bd1d01e503a0dfdf43aedaeecdc3f

Kotlin: 1.9.10
Groovy: 3.0.17
Ant: Apache Ant(TM) version 1.10.13 compiled on January 4 2023
JVM: 11.0.10 (JetBrains s.r.o. 11.0.10+0-b96-7281165)
OS: Mac OS X 14.4.1 x86_64
```

### Please include any relevant guides or documentation you're referencing

https://docs.aws.amazon.com/pinpoint/latest/apireference/apps-application-id-messages.html#apps-application-id-messages-prop-apnsmessage-action

### Describe the bug

I'm trying to use deep link in my android app. Seems like Amplify doesn't support it.

What I send from web Pinpoint:
```
{
"APNSMessage": {
"aps": {
"alert": ""
}
},
"GCMMessage": {
"notification": {
"title": "Merry Christmas",
"body": "Ho ho ho"
},
"Action": "DEEP_LINK",
"url": "link here",
"data": {
"url": "link here",
"screenTitle": "Lorem ipsum dolor sit amet, consectetur adipiscing elit",
"screenDescription": "Lorem ipsum dolor sit amet",
},
"ADMMessage": {
"data": {
"message": ""
}
},
"BaiduMessage": {
"title": "",
"description": ""
}
}
}
```
As you can see, I specified Action DEEP_LINK as it's described here: https://docs.aws.amazon.com/pinpoint/latest/apireference/apps-application-id-messages.html#apps-application-id-messages-prop-apnsmessage-action

Bu on the client side I receive a notification with no deep link.
It means that app gets **android.intent.action.MAIN** as the intent action by tap.
Intent's data is null.

I believe I've done everything correctly according:
https://docs.amplify.aws/gen1/android/build-a-backend/push-notifications/set-up-push-notifications/
https://docs.amplify.aws/gen1/android/build-a-backend/push-notifications/register-device/
https://docs.amplify.aws/gen1/android/build-a-backend/push-notifications/record-notifications/

What could be the problem?

### Reproduction steps (if applicable)

1. Send a FCM push with a deep link
2. Receive it on a device
3. Tap on the notification
Result: App is opened with no deep link. Intent: **android.intent.action.MAIN**, data: **null**

### Code Snippet

```java
// Put your code below this line.

```

### Log output

```
// Put your logs below this line

```

### amplifyconfiguration.json

```json
{
"UserAgent": "aws-amplify-cli/2.0",
"Version": "1.0",
"auth": {
"plugins": {
"awsCognitoAuthPlugin": {
"IdentityManager": {
"Default": {}
},
"CredentialsProvider": {
"CognitoIdentity": {
"Default": {
"PoolId": "hidden",
"Region": "eu-west-1"
}
}
},
"CognitoUserPool": {
"Default": {
"PoolId": "hidden",
"AppClientId": "hidden",
"Region": "eu-west-1"
}
},
"PinpointAnalytics": {
"Default": {
"AppId": "hidden",
"Region": "eu-west-1"
}
},
"PinpointTargeting": {
"Default": {
"Region": "eu-west-1"
}
}
}
}
},
"analytics": {
"plugins": {
"awsPinpointAnalyticsPlugin": {
"pinpointAnalytics": {
"appId": "hidden",
"region": "eu-west-1"
},
"pinpointTargeting": {
"region": "eu-west-1"
}
},
"awsPinpointPushNotificationsPlugin": {
"pinpointAnalytics": {
"appId": "hidden",
"region": "eu-west-1"
},
"pinpointTargeting": {
"region": "eu-west-1"
}
}
}
},
"notifications": {
"appId": "hidden",
"region": "eu-west-1",
"plugins": {
"awsPinpointAnalyticsPlugin": {
"pinpointAnalytics": {
"appId": "hidden",
"region": "eu-west-1"
},
"pinpointTargeting": {
"region": "eu-west-1"
}
},
"awsPinpointPushNotificationsPlugin": {
"appId": "hidden",
"region": "eu-west-1",
"pinpointAnalytics": {
"appId": "hidden",
"region": "eu-west-1"
},
"pinpointTargeting": {
"region": "eu-west-1"
}
}
}
},
"IdentityManager": {
"Default": {}
},

"CredentialsProvider": {
"CognitoIdentity": {
"Default": {
"PoolId": "hidden",
"AppClientId": "hidden",
"AppId": "hidden",
"Region": "eu-west-1"
}
}
},
"CognitoUserPool": {
"Default": {
"PoolId": "hidden",
"AppClientId": "hidden",
"AppId": "hidden",
"Region": "eu-west-1"
}
},
"PinpointAnalytics": {
"Default": {
"PoolId": "hidden",
"AppClientId": "hidden",
"AppId": "hidden",
"Region": "eu-west-1"
}
}
}

```

### GraphQL Schema

```graphql
// Put your schema below this line

```

### Additional information and screenshots

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the FCM push flow described in the reproduction steps, then inspect the notification tap result, especially the android.intent.action.MAIN action and null intent data. Compare the Pinpoint DEEP_LINK payload with the client-side behavior; done means tapping the notification delivers the intended deep-link data to the app.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.