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
Everything up until here works fine, notifications are received and displayed when the app is in BG (but not displayed when in FG), however the following never gets logged:
import UserNotifications
import OneSignalExtension
classNotificationService:UNNotificationServiceExtension{varcontentHandler:((UNNotificationContent)->Void)?varreceivedRequest:UNNotificationRequest!varbestAttemptContent:UNMutableNotificationContent?overridefunc didReceive(_ request:UNNotificationRequest, withContentHandler contentHandler:@escaping(UNNotificationContent)->Void){self.receivedRequest = request
self.contentHandler = contentHandler
self.bestAttemptContent =(request.content.mutableCopy()as?UNMutableNotificationContent)
if let bestAttemptContent = bestAttemptContent {
/* DEBUGGING: Uncomment the 2 lines below to check this extension is executing
Note, this extension only runs when mutable-content is set
Setting an attachment or action buttons automatically adds this */
print("Running NotificationServiceExtrension")
bestAttemptContent.body ="[Modified] "+ bestAttemptContent.body
OneSignalExtension.didReceiveNotificationExtensionRequest(self.receivedRequest, with: bestAttemptContent, withContentHandler:self.contentHandler)}}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 {OneSignalExtension.serviceExtensionTimeWillExpireRequest(self.receivedRequest, with:self.bestAttemptContent)contentHandler(bestAttemptContent)}}}
Steps to reproduce?
Install basically latest version of as-of now as mentioned above.
What did you expect to happen?
Receive click event.
OneSignal Cordova SDK version
5.2.1
Which platform(s) are affected?
iOS
Android
Relevant log output
No response
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
j4hangir
changed the title
[Bug]:
[Bug]: None of the events are received
Jun 28, 2024
What happened?
Install
"onesignal-cordova-plugin": "^5.2.1",
in iOS pod:
Ionic Vue:
Everything up until here works fine, notifications are received and displayed when the app is in BG (but not displayed when in FG), however the following never gets logged:
NotificationService.swift:
Steps to reproduce?
What did you expect to happen?
Receive click event.
OneSignal Cordova SDK version
5.2.1
Which platform(s) are affected?
Relevant log output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: