mirror of
https://github.com/zhigang1992/react-native-notifications.git
synced 2026-06-13 17:45:45 +08:00
Use local RN js code
This commit is contained in:
@@ -1,17 +1,8 @@
|
||||
/**
|
||||
* Copyright (c) 2015-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*/
|
||||
|
||||
#import "AppDelegate.h"
|
||||
|
||||
#import "RCTBundleURLProvider.h"
|
||||
#import "RCTRootView.h"
|
||||
#import "RNNotifications.h"
|
||||
#import <React/RCTBundleURLProvider.h>
|
||||
#import <React/RCTRootView.h>
|
||||
#import <RNNotifications/RNNotifications.h>
|
||||
|
||||
#import <PushKit/PushKit.h>
|
||||
|
||||
@@ -40,48 +31,48 @@
|
||||
// PushKit API Example
|
||||
- (void)pushRegistry:(PKPushRegistry *)registry didUpdatePushCredentials:(PKPushCredentials *)credentials forType:(NSString *)type
|
||||
{
|
||||
[RNNotifications didUpdatePushCredentials:credentials forType:type];
|
||||
[[RNNotifications sharedInstance] didUpdatePushCredentials:credentials forType:type];
|
||||
}
|
||||
|
||||
- (void)pushRegistry:(PKPushRegistry *)registry didReceiveIncomingPushWithPayload:(PKPushPayload *)payload forType:(NSString *)type
|
||||
{
|
||||
[RNNotifications didReceiveRemoteNotification:payload.dictionaryPayload];
|
||||
// [[RNNotifications sharedInstance] didReceiveRemoteNotification:payload.dictionaryPayload];
|
||||
}
|
||||
|
||||
|
||||
// Required to register for notifications
|
||||
- (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings
|
||||
{
|
||||
[RNNotifications didRegisterUserNotificationSettings:notificationSettings];
|
||||
// [[RNNotifications sharedInstance] didRegisterUserNotificationSettings:notificationSettings];
|
||||
}
|
||||
|
||||
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
|
||||
{
|
||||
[RNNotifications didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
|
||||
[[RNNotifications sharedInstance] didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
|
||||
}
|
||||
|
||||
|
||||
// Required for the notification event.
|
||||
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)notification {
|
||||
[RNNotifications didReceiveRemoteNotification:notification];
|
||||
// [[RNNotifications sharedInstance] didReceiveRemoteNotification:notification];
|
||||
}
|
||||
|
||||
// Required for the localNotification event.
|
||||
- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification
|
||||
{
|
||||
[RNNotifications didReceiveLocalNotification:notification];
|
||||
// [[RNNotifications sharedInstance] didReceiveLocalNotification:notification];
|
||||
}
|
||||
|
||||
|
||||
// Required for the notification actions.
|
||||
- (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forLocalNotification:(UILocalNotification *)notification withResponseInfo:(NSDictionary *)responseInfo completionHandler:(void (^)())completionHandler
|
||||
{
|
||||
[RNNotifications handleActionWithIdentifier:identifier forLocalNotification:notification withResponseInfo:responseInfo completionHandler:completionHandler];
|
||||
[[RNNotifications sharedInstance] handleActionWithIdentifier:identifier forLocalNotification:notification withResponseInfo:responseInfo completionHandler:completionHandler];
|
||||
}
|
||||
|
||||
- (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forRemoteNotification:(NSDictionary *)userInfo withResponseInfo:(NSDictionary *)responseInfo completionHandler:(void (^)())completionHandler
|
||||
{
|
||||
[RNNotifications handleActionWithIdentifier:identifier forRemoteNotification:userInfo withResponseInfo:responseInfo completionHandler:completionHandler];
|
||||
[[RNNotifications sharedInstance] handleActionWithIdentifier:identifier forRemoteNotification:userInfo withResponseInfo:responseInfo completionHandler:completionHandler];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user