diff --git a/docs/advanced-ios.md b/docs/advanced-ios.md index 4dd22ba..c2e7f0d 100644 --- a/docs/advanced-ios.md +++ b/docs/advanced-ios.md @@ -152,14 +152,14 @@ The [example app](https://github.com/wix/react-native-notifications/tree/master/ Get the current number: ```javascript -Notifications.ios.getBadgesCount((count) => console.log(count)); +Notifications.ios.getBadgeCount((count) => console.log(count)); ``` Set to specific number: ```javascript -Notifications.ios.setBadgesCount(2); +Notifications.ios.setBadgeCount(2); ``` Clear badges icon: ```javascript -Notifications.ios.setBadgesCount(0); +Notifications.ios.setBadgeCount(0); ``` diff --git a/docs_old/advancedIos.md b/docs_old/advancedIos.md index 27f69ce..be68a93 100644 --- a/docs_old/advancedIos.md +++ b/docs_old/advancedIos.md @@ -238,14 +238,14 @@ The [example app](https://github.com/wix/react-native-notifications/tree/master/ Get the current number: ```javascript -NotificationsIOS.getBadgesCount((count) => console.log(count)); +NotificationsIOS.getBadgeCount((count) => console.log(count)); ``` Set to specific number: ```javascript -NotificationsIOS.setBadgesCount(2); +NotificationsIOS.setBadgeCount(2); ``` Clear badges icon: ```javascript -NotificationsIOS.setBadgesCount(0); +NotificationsIOS.setBadgeCount(0); ``` diff --git a/lib/ios/RNBridgeModule.m b/lib/ios/RNBridgeModule.m index cf319ed..bc7d699 100644 --- a/lib/ios/RNBridgeModule.m +++ b/lib/ios/RNBridgeModule.m @@ -60,12 +60,12 @@ RCT_EXPORT_METHOD(registerPushKit) { [_commandsHandler registerPushKit]; } -RCT_EXPORT_METHOD(getBadgesCount:(RCTResponseSenderBlock)callback) { - [_commandsHandler getBadgesCount:callback]; +RCT_EXPORT_METHOD(getBadgeCount:(RCTResponseSenderBlock)callback) { + [_commandsHandler getBadgeCount:callback]; } -RCT_EXPORT_METHOD(setBadgesCount:(int)count) { - [_commandsHandler setBadgesCount:count]; +RCT_EXPORT_METHOD(setBadgeCount:(int)count) { + [_commandsHandler setBadgeCount:count]; } RCT_EXPORT_METHOD(postLocalNotification:(NSDictionary *)notification withId:(nonnull NSNumber *)notificationId) { diff --git a/lib/ios/RNCommandsHandler.h b/lib/ios/RNCommandsHandler.h index 2cf4044..1dd60cb 100644 --- a/lib/ios/RNCommandsHandler.h +++ b/lib/ios/RNCommandsHandler.h @@ -19,9 +19,9 @@ - (void)registerPushKit; -- (void)getBadgesCount:(RCTResponseSenderBlock)callback; +- (void)getBadgeCount:(RCTResponseSenderBlock)callback; -- (void)setBadgesCount:(int)count; +- (void)setBadgeCount:(int)count; - (void)postLocalNotification:(NSDictionary *)notification withId:(NSNumber *)notificationId; diff --git a/lib/ios/RNCommandsHandler.m b/lib/ios/RNCommandsHandler.m index e1ac12f..0313cb1 100644 --- a/lib/ios/RNCommandsHandler.m +++ b/lib/ios/RNCommandsHandler.m @@ -41,12 +41,12 @@ [RNNotifications startMonitorPushKitNotifications]; } -- (void)getBadgesCount:(RCTResponseSenderBlock)callback { +- (void)getBadgeCount:(RCTResponseSenderBlock)callback { NSInteger count = [UIApplication sharedApplication].applicationIconBadgeNumber; callback(@[ [NSNumber numberWithInteger:count] ]); } -- (void)setBadgesCount:(int)count { +- (void)setBadgeCount:(int)count { [[UIApplication sharedApplication] setApplicationIconBadgeNumber:count]; } diff --git a/lib/src/NotificationsIOS.ts b/lib/src/NotificationsIOS.ts index 56a4a62..ff91089 100644 --- a/lib/src/NotificationsIOS.ts +++ b/lib/src/NotificationsIOS.ts @@ -38,7 +38,7 @@ export class NotificationsIOS { } /** - * getBadgesCount + * getBadgeCount */ public getBadgeCount(): Promise { return this.commands.getBadgeCount();