I have been looking for a solution for this since quite a while. But I am not able to find anything. I have implemented Push Notifications for iOS using FCM. But I don't know if FCM supports iOS 10 rich notifications. If it does, I didn't find code to implement it. Thanks in advance.
- 2,870
- 2
- 11
- 16
- 89
- 1
- 12
-
no .. it doesn't .. – Bhavin Bhadani Nov 21 '16 at 05:11
-
Thank you for replying @EICaptainv2.0 . Are you sure about this?? i'm Just being over conscious. – Prajyot Nov 21 '16 at 05:14
-
@EICaptainv2.0 If you can please post a detailed answer, that would be really appreciable. Thank you. – Prajyot Nov 21 '16 at 05:16
3 Answers
I have the same question why rich notification not working.. and the problem is with FCM mutable-content payload .. it turns in to gcm.notification.mutable-content when payload receives and that's why there is a problem which is not resolved yet.
For more information, you can check this issue from github.
Its resolved now.. you can check that link and also check this answer AL.
- 1
- 1
- 21,946
- 10
- 78
- 104
Just an update in relation with @ElCaptainv2.0's answer.
The mutable_content has been added for FCM:
Currently for iOS 10+ devices only. On iOS, use this field to represent mutable-content in the APNS payload. When a notification is sent and this is set to true, the content of the notification can be modified before it is displayed, using a Notification Service app extension. This parameter will be ignored for Android and web.
Note: The parameter value should be boolean, not Integer.
It was also mentioned in the GitHub thread just a few hours ago by kroikie.
- 35,361
- 10
- 135
- 270
-
I am insert `mutable_content` in fcm payload but it's doesn't work. When I try to check my code with APNS it's work fine. `{"to": "dWB537Nz....", "data": { "message": "Offer!", "mediaUrl": "HTTPS url" }, "notification": { "body": "Enter your message", "sound": "default", "click_action": "reminder", "content-available": 1, "mutable-content": 1 } }` – Mathi Arasan Mar 01 '17 at 13:38
-
`mutable_content` should be declared outside `notification`. Same with `content_available`. Note that for FCM, it has underscores (`_`) instead of dashes (`-`). – AL. Mar 01 '17 at 13:50
-
No worries. I noticed you were the one that posted a related question. I added in an answer. :) Cheers! – AL. Mar 01 '17 at 13:57
-
How do you manage to get the data associated with this payload? It ends up outside of "aps" when arriving on the iPhone which is troublesome. – SeikoTheWiz Mar 13 '17 at 16:19
-
I think you should also state that `mutable_content` has to be set to `'true'` . I thought it was supposed to be set to `'1'` – Kilo Loco Sep 09 '17 at 15:50
-
-
Hi Guys my notifications { "registration_ids": ["devicetoken"], "mutable_content": true, "data": { "post_details": { "pcm_message": "asdf", "pcm_img_url": "http://portalvh/15683.jpg", } }, "notification" : { "title" : "demo push", "body" : "this is push body" } } but still one don't call Notification Service Extension where is problem or missing some information I have already set deployment target 10.0 in my whole project – Ankur Patel Feb 28 '18 at 10:04
-
@AnkurPatel I suggest posting a question along with the details instead of adding a comment here. It's hard to view since formatting in the comments are limited. Cheers! – AL. Feb 28 '18 at 10:09
-
@AL. thanks for reply see below my question link https://stackoverflow.com/questions/49027023/ios-10-when-notification-arrived-do-not-get-call-notification-h-notification-se – Ankur Patel Feb 28 '18 at 10:16
I was working on this for hours and hours and hours and hours. All my notifications worked fine except the rich notification image would never show. Here is the answer is plain english:
Change this:
"mutable-content": 1 // wrong
To this:
"mutable_content": true // correct
Here is the outgoing payload:
"aps": {
"alert": {
"title": "Hello",
"body": "What do you think of this image?"
},
"mutable_content": true
},
"media-url": "https://firebasestorage.googleapis.com/....."
- 14,568
- 10
- 83
- 201