reactnative-plugin-appice 1.6.0 → 1.6.2

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.
Files changed (124) hide show
  1. package/README.md +37 -37
  2. package/android/README.md +14 -14
  3. package/android/android.iml +150 -150
  4. package/android/build.gradle +152 -152
  5. package/android/gitignore +47 -47
  6. package/android/src/main/AndroidManifest.xml +234 -234
  7. package/android/src/main/java/com/reactlibrary/AppICEUtils.java +38 -38
  8. package/android/src/main/java/com/reactlibrary/AppIceReactPluginModule.java +503 -473
  9. package/android/src/main/java/com/reactlibrary/AppIceReactPluginPackage.java +28 -28
  10. package/android/src/main/java/com/reactlibrary/CampaignCampsReceiver.java +73 -73
  11. package/android/src/main/java/com/reactlibrary/InAppWebView.java +67 -67
  12. package/android/src/main/java/com/reactlibrary/NotificationEventService.java +62 -62
  13. package/example/App.js +148 -148
  14. package/example/Gemfile +6 -6
  15. package/example/__tests__/App-test.js +14 -14
  16. package/example/android/app/_BUCK +55 -55
  17. package/example/android/app/build.gradle +320 -320
  18. package/example/android/app/build_defs.bzl +19 -19
  19. package/example/android/app/proguard-rules.pro +10 -10
  20. package/example/android/app/src/debug/AndroidManifest.xml +13 -13
  21. package/example/android/app/src/debug/java/com/example/ReactNativeFlipper.java +73 -73
  22. package/example/android/app/src/main/AndroidManifest.xml +72 -72
  23. package/example/android/app/src/main/java/com/example/MainActivity.java +48 -48
  24. package/example/android/app/src/main/java/com/example/MainApplication.java +91 -91
  25. package/example/android/app/src/main/java/com/example/newarchitecture/MainApplicationReactNativeHost.java +116 -116
  26. package/example/android/app/src/main/java/com/example/newarchitecture/components/MainComponentsRegistry.java +36 -36
  27. package/example/android/app/src/main/java/com/example/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java +48 -48
  28. package/example/android/app/src/main/jni/Android.mk +48 -48
  29. package/example/android/app/src/main/jni/MainApplicationModuleProvider.cpp +24 -24
  30. package/example/android/app/src/main/jni/MainApplicationModuleProvider.h +16 -16
  31. package/example/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp +45 -45
  32. package/example/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h +38 -38
  33. package/example/android/app/src/main/jni/MainComponentsRegistry.cpp +61 -61
  34. package/example/android/app/src/main/jni/MainComponentsRegistry.h +32 -32
  35. package/example/android/app/src/main/jni/OnLoad.cpp +11 -11
  36. package/example/android/app/src/main/res/drawable/rn_edit_text_material.xml +36 -36
  37. package/example/android/app/src/main/res/values/strings.xml +3 -3
  38. package/example/android/app/src/main/res/values/styles.xml +9 -9
  39. package/example/android/build.gradle +53 -53
  40. package/example/android/gradle/wrapper/gradle-wrapper.properties +5 -5
  41. package/example/android/gradle.properties +40 -40
  42. package/example/android/gradlew +234 -234
  43. package/example/android/settings.gradle +11 -11
  44. package/example/app.json +3 -3
  45. package/example/babel.config.js +3 -3
  46. package/example/index.js +9 -9
  47. package/example/ios/Podfile +44 -44
  48. package/example/ios/Podfile.lock +561 -561
  49. package/example/ios/_xcode.env +11 -11
  50. package/example/ios/example/AppDelegate.h +8 -8
  51. package/example/ios/example/AppDelegate.mm +174 -174
  52. package/example/ios/example/Images.xcassets/AppIcon.appiconset/Contents.json +53 -53
  53. package/example/ios/example/Images.xcassets/Contents.json +6 -6
  54. package/example/ios/example/Info.plist +62 -62
  55. package/example/ios/example/LaunchScreen.storyboard +47 -47
  56. package/example/ios/example/example.entitlements +8 -8
  57. package/example/ios/example/main.m +10 -10
  58. package/example/ios/example.xcodeproj/project.pbxproj +712 -712
  59. package/example/ios/example.xcodeproj/xcshareddata/xcschemes/example.xcscheme +88 -88
  60. package/example/ios/example.xcworkspace/contents.xcworkspacedata +10 -10
  61. package/example/ios/example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -8
  62. package/example/ios/exampleTests/Info.plist +24 -24
  63. package/example/ios/exampleTests/exampleTests.m +66 -66
  64. package/example/metro.config.js +17 -17
  65. package/example/package.json +34 -34
  66. package/index.js +181 -124
  67. package/ios/AppICEReactEvent.h +23 -23
  68. package/ios/AppICEReactEvent.m +86 -77
  69. package/ios/AppIceReactPlugin.h +22 -22
  70. package/ios/AppIceReactPlugin.m +214 -191
  71. package/ios/AppIceReactPlugin.xcodeproj/project.pbxproj +364 -434
  72. package/ios/AppIceReactPlugin.xcodeproj/project.xcworkspace/contents.xcworkspacedata +4 -4
  73. package/ios/AppIceReactPlugin.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -8
  74. package/ios/AppIceReactPlugin.xcodeproj/xcuserdata/Adi.xcuserdatad/xcschemes/xcschememanagement.plist +14 -14
  75. package/ios/AppIceReactPlugin.xcodeproj/xcuserdata/user214879.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
  76. package/ios/AppIceReactPlugin.xcworkspace/contents.xcworkspacedata +10 -10
  77. package/ios/AppIceReactPlugin.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -8
  78. package/ios/AppIceReactPlugin.xcworkspace/xcuserdata/user214879.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  79. package/ios/Podfile +10 -10
  80. package/ios/Podfile.lock +3 -3
  81. package/ios/Pods/Manifest.lock +3 -3
  82. package/ios/Pods/Pods.xcodeproj/project.pbxproj +395 -395
  83. package/ios/Pods/Pods.xcodeproj/xcuserdata/Adi.xcuserdatad/xcschemes/Pods-AppIceReactPlugin.xcscheme +58 -58
  84. package/ios/Pods/Pods.xcodeproj/xcuserdata/Adi.xcuserdatad/xcschemes/xcschememanagement.plist +18 -18
  85. package/ios/Pods/Pods.xcodeproj/xcuserdata/user214879.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
  86. package/ios/Pods/Target Support Files/Pods-AppIceReactPlugin/Pods-AppIceReactPlugin-Info.plist +26 -26
  87. package/ios/Pods/Target Support Files/Pods-AppIceReactPlugin/Pods-AppIceReactPlugin-acknowledgements.markdown +3 -3
  88. package/ios/Pods/Target Support Files/Pods-AppIceReactPlugin/Pods-AppIceReactPlugin-acknowledgements.plist +29 -29
  89. package/ios/Pods/Target Support Files/Pods-AppIceReactPlugin/Pods-AppIceReactPlugin-dummy.m +5 -5
  90. package/ios/Pods/Target Support Files/Pods-AppIceReactPlugin/Pods-AppIceReactPlugin-umbrella.h +16 -16
  91. package/ios/Pods/Target Support Files/Pods-AppIceReactPlugin/Pods-AppIceReactPlugin.debug.xcconfig +6 -6
  92. package/ios/Pods/Target Support Files/Pods-AppIceReactPlugin/Pods-AppIceReactPlugin.modulemap +6 -6
  93. package/ios/Pods/Target Support Files/Pods-AppIceReactPlugin/Pods-AppIceReactPlugin.release.xcconfig +6 -6
  94. package/package.json +40 -40
  95. package/reactnative-plugin-appice.podspec +30 -30
  96. package/ios/AppICESDK/appICE.momd/VersionInfo.plist +0 -0
  97. package/ios/AppICESDK/appICE.momd/appICE 2.mom +0 -0
  98. package/ios/AppICESDK/appICE.momd/appICE 3.mom +0 -0
  99. package/ios/AppICESDK/appICE.momd/appICE 4.mom +0 -0
  100. package/ios/AppICESDK/appICE.momd/appICE 4.omo +0 -0
  101. package/ios/AppICESDK/appICE.momd/appICE.mom +0 -0
  102. package/ios/AppICESDK/appICE.momd/appICE2.mom +0 -0
  103. package/ios/AppICESDK/appICEBundle.bundle/APPChildViewController.nib +0 -0
  104. package/ios/AppICESDK/appICEBundle.bundle/AppICE_btn.png +0 -0
  105. package/ios/AppICESDK/appICEBundle.bundle/Black button.png +0 -0
  106. package/ios/AppICESDK/appICEBundle.bundle/HAlfFooterNOTINAppViewController.nib +0 -0
  107. package/ios/AppICESDK/appICEBundle.bundle/HAlfHeaderINAppViewController.nib +0 -0
  108. package/ios/AppICESDK/appICEBundle.bundle/HAlfINAppViewController.nib +0 -0
  109. package/ios/AppICESDK/appICEBundle.bundle/INAppViewController.nib/objects-11.0+.nib +0 -0
  110. package/ios/AppICESDK/appICEBundle.bundle/INAppViewController.nib/runtime.nib +0 -0
  111. package/ios/AppICESDK/appICEBundle.bundle/Info.plist +0 -0
  112. package/ios/AppICESDK/appICEBundle.bundle/RatingViewController.nib +0 -0
  113. package/ios/AppICESDK/appICEBundle.bundle/SurveyViewController.nib +0 -0
  114. package/ios/AppICESDK/appICEBundle.bundle/checked.png +0 -0
  115. package/ios/AppICESDK/appICEBundle.bundle/close-button.png +0 -0
  116. package/ios/AppICESDK/appICEBundle.bundle/sound2.caf +0 -0
  117. package/ios/AppICESDK/appICEBundle.bundle/unchecked.png +0 -0
  118. package/ios/AppICESDK/include/iosAppiceSDK/AppICEInboxMessage.h +0 -43
  119. package/ios/AppICESDK/include/iosAppiceSDK/AppICEJSInterface.h +0 -21
  120. package/ios/AppICESDK/include/iosAppiceSDK/appICE.h +0 -190
  121. package/ios/AppICESDK/include/iosAppiceSDK/appICEUserDetails.h +0 -87
  122. package/ios/AppICESDK/include/iosAppiceSDK/isrgrootx1.der +0 -0
  123. package/ios/AppICESDK/include/iosAppiceSDK/lets-encrypt-r3.der +0 -0
  124. package/ios/AppICESDK/libiosAppiceSDK_v1.7.56.a +0 -0
@@ -1,191 +1,214 @@
1
- #import "AppIceReactPlugin.h"
2
- #import "AppICEReactEvent.h"
3
- #import "React/RCTLog.h"
4
- #import "AppICESDK/include/iosAppiceSDK/appICE.h"
5
- #import "AppICESDK/include/iosAppiceSDK/appICEUserDetails.h"
6
- #import <UserNotifications/UserNotifications.h>
7
- @implementation AppIceReactPlugin
8
-
9
- RCT_EXPORT_MODULE()
10
- + (BOOL)requiresMainQueueSetup {
11
- return NO;
12
- }
13
-
14
- - (NSDictionary *)constantsToExport {
15
- return @{
16
- kAppICEPushNotificationClicked : kAppICEPushNotificationClicked,
17
- kAppICEInAppClicked : kAppICEInAppClicked,
18
- kn : kn,
19
- kem : @"e",
20
- kph : @"p",
21
- ka : ka,
22
- kg : kg,
23
- ked : @"edt",
24
- ket : @"emt",
25
- km : km,
26
- kis_emp : @"em"
27
- };
28
- }
29
- - (dispatch_queue_t)methodQueue {
30
- return dispatch_get_main_queue();
31
- }
32
- RCT_EXPORT_METHOD(sampleMethod:(NSString *)stringArgument numberParameter:(nonnull NSNumber *)numberArgument callback:(RCTResponseSenderBlock)callback)
33
- {
34
- // TODO: Implement some actually useful functionality
35
- callback(@[[NSString stringWithFormat: @"numberArgument: %@ stringArgument: %@", numberArgument, stringArgument]]);
36
- }
37
-
38
- RCT_EXPORT_METHOD(startContext:(NSString *)appID
39
- withAppKey:(NSString *)appKey
40
- withApiKey:(NSString *)apiKey
41
- withDeviceId:(NSString *)deviceId
42
- region:(NSString *)region
43
- baseUrl:(NSString *)baseUrl
44
- certs : (NSArray *) certs)
45
- {
46
- [appICE setupKeys:appKey withapiKey:apiKey withappId:appID otherSdkdeviceId:deviceId region:region baseUrl:baseUrl certficates:certs];
47
-
48
-
49
- [[appICE sharedInstance] startContext];
50
- RCTLogInfo(@"App Ice SDK startContext");
51
-
52
- //sending device token after setupkets and startContext , else baseurl is not set and throw in putapp loop with null url
53
- if([[NSUserDefaults standardUserDefaults]objectForKey:kappICEToken])
54
- {
55
- [appICE setTokenInPushNotification:[[NSUserDefaults standardUserDefaults]objectForKey:kappICEToken]];
56
- [[NSUserDefaults standardUserDefaults] removeObjectForKey:kappICEToken];
57
- }
58
- [self setClickCallback];
59
- }
60
-
61
- /**
62
- * didRegisterForRemoteNotificationsWithDeviceToken sets the device token in sdk or userdefaults depends upon sdk initalise.
63
- * @param deviceToken token in form of NSData
64
- * @discussion check if device token is not null and sdk is initalise , then pass device token to sdk
65
- * @discussion else save to userdefaults.
66
- */
67
- +(void)didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
68
- {
69
- RCTLog(@"token is : %@",deviceToken);
70
- if(deviceToken != NULL)
71
- {
72
- BOOL isInitialise = [[appICE sharedInstance]validateIntegration];
73
- if(isInitialise)
74
- {
75
- [appICE setTokenInPushNotification:deviceToken];
76
- }
77
- else{
78
- [[NSUserDefaults standardUserDefaults]setObject: deviceToken forKey:kappICEToken];
79
- }
80
- }
81
- }
82
-
83
- RCT_EXPORT_METHOD(tagEvent:(NSString*)eventName withProps:(NSDictionary*)props)
84
- {
85
- if (props == NULL) {
86
- [[appICE sharedInstance] recordEvent:eventName count:1];
87
-
88
- }else{
89
- [[appICE sharedInstance] recordEvent:eventName segmentation:props count:1];
90
- }
91
-
92
- }
93
-
94
- RCT_EXPORT_METHOD(setCustomVariable:(NSString*)eventName withStringValue:(NSString*)value)
95
- {
96
- [[appICE sharedInstance]setCustomVariable:eventName withStringValue:value];
97
-
98
- }
99
-
100
- RCT_EXPORT_METHOD(setUserId:(NSArray*)userIdArray)
101
- {
102
- [[appICE sharedInstance] setUserId:userIdArray];
103
- }
104
-
105
- RCT_EXPORT_METHOD(pushNotificationClicked:(NSDictionary*)userInfo)
106
- {
107
- [[appICE sharedInstance] pushNotificationClickedEvent:userInfo];
108
- }
109
-
110
- RCT_EXPORT_METHOD(setUser:(NSDictionary*)userProfile)
111
- {
112
- NSArray *items = [NSArray arrayWithObjects:kAIUserName,kAIUserEmail,kAIUserPhone,kAIUserGender,kAIUserBirthYear,kAIUserAge,kAIUserIsUserEmployed,kAIUserEmploymentType,kAIUserEducationType,kAIUserIsUserMarried, nil];
113
- appICEUserDetails *app=[appICEUserDetails new];
114
- for(int i= 0; i< items.count ;i++)
115
- {
116
-
117
- if ([userProfile objectForKey:items[i]]) {
118
- switch (i) {
119
- case 0:
120
- app.name = userProfile[items[i]];
121
- break;
122
- case 1:
123
- app.email = userProfile[items[i]];
124
- break;
125
- case 2:
126
- app.phone = userProfile[items[i]];
127
- break;
128
- case 3:
129
- app.gender = userProfile[items[i]];
130
- break;
131
- case 4:
132
- app.dob = [userProfile[items[i]]longValue];
133
- break;
134
- case 5:
135
- app.age = [userProfile[items[i] ]intValue];
136
- break;
137
- case 6:
138
- app.is_user_employed = userProfile[items[i]];
139
- break;
140
- case 7:
141
- app.employment_type = userProfile[items[i]];
142
- break;
143
- case 8:
144
- app.education_type = userProfile[items[i]];
145
- break;
146
- case 9:
147
- app.is_user_married = userProfile[items[i]];
148
- break;
149
- default:
150
- break;
151
- }
152
- }
153
- }
154
- if(app != nil)
155
- {
156
- [[appICE sharedInstance] setUserDetail:app];
157
- }
158
-
159
- }
160
-
161
- + (void)pushNotificationClicked:(NSDictionary *)userInfo {
162
- NSDictionary *event = @{ kAppICEPushNotificationClicked : userInfo};
163
- [[NSNotificationCenter defaultCenter] postNotificationName:kAppICEPushNotificationClicked object:nil userInfo:event];
164
- }
165
-
166
- RCT_EXPORT_METHOD(inAppClicked:(NSDictionary*)userInfo)
167
- {
168
- RCTLog(@"from inAppClicked method = %@",userInfo);
169
- }
170
-
171
- + (void)pushNotificationReceived:(NSDictionary *)userInfo {
172
- [[appICE sharedInstance]pushNotificationReceived:userInfo];
173
- }
174
-
175
- //InApp Deeplink Callback
176
- - (void)setClickCallback
177
- {
178
- [[appICE sharedInstance] setClickCallback:^(NSDictionary * _Nonnull cData) {
179
- // Convert cData to JSON string
180
- if (cData != nil || cData.count > 0) {
181
- RCTLog(@"***** INapp success *** %@", cData);
182
- [[NSNotificationCenter defaultCenter] postNotificationName:kAppICEInAppClicked object:nil userInfo:cData];
183
-
184
- }
185
-
186
- }];
187
-
188
- }
189
-
190
- @end
191
-
1
+ #import "AppIceReactPlugin.h"
2
+ #import "AppICEReactEvent.h"
3
+ #import "React/RCTLog.h"
4
+ #import "appICE.h"
5
+ #import "appICEUserDetails.h"
6
+ #import <UserNotifications/UserNotifications.h>
7
+ @implementation AppIceReactPlugin
8
+
9
+ RCT_EXPORT_MODULE()
10
+ + (BOOL)requiresMainQueueSetup {
11
+ return NO;
12
+ }
13
+
14
+ - (NSDictionary *)constantsToExport {
15
+ return @{
16
+ kAppICEPushNotificationClicked : kAppICEPushNotificationClicked,
17
+ kAppICEInAppClicked : kAppICEInAppClicked,
18
+ kn : kn,
19
+ kem : @"e",
20
+ kph : @"p",
21
+ ka : ka,
22
+ kg : kg,
23
+ ked : @"edt",
24
+ ket : @"emt",
25
+ km : km,
26
+ kis_emp : @"em"
27
+ };
28
+ }
29
+ - (dispatch_queue_t)methodQueue {
30
+ return dispatch_get_main_queue();
31
+ }
32
+ RCT_EXPORT_METHOD(sampleMethod:(NSString *)stringArgument numberParameter:(nonnull NSNumber *)numberArgument callback:(RCTResponseSenderBlock)callback)
33
+ {
34
+ // TODO: Implement some actually useful functionality
35
+ callback(@[[NSString stringWithFormat: @"numberArgument: %@ stringArgument: %@", numberArgument, stringArgument]]);
36
+ }
37
+
38
+ RCT_EXPORT_METHOD(startContext:(NSString *)appID
39
+ withAppKey:(NSString *)appKey
40
+ withApiKey:(NSString *)apiKey
41
+ withDeviceId:(NSString *)deviceId
42
+ region:(NSString *)region
43
+ baseUrl:(NSString *)baseUrl
44
+ certs : (NSArray *) certs)
45
+ {
46
+ [appICE setupKeys:appKey withapiKey:apiKey withappId:appID otherSdkdeviceId:deviceId region:region baseUrl:baseUrl certficates:certs];
47
+
48
+
49
+ [[appICE sharedInstance] startContext];
50
+ RCTLogInfo(@"App Ice SDK startContext");
51
+
52
+ //sending device token after setupkets and startContext , else baseurl is not set and throw in putapp loop with null url
53
+ if([[NSUserDefaults standardUserDefaults]objectForKey:kappICEToken])
54
+ {
55
+ [appICE setTokenInPushNotification:[[NSUserDefaults standardUserDefaults]objectForKey:kappICEToken]];
56
+ [[NSUserDefaults standardUserDefaults] removeObjectForKey:kappICEToken];
57
+ }
58
+ [self setClickCallback];
59
+ }
60
+
61
+ /**
62
+ * didRegisterForRemoteNotificationsWithDeviceToken sets the device token in sdk or userdefaults depends upon sdk initalise.
63
+ * @param deviceToken token in form of NSData
64
+ * @discussion check if device token is not null and sdk is initalise , then pass device token to sdk
65
+ * @discussion else save to userdefaults.
66
+ */
67
+ +(void)didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
68
+ {
69
+ RCTLog(@"token is : %@",deviceToken);
70
+ if(deviceToken != NULL)
71
+ {
72
+ BOOL isInitialise = [[appICE sharedInstance]validateIntegration];
73
+ if(isInitialise)
74
+ {
75
+ [appICE setTokenInPushNotification:deviceToken];
76
+ }
77
+ else{
78
+ [[NSUserDefaults standardUserDefaults]setObject: deviceToken forKey:kappICEToken];
79
+ }
80
+ }
81
+ }
82
+
83
+ RCT_EXPORT_METHOD(tagEvent:(NSString*)eventName withProps:(NSDictionary*)props)
84
+ {
85
+ if (props == NULL) {
86
+ [[appICE sharedInstance] recordEvent:eventName count:1];
87
+
88
+ }else{
89
+ [[appICE sharedInstance] recordEvent:eventName segmentation:props count:1];
90
+ }
91
+
92
+ }
93
+
94
+ RCT_EXPORT_METHOD(setCustomVariable:(NSString*)eventName withStringValue:(NSString*)value)
95
+ {
96
+ [[appICE sharedInstance]setCustomVariable:eventName withStringValue:value];
97
+
98
+ }
99
+
100
+ RCT_EXPORT_METHOD(setUserId:(NSArray*)userIdArray)
101
+ {
102
+ [[appICE sharedInstance] setUserId:userIdArray];
103
+ }
104
+
105
+ RCT_EXPORT_METHOD(pushNotificationClicked:(NSDictionary*)userInfo)
106
+ {
107
+ [[appICE sharedInstance] pushNotificationClickedEvent:userInfo];
108
+ }
109
+
110
+ RCT_EXPORT_METHOD(setUser:(NSDictionary*)userProfile)
111
+ {
112
+ NSArray *items = [NSArray arrayWithObjects:kAIUserName,kAIUserEmail,kAIUserPhone,kAIUserGender,kAIUserBirthYear,kAIUserAge,kAIUserIsUserEmployed,kAIUserEmploymentType,kAIUserEducationType,kAIUserIsUserMarried, nil];
113
+ appICEUserDetails *app=[appICEUserDetails new];
114
+ for(int i= 0; i< items.count ;i++)
115
+ {
116
+
117
+ if ([userProfile objectForKey:items[i]]) {
118
+ switch (i) {
119
+ case 0:
120
+ app.name = userProfile[items[i]];
121
+ break;
122
+ case 1:
123
+ app.email = userProfile[items[i]];
124
+ break;
125
+ case 2:
126
+ app.phone = userProfile[items[i]];
127
+ break;
128
+ case 3:
129
+ app.gender = userProfile[items[i]];
130
+ break;
131
+ case 4:
132
+ app.dob = [userProfile[items[i]]longValue];
133
+ break;
134
+ case 5:
135
+ app.age = [userProfile[items[i] ]intValue];
136
+ break;
137
+ case 6:
138
+ app.is_user_employed = userProfile[items[i]];
139
+ break;
140
+ case 7:
141
+ app.employment_type = userProfile[items[i]];
142
+ break;
143
+ case 8:
144
+ app.education_type = userProfile[items[i]];
145
+ break;
146
+ case 9:
147
+ app.is_user_married = userProfile[items[i]];
148
+ break;
149
+ default:
150
+ break;
151
+ }
152
+ }
153
+ }
154
+ if(app != nil)
155
+ {
156
+ [[appICE sharedInstance] setUserDetail:app];
157
+ }
158
+
159
+ }
160
+
161
+ + (void)pushNotificationClicked:(NSDictionary *)userInfo {
162
+ NSDictionary *event = @{ kAppICEPushNotificationClicked : userInfo};
163
+ [[NSNotificationCenter defaultCenter] postNotificationName:kAppICEPushNotificationClicked object:nil userInfo:event];
164
+ }
165
+
166
+ RCT_EXPORT_METHOD(inAppClicked:(NSDictionary*)userInfo)
167
+ {
168
+ RCTLog(@"from inAppClicked method = %@",userInfo);
169
+ }
170
+
171
+ + (void)pushNotificationReceived:(NSDictionary *)userInfo {
172
+ [[appICE sharedInstance]pushNotificationReceived:userInfo];
173
+ }
174
+
175
+ //InApp Deeplink Callback
176
+ - (void)setClickCallback
177
+ {
178
+ [[appICE sharedInstance] setClickCallback:^(NSDictionary * _Nonnull cData) {
179
+ if (cData != nil || cData.count > 0) {
180
+ RCTLog(@"***** INapp success *** %@", cData);
181
+ [[NSNotificationCenter defaultCenter] postNotificationName:kAppICEInAppClicked object:nil userInfo:cData];
182
+
183
+ }
184
+
185
+ }];
186
+
187
+ }
188
+ RCT_EXPORT_METHOD(setInternalId:(NSString*) internalId)
189
+ {
190
+ [[appICE sharedInstance] setInternalId:internalId];
191
+ }
192
+
193
+ /**
194
+ * Call the native method to getDeviceId
195
+ * Check if the internal ID is not nil and the callback function is provided
196
+ * else Handle the case when getDeviceId is nil
197
+ * Invoke the callback with an array containing NSNull to represent nil
198
+ */
199
+ RCT_EXPORT_METHOD(getDeviceId:(RCTResponseSenderBlock)callback)
200
+ {
201
+ NSString *getinternalId = [[appICE sharedInstance] getInternalId];
202
+ RCTLog(@"getinternalID %@", getinternalId);
203
+
204
+ if (getinternalId != nil && callback) {
205
+ callback(@[getinternalId]);
206
+ } else {
207
+ if (callback) {
208
+ callback(@[[NSNull null]]);
209
+ }
210
+ }
211
+ }
212
+
213
+ @end
214
+