Zorgan
Zorgan

Reputation: 9123

Get notification data when opening an app

When my app receives a push notification I can click on it and I can receive its data from the activity's intent.extras in my Fragment.

However when I receive a push notification and click on the app icon instead (with the notification badge) - it doesn't hold intent.extras.

So if I perform the latter, how can I access the data from the notification (such a title, body) etc?

Upvotes: 0

Views: 558

Answers (1)

Mirza Sijawal
Mirza Sijawal

Reputation: 29

try this
getIntent().getExtras().getString("s");

Upvotes: 3

Related Questions