question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to modify iOS "notification" payloads in notifee instead of creating Service App Extension?

See original GitHub issue

Hi everyone, recently I was working with iOS push notification. Here is my apns payload

{
  "messageId": "1638966606762796",
  "data": {
    "avatar": "",
    "eventtimestamp": "xxx",
    "title": "xxx",
    "room_name": "",
    "user_id": "xxx",
    "priority": "high",
    "body": "xxx"
  },
  "contentAvailable": true,
  "mutableContent": true,
  "notification": {
    "title": "xxx",
    "body": "xxx"
  }
}

“notification” payloads is meant to be display when app in background. However, I have to modify its “body” to display correct content.

For this, I have to create Service App Extension in swift to handle this “notification” payloads. But it seems not reliable as Service App Extension not working smoothly.

Any idea if I can modify “notification” payload directly in Notifee and avoid the native displaying?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
WenLonG12345commented, Dec 10, 2021

ohh ok I got it. Will ask my backend team to check on it.

One more question is that, is it a must that iOS will always need “notifcation” payloads?

From what I observe, “notification” will auto shown by iOS itself, the only way to change it is through Notification App Extension.

Is there anyway that “notification” can be modified directly with notifee instead of using Notification App Extension?

0reactions
helenafordcommented, Dec 21, 2021

Closing as question is answered

Read more comments on GitHub >

github_iconTop Results From Across the Web

Modifying Content in Newly Delivered Notifications
A notification service app extension ships as a separate bundle inside your iOS app. To add this extension to your app: Select File...
Read more >
Remote Notification support | Notifee
Update the message payload, sent via your backend; In a Notification Service Extension in your app when a device receives a remote message....
Read more >
Clarification about documentation regarding background ...
I'm finding the docs a bit ambiguous regarding background (push) messaging on iOS. Is it necessary to implement the notification service ...
Read more >
Modifying the Payload | Kodeco, the new raywenderlich.com
Make sure iOS is selected and choose the Notification Service Extension. For the product name specify Payload Modification. Press Finish.
Read more >
Push Notifications (V2) | Stream Chat - React Native SDK Docs
Make iOS Payload Data Only#. If the iOS payload is made to be data only, then setBackgroundMessageHandler can be used to display notifications...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found