6

I am trying to send a silent notification (I mean a notification that will not be shown in the tray) using this API:

but when I do not set the body key I get this Error:

 {
  "error": {
    "code": 400,
    "message": "body parameter is invalid or empty.: 'Body' cannot be null."
  }
}

so my question is if there is a way to send a silent notification in android (in ios I know there is the content-available flag)

Tnx in advance!

sarahm
  • 61
  • 1
  • 4

4 Answers4

4

Unfortunately silent notification is not yet supported on App Center for Android.

Guillaume Perrot
  • 3,978
  • 2
  • 25
  • 33
  • Thanks @Guillaume, you were 100% right. I just got the confirmation from your support (that was not aware of that limitation) "Unfortunately, I just confirmed that it is currently unavailable for Android. Guillaume is indeed one of the engineers on our team and is a great source of information. I understand it is something we will be working on but no ETA at the moment." – Philippe Cohen Mar 08 '18 at 14:18
  • 3
    @Guillaume thank you for the information! Is there any update about ETA for silent notification support on App Center? Are there any workaround at the moment? – pfedotovsky Apr 07 '18 at 22:34
  • Any eta ? This seems an important feature. – Softlion Nov 28 '18 at 11:24
  • Hi, for feature requests I would recommend contacting the team on the chat support from any page of https://appcenter.ms. – Guillaume Perrot Nov 28 '18 at 20:31
  • Can you add this somewhere in the docs? I went through the whole SDK setup process and now I have to use to Firebase anyways... – szx Aug 11 '19 at 18:29
4

I've asked AppCenter support via their live chat and they replied me the following

You can by setting “content-available” key in the custom data. here is a sample payload you need to set in body:

“notification_content” : {  
   “name” : “name of Push”,  
   “custom_data” : {“content-available” : “1”}  
},
Philippe Cohen
  • 910
  • 1
  • 9
  • 13
0

Indeed,

“notification_content” : {
“name” : “name of Push”,
“custom_data” : {“content-available” : “1”}
},

is for silent push notifications in ios

rts
  • 49
  • 2
  • 5
  • is there any additional set up to handle silent push messages? I tried to send message as you described, but my callback is not triggered – pfedotovsky Apr 17 '18 at 07:52
0

Try this for Android and iOS

{
  "notification_target": {
    "type": "devices_target",
    "devices": [
      "43533adc-4133-4121-ad4e-1eb4885b4b98"
    ]
  },
  "notification_content": {
    "name": "edd3-43ef-91f5-276c28a86517",
    "title": "",
    "body": "",
    "custom_data": {
      "content-available": "1",
      "id": "your data"
    }
  }
}
ItsPete
  • 2,323
  • 3
  • 26
  • 34
Donald
  • 1
  • 1