2

aps辞書でmutable_content = trueを送信する方法を理解できません。これは私がfirebaseメッセージングコンソールからFirebase Notificationsコンソールを使用してAPNSペイロードにmutable_contentを追加する方法は?

{ 
    aps =  { 
     alert =   { 
      body = "50% off on booking "; 
      title = "CompanyName 50% coupon ABC50OFF"; 
     }; 
     sound = default; 
    }; 
    "attachment-url" = "https://www.xxxxxxxxx.com/campaign/images_thumb/Toyota-Fortuner-AT.jpg"; 
    "click_action" = reminder; 
    "content_available" = 1; 
    "gcm.message_id" = "0:1491225835295720%a84b45aaa84b45aa"; 
    "gcm.n.e" = 1; 
    "gcm.notification.sound2" = default; 
    "google.c.a.c_id" = 3829383583613273032; 
    "google.c.a.e" = 1; 
    "google.c.a.ts" = 1491225835; 
    "google.c.a.udt" = 0; 
    "mutable_content" = 1; 
} 

答えて

1

を通知を送信するとき、Firebase通知コンソールを使用した場合mutable_contentの値を設定することはできない受け取るJSONペイロードです。あなたは自分自身でペイロードを構築する必要があります:

{ 
    "to": "<REGISTRATION_TOKEN_HERE>", 
    "mutable-content" : true, 
    "notification": { 
     "body" : "Eureka!", 
     "title": "Patient is not doing well", 
     "click_action" : "provider-body-panel" 
    } 
} 

それから自分のアプリケーションサーバーから送信してください。また、using PostmanまたはcURL

修正部分をhereで修正することもできます。

関連する問題