Skip to content

Commit 6909cea

Browse files
committed
Fixing calling contentHandler before adding attachments
When using the new NSE api the contentHandler was called before downloading media attachments so images would not display.
1 parent de698d3 commit 6909cea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

iOS_SDK/OneSignalSDK/Source/OneSignalNotificationServiceExtensionHandler.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ + (UNMutableNotificationContent*)didReceiveNotificationExtensionRequest:(UNNotif
7373

7474
// Trigger the notification to be shown with the replacementContent
7575
if (contentHandler) {
76-
contentHandler(replacementContent);
7776
dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
7877
[self onNotificationReceived:receivedNotificationId withBlockingTask:semaphore];
7978
// Download Media Attachments after kicking off the confirmed delivery task
8079
[OneSignalHelper addAttachments:notification toNotificationContent:replacementContent];
80+
contentHandler(replacementContent);
8181
dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, MAX_NSE_LIFETIME_SECOUNDS * NSEC_PER_SEC));
8282
} else {
8383
[self onNotificationReceived:receivedNotificationId withBlockingTask:nil];

0 commit comments

Comments
 (0)