Parse Push - How to Automatically Open an activity without user action on receiving a push on Android

后端 未结 2 793
耶瑟儿~
耶瑟儿~ 2021-02-10 13:53

I have a requirement (android) where my app should run its main activity automatically when a push notification is received without the user clicking on notification in system t

2条回答
  •  孤街浪徒
    2021-02-10 14:08

    warning to @makovkastar, major changes since version V1.8. for instance: no more com.example.UPDATE_STATUS.

    push notifications guide is more clear now: https://www.parse.com/tutorials/android-push-notifications

    this is the ParsePushBroadcastReceiver subclass: https://gist.github.com/panchicore/97d5ad25842258576109 this answer have a good tutorial to send/receive local broadcasts: https://stackoverflow.com/a/8875292/155293

    Basically onPushReceive will be called when a push is received in the device, in this method use LocalBroadcastManager to make something in the app, for instance, add a new message to a chatroom.

提交回复
热议问题