Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion ios/RNCPushNotificationIOS.m
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ - (void)handleRemoteNotificationRegistrationError:(NSNotification *)notification
[RCTSharedApplication() scheduleLocalNotification:notification];
}

RCT_EXPORT_METHOD(addNotificationRequest:(UNNotificationRequest*)request)
RCT_EXPORT_METHOD(addNotificationRequest:(UNNotificationRequest*)request callback:(RCTResponseSenderBlock)callback)
{
UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
NSString *imageUrl = request.content.userInfo[@"image"];
Expand All @@ -306,6 +306,7 @@ - (void)handleRemoteNotificationRegistrationError:(NSNotification *)notification
if (!error) {
NSLog(@"image notifier request success");
}
callback(error);
}
];
}
Expand All @@ -316,6 +317,7 @@ - (void)handleRemoteNotificationRegistrationError:(NSNotification *)notification
if (!error) {
NSLog(@"notifier request success");
}
callback(error);
}
];
}
Expand Down
4 changes: 2 additions & 2 deletions js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class PushNotificationIOS {
* Sends notificationRequest to notification center at specified firedate.
* Fires immediately if firedate is not set.
*/
static addNotificationRequest(request: NotificationRequest) {
static addNotificationRequest(request: NotificationRequest, callback: Function = () =>{}) {
const handledRequest =
request.fireDate instanceof Date
? {...request, fireDate: request.fireDate.toISOString()}
Expand All @@ -151,7 +151,7 @@ class PushNotificationIOS {
repeatsComponent: request.repeatsComponent || {},
};

RNCPushNotificationIOS.addNotificationRequest(finalRequest);
RNCPushNotificationIOS.addNotificationRequest(finalRequest, callback);
}

/**
Expand Down