crotoan
crotoan

Reputation: 183

Open APP on GCM notification

is it possible to open android app when I'll push notification to the mobile? I can't find anything about that, does anyone tried to do that? Is it even possible?

Best Regards, Mateusz

Upvotes: 3

Views: 606

Answers (1)

CommonsWare
CommonsWare

Reputation: 1007494

GCM messages are delivered to a BroadcastReceiver. Your BroadcastReceiver can, technically, call startActivity() on the Context passed into onReceive(). And hence, technically, you can have a GCM message start an activity.

Whether this is a good idea is another matter entirely.

On the whole, users do not like unexpected interruptions. Users may get very irritated with you if you pop up your activity over top of the user's book, game, movie, or car navigation session. Some of these scenarios, particularly the last one, can have fairly unpleasant results.

A Notification is a more typical approach for alerting the user about something that arrived as a result of a GCM message.

Upvotes: 1

Related Questions