簡體   English   中英

當應用程序關閉時,pushwoosh自定義推送廣播接收器不會觸發

[英]pushwoosh Custom Push Broadcast Receiver not fire when application is close

我已經創建了用於處理推送通知的自定義推送廣播接收器,並將通知保存在本地數據庫中,但是在我的應用程序中,當新通知到達並且應用程序關閉時,自定義接收器不會觸發。

我想在應用程序關閉且通知到達時將通知保存在數據庫中。

請提出建議並幫助我。

您必須編寫這樣的broadcastreceiver並注冊它的清單,以便每當通知到達時,此接收器都會采取措施。

 public class PushWooshManager extends BroadcastReceiver {
    public void onReceive(Context context, Intent intent) {
        Log.i("PUSH", "received");
        if (intent!=null){
        write your code to store the notification data

    }
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM