You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and NotificationService.swift (not sure if this file is necessary since there's an identical one in this repo):
import UserNotifications
classNotificationService:UNNotificationServiceExtension{varcontentHandler:((UNNotificationContent)->Void)?varbestAttemptContent:UNMutableNotificationContent?overridefunc didReceive(_ request:UNNotificationRequest, withContentHandler contentHandler:@escaping(UNNotificationContent)->Void){self.contentHandler = contentHandler
bestAttemptContent =(request.content.mutableCopy()as?UNMutableNotificationContent)
if let bestAttemptContent = bestAttemptContent {// Modify the notification content here
bestAttemptContent.title ="\(bestAttemptContent.title) [modified]"contentHandler(bestAttemptContent)}}overridefunc serviceExtensionTimeWillExpire(){// Called just before the extension will be terminated by the system.// Use this as an opportunity to deliver your "best attempt" at modified content, otherwise the original push payload will be used.
if let contentHandler = contentHandler,let bestAttemptContent = bestAttemptContent {contentHandler(bestAttemptContent)}}}
I get this console warning:
I'm using expo-apple-targets to add Notification Service Extension to my react native expo project.
in
./src/targets/notification-service
I have:expo-target.config.js
and NotificationService.swift (not sure if this file is necessary since there's an identical one in this repo):
In my app.json the first plugin is
I tried without using the
root
key (so that is not the problem).The text was updated successfully, but these errors were encountered: