2017-10-26 11 views
0

Androidで特定のアプリケーションの通知を受け取ったとき。 ユーザーがその通知をクリックします。 オープンアプリが正常に終了しました。通知からクリックしてバンドルデータを取得するとアプリを開く

私が知る必要があるのは、それが「バンドル」を持っていることです。 誰かがそれを

{ 
    "to":"xyz", 
    "notification":{ 
     "body":"Congratulations !!", 
     "title":"abc", 
     "icon":"myicon", 
     "sound":"mySound", 
     "badge":"5" 
    }, 
    "payload":{ 
     "aps":{ 
     "alert":{ 
      "type":"gallery_listing", 
      "sub_type":"approval_of_selfie", 
      "notif_header":"Approval of Selfie", 
      "notif_message":"Congratulations your selfie is approved", 
      "notif_id":"12345", 
      "image_path":"" 
     } 
     } 
    } 
    } 



Intent intent = this.getIntent(); 
    if (intent != null && intent.getExtras() != null && (intent.getFlags() & Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY) == 0) { 
     Log.d("sk_log", "Notification ===1======="+intent.getExtras().get("notification")); 
     } 

答えて

0

を読むのを助けることができる私はあなたがテント/バンドル内のすべての利用可能なキーを見たいと思っているようです。あなたは以下のリンクであなたの答えを見ることができます:

Listing all extras of an Intent

これはあなたを助けることを願っています。

関連する問題