reactnative-plugin-appice 1.5.9 → 1.6.1
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/android.iml +150 -150
- package/android/build.gradle +152 -152
- package/android/gitignore +47 -47
- package/android/src/main/AndroidManifest.xml +234 -234
- package/android/src/main/java/com/reactlibrary/AppICEUtils.java +38 -38
- package/android/src/main/java/com/reactlibrary/AppIceReactPluginModule.java +473 -473
- package/android/src/main/java/com/reactlibrary/AppIceReactPluginPackage.java +28 -28
- package/android/src/main/java/com/reactlibrary/CampaignCampsReceiver.java +73 -73
- package/android/src/main/java/com/reactlibrary/InAppWebView.java +67 -67
- package/android/src/main/java/com/reactlibrary/NotificationEventService.java +62 -62
- package/example/App.js +148 -148
- package/example/Gemfile +6 -6
- package/example/__tests__/App-test.js +14 -14
- 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 +53 -53
- 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 +34 -34
- package/index.js +124 -124
- package/ios/AppICEReactEvent.h +23 -23
- package/ios/AppICEReactEvent.m +86 -77
- package/ios/AppIceReactPlugin.h +22 -22
- package/ios/AppIceReactPlugin.m +190 -191
- package/ios/AppIceReactPlugin.xcodeproj/project.pbxproj +364 -434
- 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.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/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 +40 -40
- package/reactnative-plugin-appice.podspec +30 -30
- package/ios/AppICESDK/appICE.momd/VersionInfo.plist +0 -0
- package/ios/AppICESDK/appICE.momd/appICE 2.mom +0 -0
- package/ios/AppICESDK/appICE.momd/appICE 3.mom +0 -0
- package/ios/AppICESDK/appICE.momd/appICE 4.mom +0 -0
- package/ios/AppICESDK/appICE.momd/appICE 4.omo +0 -0
- package/ios/AppICESDK/appICE.momd/appICE.mom +0 -0
- package/ios/AppICESDK/appICE.momd/appICE2.mom +0 -0
- package/ios/AppICESDK/appICEBundle.bundle/APPChildViewController.nib +0 -0
- package/ios/AppICESDK/appICEBundle.bundle/AppICE_btn.png +0 -0
- package/ios/AppICESDK/appICEBundle.bundle/Black button.png +0 -0
- package/ios/AppICESDK/appICEBundle.bundle/HAlfFooterNOTINAppViewController.nib +0 -0
- package/ios/AppICESDK/appICEBundle.bundle/HAlfHeaderINAppViewController.nib +0 -0
- package/ios/AppICESDK/appICEBundle.bundle/HAlfINAppViewController.nib +0 -0
- package/ios/AppICESDK/appICEBundle.bundle/INAppViewController.nib/objects-11.0+.nib +0 -0
- package/ios/AppICESDK/appICEBundle.bundle/INAppViewController.nib/runtime.nib +0 -0
- package/ios/AppICESDK/appICEBundle.bundle/Info.plist +0 -0
- package/ios/AppICESDK/appICEBundle.bundle/RatingViewController.nib +0 -0
- package/ios/AppICESDK/appICEBundle.bundle/SurveyViewController.nib +0 -0
- package/ios/AppICESDK/appICEBundle.bundle/checked.png +0 -0
- package/ios/AppICESDK/appICEBundle.bundle/close-button.png +0 -0
- package/ios/AppICESDK/appICEBundle.bundle/sound2.caf +0 -0
- package/ios/AppICESDK/appICEBundle.bundle/unchecked.png +0 -0
- package/ios/AppICESDK/include/iosAppiceSDK/AppICEInboxMessage.h +0 -43
- package/ios/AppICESDK/include/iosAppiceSDK/AppICEJSInterface.h +0 -21
- package/ios/AppICESDK/include/iosAppiceSDK/appICE.h +0 -190
- package/ios/AppICESDK/include/iosAppiceSDK/appICEUserDetails.h +0 -87
- package/ios/AppICESDK/include/iosAppiceSDK/isrgrootx1.der +0 -0
- package/ios/AppICESDK/include/iosAppiceSDK/lets-encrypt-r3.der +0 -0
- package/ios/AppICESDK/libiosAppiceSDK_v1.7.56.a +0 -0
package/ios/AppIceReactPlugin.m
CHANGED
|
@@ -1,191 +1,190 @@
|
|
|
1
|
-
#import "AppIceReactPlugin.h"
|
|
2
|
-
#import "AppICEReactEvent.h"
|
|
3
|
-
#import "React/RCTLog.h"
|
|
4
|
-
#import "
|
|
5
|
-
#import "
|
|
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
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
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
|
+
|
|
189
|
+
@end
|
|
190
|
+
|