reactnative-plugin-appice 1.7.28 → 1.7.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -37
- package/android/README.md +14 -14
- package/android/build.gradle +138 -158
- package/android/gitignore +47 -47
- package/android/gradle/wrapper/gradle-wrapper.properties +5 -5
- package/android/gradlew +234 -234
- package/android/local.properties +8 -8
- package/android/src/main/AndroidManifest.xml +120 -164
- package/android/src/main/java/com/{reactlibrary → appice/react}/AppICEUtils.java +274 -274
- package/android/src/main/java/com/{reactlibrary → appice/react}/AppIceReactPluginModule.java +778 -778
- package/android/src/main/java/com/{reactlibrary → appice/react}/AppIceReactPluginPackage.java +28 -28
- package/android/src/main/java/com/{reactlibrary → appice/react}/CampaignCampsReceiver.java +56 -56
- package/android/src/main/java/com/{reactlibrary → appice/react}/EnumConstants.java +282 -282
- package/android/src/main/java/com/{reactlibrary → appice/react}/NotificationEventService.java +59 -59
- package/android/src/main/java/com/{reactlibrary → appice/react}/StringConstants.java +24 -24
- package/campaign.js +25 -25
- package/example/App.js +332 -332
- package/example/Gemfile +6 -6
- package/example/PageA.tsx +15 -15
- package/example/__tests__/App-test.js +14 -14
- package/example/ancilliary.js +486 -486
- package/example/android/app/_BUCK +55 -55
- package/example/android/app/build.gradle +320 -320
- package/example/android/app/build_defs.bzl +19 -19
- package/example/android/app/proguard-rules.pro +10 -10
- package/example/android/app/src/debug/AndroidManifest.xml +13 -13
- package/example/android/app/src/debug/java/com/example/ReactNativeFlipper.java +73 -73
- package/example/android/app/src/main/AndroidManifest.xml +72 -72
- package/example/android/app/src/main/java/com/example/MainActivity.java +48 -48
- package/example/android/app/src/main/java/com/example/MainApplication.java +91 -91
- package/example/android/app/src/main/java/com/example/newarchitecture/MainApplicationReactNativeHost.java +116 -116
- package/example/android/app/src/main/java/com/example/newarchitecture/components/MainComponentsRegistry.java +36 -36
- package/example/android/app/src/main/java/com/example/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java +48 -48
- package/example/android/app/src/main/jni/Android.mk +48 -48
- package/example/android/app/src/main/jni/MainApplicationModuleProvider.cpp +24 -24
- package/example/android/app/src/main/jni/MainApplicationModuleProvider.h +16 -16
- package/example/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp +45 -45
- package/example/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h +38 -38
- package/example/android/app/src/main/jni/MainComponentsRegistry.cpp +61 -61
- package/example/android/app/src/main/jni/MainComponentsRegistry.h +32 -32
- package/example/android/app/src/main/jni/OnLoad.cpp +11 -11
- package/example/android/app/src/main/res/drawable/rn_edit_text_material.xml +36 -36
- package/example/android/app/src/main/res/values/strings.xml +3 -3
- package/example/android/app/src/main/res/values/styles.xml +9 -9
- package/example/android/build.gradle +73 -73
- package/example/android/gradle/wrapper/gradle-wrapper.properties +5 -5
- package/example/android/gradle.properties +40 -40
- package/example/android/gradlew +234 -234
- package/example/android/settings.gradle +11 -11
- package/example/app.json +3 -3
- package/example/babel.config.js +3 -3
- package/example/index.js +9 -9
- package/example/ios/Podfile +44 -44
- package/example/ios/Podfile.lock +561 -561
- package/example/ios/_xcode.env +11 -11
- package/example/ios/example/AppDelegate.h +8 -8
- package/example/ios/example/AppDelegate.mm +174 -174
- package/example/ios/example/Images.xcassets/AppIcon.appiconset/Contents.json +53 -53
- package/example/ios/example/Images.xcassets/Contents.json +6 -6
- package/example/ios/example/Info.plist +62 -62
- package/example/ios/example/LaunchScreen.storyboard +47 -47
- package/example/ios/example/example.entitlements +8 -8
- package/example/ios/example/main.m +10 -10
- package/example/ios/example.xcodeproj/project.pbxproj +712 -712
- package/example/ios/example.xcodeproj/xcshareddata/xcschemes/example.xcscheme +88 -88
- package/example/ios/example.xcworkspace/contents.xcworkspacedata +10 -10
- package/example/ios/example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -8
- package/example/ios/exampleTests/Info.plist +24 -24
- package/example/ios/exampleTests/exampleTests.m +66 -66
- package/example/metro.config.js +17 -17
- package/example/package.json +36 -36
- package/example/yarn.lock +7176 -7176
- package/index.js +590 -590
- package/ios/AppICEReactEvent.h +23 -23
- package/ios/AppICEReactEvent.m +86 -86
- package/ios/AppIceReactPlugin.h +65 -65
- package/ios/AppIceReactPlugin.m +683 -683
- package/ios/AppIceReactPlugin.xcodeproj/project.pbxproj +364 -364
- package/ios/AppIceReactPlugin.xcodeproj/project.xcworkspace/contents.xcworkspacedata +4 -4
- package/ios/AppIceReactPlugin.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -8
- package/ios/AppIceReactPlugin.xcodeproj/xcuserdata/Adi.xcuserdatad/xcschemes/xcschememanagement.plist +14 -14
- package/ios/AppIceReactPlugin.xcodeproj/xcuserdata/artherajesh.xcuserdatad/xcschemes/xcschememanagement.plist +14 -14
- package/ios/AppIceReactPlugin.xcworkspace/contents.xcworkspacedata +10 -10
- package/ios/AppIceReactPlugin.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -8
- package/ios/Podfile +10 -10
- package/ios/Podfile.lock +3 -3
- package/ios/Pods/Manifest.lock +3 -3
- package/ios/Pods/Pods.xcodeproj/project.pbxproj +395 -395
- package/ios/Pods/Pods.xcodeproj/xcuserdata/Adi.xcuserdatad/xcschemes/Pods-AppIceReactPlugin.xcscheme +58 -58
- package/ios/Pods/Pods.xcodeproj/xcuserdata/Adi.xcuserdatad/xcschemes/xcschememanagement.plist +18 -18
- package/ios/Pods/Pods.xcodeproj/xcuserdata/artherajesh.xcuserdatad/xcschemes/xcschememanagement.plist +14 -14
- package/ios/Pods/Target Support Files/Pods-AppIceReactPlugin/Pods-AppIceReactPlugin-Info.plist +26 -26
- package/ios/Pods/Target Support Files/Pods-AppIceReactPlugin/Pods-AppIceReactPlugin-acknowledgements.markdown +3 -3
- package/ios/Pods/Target Support Files/Pods-AppIceReactPlugin/Pods-AppIceReactPlugin-acknowledgements.plist +29 -29
- package/ios/Pods/Target Support Files/Pods-AppIceReactPlugin/Pods-AppIceReactPlugin-dummy.m +5 -5
- package/ios/Pods/Target Support Files/Pods-AppIceReactPlugin/Pods-AppIceReactPlugin-umbrella.h +16 -16
- package/ios/Pods/Target Support Files/Pods-AppIceReactPlugin/Pods-AppIceReactPlugin.debug.xcconfig +6 -6
- package/ios/Pods/Target Support Files/Pods-AppIceReactPlugin/Pods-AppIceReactPlugin.modulemap +6 -6
- package/ios/Pods/Target Support Files/Pods-AppIceReactPlugin/Pods-AppIceReactPlugin.release.xcconfig +6 -6
- package/package.json +6 -9
- package/reactnative-plugin-appice.podspec +30 -30
package/example/ios/_xcode.env
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
# This `.xcode.env` file is versioned and is used to source the environment
|
|
2
|
-
# used when running script phases inside Xcode.
|
|
3
|
-
# To customize your local environment, you can create an `.xcode.env.local`
|
|
4
|
-
# file that is not versioned.
|
|
5
|
-
|
|
6
|
-
# NODE_BINARY variable contains the PATH to the node executable.
|
|
7
|
-
#
|
|
8
|
-
# Customize the NODE_BINARY variable here.
|
|
9
|
-
# For example, to use nvm with brew, add the following line
|
|
10
|
-
# . "$(brew --prefix nvm)/nvm.sh" --no-use
|
|
11
|
-
export NODE_BINARY=$(command -v node)
|
|
1
|
+
# This `.xcode.env` file is versioned and is used to source the environment
|
|
2
|
+
# used when running script phases inside Xcode.
|
|
3
|
+
# To customize your local environment, you can create an `.xcode.env.local`
|
|
4
|
+
# file that is not versioned.
|
|
5
|
+
|
|
6
|
+
# NODE_BINARY variable contains the PATH to the node executable.
|
|
7
|
+
#
|
|
8
|
+
# Customize the NODE_BINARY variable here.
|
|
9
|
+
# For example, to use nvm with brew, add the following line
|
|
10
|
+
# . "$(brew --prefix nvm)/nvm.sh" --no-use
|
|
11
|
+
export NODE_BINARY=$(command -v node)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
#import <React/RCTBridgeDelegate.h>
|
|
2
|
-
#import <UIKit/UIKit.h>
|
|
3
|
-
#import <UserNotifications/UserNotifications.h>
|
|
4
|
-
@interface AppDelegate : UIResponder <UIApplicationDelegate, RCTBridgeDelegate,UNUserNotificationCenterDelegate>
|
|
5
|
-
|
|
6
|
-
@property (nonatomic, strong) UIWindow *window;
|
|
7
|
-
|
|
8
|
-
@end
|
|
1
|
+
#import <React/RCTBridgeDelegate.h>
|
|
2
|
+
#import <UIKit/UIKit.h>
|
|
3
|
+
#import <UserNotifications/UserNotifications.h>
|
|
4
|
+
@interface AppDelegate : UIResponder <UIApplicationDelegate, RCTBridgeDelegate,UNUserNotificationCenterDelegate>
|
|
5
|
+
|
|
6
|
+
@property (nonatomic, strong) UIWindow *window;
|
|
7
|
+
|
|
8
|
+
@end
|
|
@@ -1,174 +1,174 @@
|
|
|
1
|
-
#import "AppDelegate.h"
|
|
2
|
-
|
|
3
|
-
#import <React/RCTBridge.h>
|
|
4
|
-
#import <React/RCTBundleURLProvider.h>
|
|
5
|
-
#import <React/RCTRootView.h>
|
|
6
|
-
#import "AppIceReactPlugin.h"
|
|
7
|
-
#import "AppICEReactEvent.h"
|
|
8
|
-
#import <React/RCTAppSetupUtils.h>
|
|
9
|
-
|
|
10
|
-
#if RCT_NEW_ARCH_ENABLED
|
|
11
|
-
#import <React/CoreModulesPlugins.h>
|
|
12
|
-
#import <React/RCTCxxBridgeDelegate.h>
|
|
13
|
-
#import <React/RCTFabricSurfaceHostingProxyRootView.h>
|
|
14
|
-
#import <React/RCTSurfacePresenter.h>
|
|
15
|
-
#import <React/RCTSurfacePresenterBridgeAdapter.h>
|
|
16
|
-
#import <ReactCommon/RCTTurboModuleManager.h>
|
|
17
|
-
|
|
18
|
-
#import <react/config/ReactNativeConfig.h>
|
|
19
|
-
|
|
20
|
-
static NSString *const kRNConcurrentRoot = @"concurrentRoot";
|
|
21
|
-
|
|
22
|
-
@interface AppDelegate () <RCTCxxBridgeDelegate, RCTTurboModuleManagerDelegate> {
|
|
23
|
-
RCTTurboModuleManager *_turboModuleManager;
|
|
24
|
-
RCTSurfacePresenterBridgeAdapter *_bridgeAdapter;
|
|
25
|
-
std::shared_ptr<const facebook::react::ReactNativeConfig> _reactNativeConfig;
|
|
26
|
-
facebook::react::ContextContainer::Shared _contextContainer;
|
|
27
|
-
}
|
|
28
|
-
@end
|
|
29
|
-
#endif
|
|
30
|
-
|
|
31
|
-
@implementation AppDelegate
|
|
32
|
-
|
|
33
|
-
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
|
34
|
-
{
|
|
35
|
-
RCTAppSetupPrepareApp(application);
|
|
36
|
-
|
|
37
|
-
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
|
|
38
|
-
|
|
39
|
-
#if RCT_NEW_ARCH_ENABLED
|
|
40
|
-
_contextContainer = std::make_shared<facebook::react::ContextContainer const>();
|
|
41
|
-
_reactNativeConfig = std::make_shared<facebook::react::EmptyReactNativeConfig const>();
|
|
42
|
-
_contextContainer->insert("ReactNativeConfig", _reactNativeConfig);
|
|
43
|
-
_bridgeAdapter = [[RCTSurfacePresenterBridgeAdapter alloc] initWithBridge:bridge contextContainer:_contextContainer];
|
|
44
|
-
bridge.surfacePresenter = _bridgeAdapter.surfacePresenter;
|
|
45
|
-
#endif
|
|
46
|
-
|
|
47
|
-
NSDictionary *initProps = [self prepareInitialProps];
|
|
48
|
-
UIView *rootView = RCTAppSetupDefaultRootView(bridge, @"example", initProps);
|
|
49
|
-
|
|
50
|
-
if (@available(iOS 13.0, *)) {
|
|
51
|
-
rootView.backgroundColor = [UIColor systemBackgroundColor];
|
|
52
|
-
} else {
|
|
53
|
-
rootView.backgroundColor = [UIColor whiteColor];
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
|
|
57
|
-
UIViewController *rootViewController = [UIViewController new];
|
|
58
|
-
rootViewController.view = rootView;
|
|
59
|
-
self.window.rootViewController = rootViewController;
|
|
60
|
-
[self.window makeKeyAndVisible];
|
|
61
|
-
|
|
62
|
-
// Define UNUserNotificationCenter
|
|
63
|
-
UNUserNotificationCenter *center =
|
|
64
|
-
[UNUserNotificationCenter currentNotificationCenter];
|
|
65
|
-
center.delegate = self;
|
|
66
|
-
|
|
67
|
-
return YES;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/// This method controls whether the `concurrentRoot`feature of React18 is turned on or off.
|
|
71
|
-
///
|
|
72
|
-
/// @see: https://reactjs.org/blog/2022/03/29/react-v18.html
|
|
73
|
-
/// @note: This requires to be rendering on Fabric (i.e. on the New Architecture).
|
|
74
|
-
/// @return: `true` if the `concurrentRoot` feture is enabled. Otherwise, it returns `false`.
|
|
75
|
-
- (BOOL)concurrentRootEnabled
|
|
76
|
-
{
|
|
77
|
-
// Switch this bool to turn on and off the concurrent root
|
|
78
|
-
return true;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
- (NSDictionary *)prepareInitialProps
|
|
82
|
-
{
|
|
83
|
-
NSMutableDictionary *initProps = [NSMutableDictionary new];
|
|
84
|
-
|
|
85
|
-
#ifdef RCT_NEW_ARCH_ENABLED
|
|
86
|
-
initProps[kRNConcurrentRoot] = @([self concurrentRootEnabled]);
|
|
87
|
-
#endif
|
|
88
|
-
|
|
89
|
-
return initProps;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
|
|
93
|
-
{
|
|
94
|
-
#if DEBUG
|
|
95
|
-
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
|
|
96
|
-
#else
|
|
97
|
-
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
|
|
98
|
-
#endif
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
#if RCT_NEW_ARCH_ENABLED
|
|
102
|
-
|
|
103
|
-
#pragma mark - RCTCxxBridgeDelegate
|
|
104
|
-
|
|
105
|
-
- (std::unique_ptr<facebook::react::JSExecutorFactory>)jsExecutorFactoryForBridge:(RCTBridge *)bridge
|
|
106
|
-
{
|
|
107
|
-
_turboModuleManager = [[RCTTurboModuleManager alloc] initWithBridge:bridge
|
|
108
|
-
delegate:self
|
|
109
|
-
jsInvoker:bridge.jsCallInvoker];
|
|
110
|
-
return RCTAppSetupDefaultJsExecutorFactory(bridge, _turboModuleManager);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
#pragma mark RCTTurboModuleManagerDelegate
|
|
114
|
-
|
|
115
|
-
- (Class)getModuleClassFromName:(const char *)name
|
|
116
|
-
{
|
|
117
|
-
return RCTCoreModulesClassProvider(name);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:(const std::string &)name
|
|
121
|
-
jsInvoker:(std::shared_ptr<facebook::react::CallInvoker>)jsInvoker
|
|
122
|
-
{
|
|
123
|
-
return nullptr;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:(const std::string &)name
|
|
127
|
-
initParams:
|
|
128
|
-
(const facebook::react::ObjCTurboModule::InitParams &)params
|
|
129
|
-
{
|
|
130
|
-
return nullptr;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
- (id<RCTTurboModule>)getModuleInstanceFromClass:(Class)moduleClass
|
|
134
|
-
{
|
|
135
|
-
return RCTAppSetupDefaultModuleFromClass(moduleClass);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
#endif
|
|
139
|
-
|
|
140
|
-
- (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
|
|
141
|
-
{
|
|
142
|
-
NSLog(@"token is : %@",deviceToken);
|
|
143
|
-
[AppIceReactPlugin didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
|
|
144
|
-
}
|
|
145
|
-
- (void)application:(UIApplication*)application didFailToRegisterForRemoteNotificationsWithError:(NSError*)error
|
|
146
|
-
{
|
|
147
|
-
NSLog(@"%@ = %@", NSStringFromSelector(_cmd), error);
|
|
148
|
-
NSLog(@"Failed to get token, Error: %@", error);
|
|
149
|
-
}
|
|
150
|
-
-(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler{
|
|
151
|
-
NSLog(@"received payload =%@",userInfo);
|
|
152
|
-
[AppIceReactPlugin pushNotificationReceived:userInfo];
|
|
153
|
-
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
- (void)userNotificationCenter:(UNUserNotificationCenter *)center
|
|
157
|
-
didReceiveNotificationResponse:(UNNotificationResponse *)response
|
|
158
|
-
withCompletionHandler:(void (^)(void))completionHandler {
|
|
159
|
-
|
|
160
|
-
[AppIceReactPlugin pushNotificationClicked:response.notification.request.content.userInfo];
|
|
161
|
-
|
|
162
|
-
completionHandler();
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
// Called when a notification is delivered to a foreground app.
|
|
166
|
-
- (void)userNotificationCenter:(UNUserNotificationCenter *)center
|
|
167
|
-
willPresentNotification:(UNNotification *)notification
|
|
168
|
-
withCompletionHandler:
|
|
169
|
-
(void (^)(UNNotificationPresentationOptions options))
|
|
170
|
-
completionHandler {
|
|
171
|
-
completionHandler(UNNotificationPresentationOptionSound | UNNotificationPresentationOptionBadge |
|
|
172
|
-
UNNotificationPresentationOptionAlert);
|
|
173
|
-
}
|
|
174
|
-
@end
|
|
1
|
+
#import "AppDelegate.h"
|
|
2
|
+
|
|
3
|
+
#import <React/RCTBridge.h>
|
|
4
|
+
#import <React/RCTBundleURLProvider.h>
|
|
5
|
+
#import <React/RCTRootView.h>
|
|
6
|
+
#import "AppIceReactPlugin.h"
|
|
7
|
+
#import "AppICEReactEvent.h"
|
|
8
|
+
#import <React/RCTAppSetupUtils.h>
|
|
9
|
+
|
|
10
|
+
#if RCT_NEW_ARCH_ENABLED
|
|
11
|
+
#import <React/CoreModulesPlugins.h>
|
|
12
|
+
#import <React/RCTCxxBridgeDelegate.h>
|
|
13
|
+
#import <React/RCTFabricSurfaceHostingProxyRootView.h>
|
|
14
|
+
#import <React/RCTSurfacePresenter.h>
|
|
15
|
+
#import <React/RCTSurfacePresenterBridgeAdapter.h>
|
|
16
|
+
#import <ReactCommon/RCTTurboModuleManager.h>
|
|
17
|
+
|
|
18
|
+
#import <react/config/ReactNativeConfig.h>
|
|
19
|
+
|
|
20
|
+
static NSString *const kRNConcurrentRoot = @"concurrentRoot";
|
|
21
|
+
|
|
22
|
+
@interface AppDelegate () <RCTCxxBridgeDelegate, RCTTurboModuleManagerDelegate> {
|
|
23
|
+
RCTTurboModuleManager *_turboModuleManager;
|
|
24
|
+
RCTSurfacePresenterBridgeAdapter *_bridgeAdapter;
|
|
25
|
+
std::shared_ptr<const facebook::react::ReactNativeConfig> _reactNativeConfig;
|
|
26
|
+
facebook::react::ContextContainer::Shared _contextContainer;
|
|
27
|
+
}
|
|
28
|
+
@end
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
@implementation AppDelegate
|
|
32
|
+
|
|
33
|
+
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
|
34
|
+
{
|
|
35
|
+
RCTAppSetupPrepareApp(application);
|
|
36
|
+
|
|
37
|
+
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
|
|
38
|
+
|
|
39
|
+
#if RCT_NEW_ARCH_ENABLED
|
|
40
|
+
_contextContainer = std::make_shared<facebook::react::ContextContainer const>();
|
|
41
|
+
_reactNativeConfig = std::make_shared<facebook::react::EmptyReactNativeConfig const>();
|
|
42
|
+
_contextContainer->insert("ReactNativeConfig", _reactNativeConfig);
|
|
43
|
+
_bridgeAdapter = [[RCTSurfacePresenterBridgeAdapter alloc] initWithBridge:bridge contextContainer:_contextContainer];
|
|
44
|
+
bridge.surfacePresenter = _bridgeAdapter.surfacePresenter;
|
|
45
|
+
#endif
|
|
46
|
+
|
|
47
|
+
NSDictionary *initProps = [self prepareInitialProps];
|
|
48
|
+
UIView *rootView = RCTAppSetupDefaultRootView(bridge, @"example", initProps);
|
|
49
|
+
|
|
50
|
+
if (@available(iOS 13.0, *)) {
|
|
51
|
+
rootView.backgroundColor = [UIColor systemBackgroundColor];
|
|
52
|
+
} else {
|
|
53
|
+
rootView.backgroundColor = [UIColor whiteColor];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
|
|
57
|
+
UIViewController *rootViewController = [UIViewController new];
|
|
58
|
+
rootViewController.view = rootView;
|
|
59
|
+
self.window.rootViewController = rootViewController;
|
|
60
|
+
[self.window makeKeyAndVisible];
|
|
61
|
+
|
|
62
|
+
// Define UNUserNotificationCenter
|
|
63
|
+
UNUserNotificationCenter *center =
|
|
64
|
+
[UNUserNotificationCenter currentNotificationCenter];
|
|
65
|
+
center.delegate = self;
|
|
66
|
+
|
|
67
|
+
return YES;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/// This method controls whether the `concurrentRoot`feature of React18 is turned on or off.
|
|
71
|
+
///
|
|
72
|
+
/// @see: https://reactjs.org/blog/2022/03/29/react-v18.html
|
|
73
|
+
/// @note: This requires to be rendering on Fabric (i.e. on the New Architecture).
|
|
74
|
+
/// @return: `true` if the `concurrentRoot` feture is enabled. Otherwise, it returns `false`.
|
|
75
|
+
- (BOOL)concurrentRootEnabled
|
|
76
|
+
{
|
|
77
|
+
// Switch this bool to turn on and off the concurrent root
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
- (NSDictionary *)prepareInitialProps
|
|
82
|
+
{
|
|
83
|
+
NSMutableDictionary *initProps = [NSMutableDictionary new];
|
|
84
|
+
|
|
85
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
86
|
+
initProps[kRNConcurrentRoot] = @([self concurrentRootEnabled]);
|
|
87
|
+
#endif
|
|
88
|
+
|
|
89
|
+
return initProps;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
|
|
93
|
+
{
|
|
94
|
+
#if DEBUG
|
|
95
|
+
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
|
|
96
|
+
#else
|
|
97
|
+
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
|
|
98
|
+
#endif
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
#if RCT_NEW_ARCH_ENABLED
|
|
102
|
+
|
|
103
|
+
#pragma mark - RCTCxxBridgeDelegate
|
|
104
|
+
|
|
105
|
+
- (std::unique_ptr<facebook::react::JSExecutorFactory>)jsExecutorFactoryForBridge:(RCTBridge *)bridge
|
|
106
|
+
{
|
|
107
|
+
_turboModuleManager = [[RCTTurboModuleManager alloc] initWithBridge:bridge
|
|
108
|
+
delegate:self
|
|
109
|
+
jsInvoker:bridge.jsCallInvoker];
|
|
110
|
+
return RCTAppSetupDefaultJsExecutorFactory(bridge, _turboModuleManager);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
#pragma mark RCTTurboModuleManagerDelegate
|
|
114
|
+
|
|
115
|
+
- (Class)getModuleClassFromName:(const char *)name
|
|
116
|
+
{
|
|
117
|
+
return RCTCoreModulesClassProvider(name);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:(const std::string &)name
|
|
121
|
+
jsInvoker:(std::shared_ptr<facebook::react::CallInvoker>)jsInvoker
|
|
122
|
+
{
|
|
123
|
+
return nullptr;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:(const std::string &)name
|
|
127
|
+
initParams:
|
|
128
|
+
(const facebook::react::ObjCTurboModule::InitParams &)params
|
|
129
|
+
{
|
|
130
|
+
return nullptr;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
- (id<RCTTurboModule>)getModuleInstanceFromClass:(Class)moduleClass
|
|
134
|
+
{
|
|
135
|
+
return RCTAppSetupDefaultModuleFromClass(moduleClass);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
#endif
|
|
139
|
+
|
|
140
|
+
- (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
|
|
141
|
+
{
|
|
142
|
+
NSLog(@"token is : %@",deviceToken);
|
|
143
|
+
[AppIceReactPlugin didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
|
|
144
|
+
}
|
|
145
|
+
- (void)application:(UIApplication*)application didFailToRegisterForRemoteNotificationsWithError:(NSError*)error
|
|
146
|
+
{
|
|
147
|
+
NSLog(@"%@ = %@", NSStringFromSelector(_cmd), error);
|
|
148
|
+
NSLog(@"Failed to get token, Error: %@", error);
|
|
149
|
+
}
|
|
150
|
+
-(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler{
|
|
151
|
+
NSLog(@"received payload =%@",userInfo);
|
|
152
|
+
[AppIceReactPlugin pushNotificationReceived:userInfo];
|
|
153
|
+
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
- (void)userNotificationCenter:(UNUserNotificationCenter *)center
|
|
157
|
+
didReceiveNotificationResponse:(UNNotificationResponse *)response
|
|
158
|
+
withCompletionHandler:(void (^)(void))completionHandler {
|
|
159
|
+
|
|
160
|
+
[AppIceReactPlugin pushNotificationClicked:response.notification.request.content.userInfo];
|
|
161
|
+
|
|
162
|
+
completionHandler();
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// Called when a notification is delivered to a foreground app.
|
|
166
|
+
- (void)userNotificationCenter:(UNUserNotificationCenter *)center
|
|
167
|
+
willPresentNotification:(UNNotification *)notification
|
|
168
|
+
withCompletionHandler:
|
|
169
|
+
(void (^)(UNNotificationPresentationOptions options))
|
|
170
|
+
completionHandler {
|
|
171
|
+
completionHandler(UNNotificationPresentationOptionSound | UNNotificationPresentationOptionBadge |
|
|
172
|
+
UNNotificationPresentationOptionAlert);
|
|
173
|
+
}
|
|
174
|
+
@end
|
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
{
|
|
2
|
-
"images" : [
|
|
3
|
-
{
|
|
4
|
-
"idiom" : "iphone",
|
|
5
|
-
"scale" : "2x",
|
|
6
|
-
"size" : "20x20"
|
|
7
|
-
},
|
|
8
|
-
{
|
|
9
|
-
"idiom" : "iphone",
|
|
10
|
-
"scale" : "3x",
|
|
11
|
-
"size" : "20x20"
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
"idiom" : "iphone",
|
|
15
|
-
"scale" : "2x",
|
|
16
|
-
"size" : "29x29"
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"idiom" : "iphone",
|
|
20
|
-
"scale" : "3x",
|
|
21
|
-
"size" : "29x29"
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
"idiom" : "iphone",
|
|
25
|
-
"scale" : "2x",
|
|
26
|
-
"size" : "40x40"
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
"idiom" : "iphone",
|
|
30
|
-
"scale" : "3x",
|
|
31
|
-
"size" : "40x40"
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
"idiom" : "iphone",
|
|
35
|
-
"scale" : "2x",
|
|
36
|
-
"size" : "60x60"
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
"idiom" : "iphone",
|
|
40
|
-
"scale" : "3x",
|
|
41
|
-
"size" : "60x60"
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
"idiom" : "ios-marketing",
|
|
45
|
-
"scale" : "1x",
|
|
46
|
-
"size" : "1024x1024"
|
|
47
|
-
}
|
|
48
|
-
],
|
|
49
|
-
"info" : {
|
|
50
|
-
"author" : "xcode",
|
|
51
|
-
"version" : 1
|
|
52
|
-
}
|
|
53
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"images" : [
|
|
3
|
+
{
|
|
4
|
+
"idiom" : "iphone",
|
|
5
|
+
"scale" : "2x",
|
|
6
|
+
"size" : "20x20"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"idiom" : "iphone",
|
|
10
|
+
"scale" : "3x",
|
|
11
|
+
"size" : "20x20"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"idiom" : "iphone",
|
|
15
|
+
"scale" : "2x",
|
|
16
|
+
"size" : "29x29"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"idiom" : "iphone",
|
|
20
|
+
"scale" : "3x",
|
|
21
|
+
"size" : "29x29"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"idiom" : "iphone",
|
|
25
|
+
"scale" : "2x",
|
|
26
|
+
"size" : "40x40"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"idiom" : "iphone",
|
|
30
|
+
"scale" : "3x",
|
|
31
|
+
"size" : "40x40"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"idiom" : "iphone",
|
|
35
|
+
"scale" : "2x",
|
|
36
|
+
"size" : "60x60"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"idiom" : "iphone",
|
|
40
|
+
"scale" : "3x",
|
|
41
|
+
"size" : "60x60"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"idiom" : "ios-marketing",
|
|
45
|
+
"scale" : "1x",
|
|
46
|
+
"size" : "1024x1024"
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"info" : {
|
|
50
|
+
"author" : "xcode",
|
|
51
|
+
"version" : 1
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
{
|
|
2
|
-
"info" : {
|
|
3
|
-
"version" : 1,
|
|
4
|
-
"author" : "xcode"
|
|
5
|
-
}
|
|
6
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"info" : {
|
|
3
|
+
"version" : 1,
|
|
4
|
+
"author" : "xcode"
|
|
5
|
+
}
|
|
6
|
+
}
|
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
-
<plist version="1.0">
|
|
4
|
-
<dict>
|
|
5
|
-
<key>CFBundleDevelopmentRegion</key>
|
|
6
|
-
<string>en</string>
|
|
7
|
-
<key>CFBundleDisplayName</key>
|
|
8
|
-
<string>example</string>
|
|
9
|
-
<key>CFBundleExecutable</key>
|
|
10
|
-
<string>$(EXECUTABLE_NAME)</string>
|
|
11
|
-
<key>CFBundleIdentifier</key>
|
|
12
|
-
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
|
13
|
-
<key>CFBundleInfoDictionaryVersion</key>
|
|
14
|
-
<string>6.0</string>
|
|
15
|
-
<key>CFBundleName</key>
|
|
16
|
-
<string>$(PRODUCT_NAME)</string>
|
|
17
|
-
<key>CFBundlePackageType</key>
|
|
18
|
-
<string>APPL</string>
|
|
19
|
-
<key>CFBundleShortVersionString</key>
|
|
20
|
-
<string>1.0</string>
|
|
21
|
-
<key>CFBundleSignature</key>
|
|
22
|
-
<string>????</string>
|
|
23
|
-
<key>CFBundleVersion</key>
|
|
24
|
-
<string>1</string>
|
|
25
|
-
<key>LSRequiresIPhoneOS</key>
|
|
26
|
-
<true/>
|
|
27
|
-
<key>NSAppTransportSecurity</key>
|
|
28
|
-
<dict>
|
|
29
|
-
<key>NSExceptionDomains</key>
|
|
30
|
-
<dict>
|
|
31
|
-
<key>localhost</key>
|
|
32
|
-
<dict>
|
|
33
|
-
<key>NSExceptionAllowsInsecureHTTPLoads</key>
|
|
34
|
-
<true/>
|
|
35
|
-
</dict>
|
|
36
|
-
</dict>
|
|
37
|
-
</dict>
|
|
38
|
-
<key>NSLocationWhenInUseUsageDescription</key>
|
|
39
|
-
<string></string>
|
|
40
|
-
<key>UIBackgroundModes</key>
|
|
41
|
-
<array>
|
|
42
|
-
<string>fetch</string>
|
|
43
|
-
<string>location</string>
|
|
44
|
-
<string>processing</string>
|
|
45
|
-
<string>remote-notification</string>
|
|
46
|
-
</array>
|
|
47
|
-
<key>UILaunchStoryboardName</key>
|
|
48
|
-
<string>LaunchScreen</string>
|
|
49
|
-
<key>UIRequiredDeviceCapabilities</key>
|
|
50
|
-
<array>
|
|
51
|
-
<string>armv7</string>
|
|
52
|
-
</array>
|
|
53
|
-
<key>UISupportedInterfaceOrientations</key>
|
|
54
|
-
<array>
|
|
55
|
-
<string>UIInterfaceOrientationPortrait</string>
|
|
56
|
-
<string>UIInterfaceOrientationLandscapeLeft</string>
|
|
57
|
-
<string>UIInterfaceOrientationLandscapeRight</string>
|
|
58
|
-
</array>
|
|
59
|
-
<key>UIViewControllerBasedStatusBarAppearance</key>
|
|
60
|
-
<false/>
|
|
61
|
-
</dict>
|
|
62
|
-
</plist>
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>CFBundleDevelopmentRegion</key>
|
|
6
|
+
<string>en</string>
|
|
7
|
+
<key>CFBundleDisplayName</key>
|
|
8
|
+
<string>example</string>
|
|
9
|
+
<key>CFBundleExecutable</key>
|
|
10
|
+
<string>$(EXECUTABLE_NAME)</string>
|
|
11
|
+
<key>CFBundleIdentifier</key>
|
|
12
|
+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
|
13
|
+
<key>CFBundleInfoDictionaryVersion</key>
|
|
14
|
+
<string>6.0</string>
|
|
15
|
+
<key>CFBundleName</key>
|
|
16
|
+
<string>$(PRODUCT_NAME)</string>
|
|
17
|
+
<key>CFBundlePackageType</key>
|
|
18
|
+
<string>APPL</string>
|
|
19
|
+
<key>CFBundleShortVersionString</key>
|
|
20
|
+
<string>1.0</string>
|
|
21
|
+
<key>CFBundleSignature</key>
|
|
22
|
+
<string>????</string>
|
|
23
|
+
<key>CFBundleVersion</key>
|
|
24
|
+
<string>1</string>
|
|
25
|
+
<key>LSRequiresIPhoneOS</key>
|
|
26
|
+
<true/>
|
|
27
|
+
<key>NSAppTransportSecurity</key>
|
|
28
|
+
<dict>
|
|
29
|
+
<key>NSExceptionDomains</key>
|
|
30
|
+
<dict>
|
|
31
|
+
<key>localhost</key>
|
|
32
|
+
<dict>
|
|
33
|
+
<key>NSExceptionAllowsInsecureHTTPLoads</key>
|
|
34
|
+
<true/>
|
|
35
|
+
</dict>
|
|
36
|
+
</dict>
|
|
37
|
+
</dict>
|
|
38
|
+
<key>NSLocationWhenInUseUsageDescription</key>
|
|
39
|
+
<string></string>
|
|
40
|
+
<key>UIBackgroundModes</key>
|
|
41
|
+
<array>
|
|
42
|
+
<string>fetch</string>
|
|
43
|
+
<string>location</string>
|
|
44
|
+
<string>processing</string>
|
|
45
|
+
<string>remote-notification</string>
|
|
46
|
+
</array>
|
|
47
|
+
<key>UILaunchStoryboardName</key>
|
|
48
|
+
<string>LaunchScreen</string>
|
|
49
|
+
<key>UIRequiredDeviceCapabilities</key>
|
|
50
|
+
<array>
|
|
51
|
+
<string>armv7</string>
|
|
52
|
+
</array>
|
|
53
|
+
<key>UISupportedInterfaceOrientations</key>
|
|
54
|
+
<array>
|
|
55
|
+
<string>UIInterfaceOrientationPortrait</string>
|
|
56
|
+
<string>UIInterfaceOrientationLandscapeLeft</string>
|
|
57
|
+
<string>UIInterfaceOrientationLandscapeRight</string>
|
|
58
|
+
</array>
|
|
59
|
+
<key>UIViewControllerBasedStatusBarAppearance</key>
|
|
60
|
+
<false/>
|
|
61
|
+
</dict>
|
|
62
|
+
</plist>
|