8000 fix(local-notifications): return types · NativeScript/plugins@4048863 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4048863

Browse files
committed
fix(local-notifications): return types
1 parent bfa9164 commit 4048863

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/local-notifications/index.ios.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,15 @@ export class LocalNotificationsImpl extends LocalNotificationsCommon implements
108108
return Math.abs(ticks) * multiplier;
109109
}
110110

111-
private static schedulePendingNotifications(scheduleOptions: ScheduleOptions[]): Array<number> {
111+
private static async schedulePendingNotifications(scheduleOptions: ScheduleOptions[]): Promise<Array<number>> {
112112
if (LocalNotificationsImpl.isUNUserNotificationCenterAvailable()) {
113-
return LocalNotificationsImpl.schedulePendingNotificationsNew(scheduleOptions);
113+
return await LocalNotificationsImpl.schedulePendingNotificationsNew(scheduleOptions);
114114
} else {
115115
return LocalNotificationsImpl.schedulePendingNotificationsLegacy(scheduleOptions);
116116
}
117117
}
118118

119-
private static async schedulePendingNotificationsNew(scheduleOptions: ScheduleOptions[]): Array<number> {
119+
private static async schedulePendingNotificationsNew(scheduleOptions: ScheduleOptions[]): Promise<Array<number>> {
120120
const scheduledIds: number[] = [];
121121

122122
for (const s of scheduleOptions) {
@@ -224,7 +224,7 @@ export class LocalNotificationsImpl extends LocalNotificationsCommon implements
224224
}
225225

226226
function registerNotification(id: number, content: UNMutableNotificationContent, trigger: UNNotificationTrigger) {
227-
return new Promise((resolve) => {
227+
return new Promise<number>((resolve) => {
228228
UNUserNotificationCenter.currentNotificationCenter().addNotificationRequestWithCompletionHandler(UNNotificationRequest.requestWithIdentifierContentTrigger('' + id, content, trigger), (error: NSError) => {
229229
if (error) {
230230
console.log(`Error scheduling notification (id ${id}): ${error.localizedDescription}`);

0 commit comments

Comments
 (0)
0