How do I know when a user clicks on a notification in their notification drawer, bringing them to the app, and how do I access the notification data?

For instance, a user receives a push notification that a thread they started receives a comment. When they tap the notification, I'd like to be able to bring the user directly to the relevant thread.

Thank you for your help!

-Will

asked 15 Oct '14, 01:51
wak47's gravatar image

wak47
11

Right, I'm currently using the custom_data property, but the 'push-notification' event is called regardless of whether or not the user clicks on the notification. I only want an action to be taken if they explicitly tap on the notification.

No, it is only called when you tap on the notification. If you launch the app by its icon - no push-notification event triggered. The only way it could be triggered automatically - if your app is in foreground.

permanent link
answered 24 Nov '14, 06:48
shader's gravatar image

shader
3.9k7

Hello,

Actually, you can easily pass custom data with your notifications in the { "key": "value" } format. You can do it via both Control Panel (Additional data -> Custom data) and API ("data" section of the createMessage method).

The custom data would be delivered with the push and processed by your application after user clicks on the notification. It can be set to perform various actions such as displaying the specific screen, launching some activity, etc.

You can retrieve the custom data with "u" parameter.

permanent link
answered 20 Oct '14, 11:44
Benedict's gravatar image

Benedict
7127

Right, I'm currently using the custom_data property, but the 'push-notification' event is called regardless of whether or not the user clicks on the notification. I only want an action to be taken if they explicitly tap on the notification.

(22 Oct '14, 18:00) wak47 wak47's gravatar image

Really need an answer to this one.

(21 Nov '14, 03:29) wak47 wak47's gravatar image

Anyone else have any suggestions?

permanent link
answered 21 Nov '14, 03:30
wak47's gravatar image

wak47
11

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×319
×186
×25

question asked: 15 Oct '14, 01:51

question was seen: 1,554 times

last updated: 24 Nov '14, 06:48