|
|
@@ -1,14 +1,16 @@
|
|
|
#import "AppDelegate.h"
|
|
|
-
|
|
|
-#import <React/RCTBridge.h>
|
|
|
#import <React/RCTBundleURLProvider.h>
|
|
|
-#import <React/RCTRootView.h>
|
|
|
+
|
|
|
#import <GoogleMaps/GoogleMaps.h>
|
|
|
|
|
|
#import <UserNotifications/UserNotifications.h>
|
|
|
#import <RNCPushNotificationIOS.h>
|
|
|
+// 引入Firebase
|
|
|
+@import UserNotifications;
|
|
|
+#import "FirebaseCore.h"
|
|
|
+#import "FirebaseMessaging.h"
|
|
|
|
|
|
-#ifdef FB_SONARKIT_ENABLED
|
|
|
+/*#ifdef FB_SONARKIT_ENABLED
|
|
|
#import <FlipperKit/FlipperClient.h>
|
|
|
#import <FlipperKitLayoutPlugin/FlipperKitLayoutPlugin.h>
|
|
|
#import <FlipperKitUserDefaultsPlugin/FKUserDefaultsPlugin.h>
|
|
|
@@ -25,11 +27,7 @@ static void InitializeFlipper(UIApplication *application) {
|
|
|
[client addPlugin:[[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]];
|
|
|
[client start];
|
|
|
}
|
|
|
-#endif
|
|
|
-
|
|
|
-@import UserNotifications;
|
|
|
-#import "FirebaseCore.h"
|
|
|
-#import "FirebaseMessaging.h"
|
|
|
+#endif*/
|
|
|
|
|
|
@interface AppDelegate () <UNUserNotificationCenterDelegate>
|
|
|
|
|
|
@@ -52,18 +50,13 @@ static void InitializeFlipper(UIApplication *application) {
|
|
|
[GMSServices provideAPIKey:@"AIzaSyAVzs860l2Iuu1zG80IT1Zu4w7OvbVmJ4g"]; // add this line using the api key obtained from Google Console
|
|
|
|
|
|
//远程推送配置
|
|
|
- // Define UNUserNotificationCenter
|
|
|
[UNUserNotificationCenter currentNotificationCenter].delegate = self;
|
|
|
- UNAuthorizationOptions authOptions = UNAuthorizationOptionAlert |
|
|
|
- UNAuthorizationOptionSound | UNAuthorizationOptionBadge;
|
|
|
- [[UNUserNotificationCenter currentNotificationCenter]
|
|
|
- requestAuthorizationWithOptions:authOptions
|
|
|
- completionHandler:^(BOOL granted, NSError * _Nullable error) {
|
|
|
- // ...
|
|
|
- }];
|
|
|
-
|
|
|
+ UNAuthorizationOptions authOptions = UNAuthorizationOptionAlert | UNAuthorizationOptionSound | UNAuthorizationOptionBadge;
|
|
|
+ [[UNUserNotificationCenter currentNotificationCenter] requestAuthorizationWithOptions:authOptions
|
|
|
+ completionHandler:^(BOOL granted, NSError * _Nullable error) {
|
|
|
+ // ...
|
|
|
+ }];
|
|
|
[application registerForRemoteNotifications];
|
|
|
- //return YES;
|
|
|
return [super application:application didFinishLaunchingWithOptions:launchOptions];
|
|
|
}
|
|
|
|