Push Notification with Deeplinking

I’m sending push notification through an API call to /push/notifications and on my request I’m injecting a payload with a link in the form of my defined Deeplinking Scheme:

tokens: deviceList,
profile: process.env.PROFILE_TAG,
notification: {
		message: notificationText,
		payload: {
			link: "myscheme://" + HOST_NAME + notificationLink
		}
	}

Now, my first question is why can’t the notifications have a link/deeplink property that allows us to just tap the notification and go straight into the defined page?

Secondly, how can I treat/read the push notification payload?

I think I’m already defeating the purpose of Deeplinks if I need to parse/extract the payload from the push notification first.

What’s the correct course of action here?

Also, this might be worth reading as it is nowhere to be seen on Ionic Docs: https://github.com/phonegap/phonegap-plugin-push/blob/master/docs/TYPESCRIPT.md

Best Regards

2 Likes

Because that is logic that has to be implemented in your app. Their are lots of different ways to build pages, navigation to pages and so on, so it is impossible to generalize this.

Not really. Deeplinks are used to tell your app to jump somewhere specific. Push notifications are used to tell your app about some event or data. You just have to extract the deeplink part of that data and give it to your app to handle.