reactnative-plugin-appice 1.5.6 → 1.5.8
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/example/App.js +5 -0
- package/ios/AppIceReactPlugin.m +16 -14
- package/package.json +1 -1
package/example/App.js
CHANGED
|
@@ -128,6 +128,11 @@ const setSampleUserID = () => {
|
|
|
128
128
|
const setLanguage = () => {
|
|
129
129
|
AppICE.setCustomVariable("_lang", "ar-AE");
|
|
130
130
|
|
|
131
|
+
|
|
132
|
+
AppICE.sendClickCallback((value) => {
|
|
133
|
+
console.log(`INAPP callback`, value);
|
|
134
|
+
});
|
|
135
|
+
|
|
131
136
|
};
|
|
132
137
|
const sendView = () => {
|
|
133
138
|
AppICE.tagEvent("HomeScreen", {});
|
package/ios/AppIceReactPlugin.m
CHANGED
|
@@ -15,14 +15,14 @@ RCT_EXPORT_MODULE()
|
|
|
15
15
|
return @{
|
|
16
16
|
kAppICEPushNotificationClicked : kAppICEPushNotificationClicked,
|
|
17
17
|
kn : kn,
|
|
18
|
-
kem :
|
|
19
|
-
kph :
|
|
18
|
+
kem : @"e",
|
|
19
|
+
kph : @"p",
|
|
20
20
|
ka : ka,
|
|
21
21
|
kg : kg,
|
|
22
|
-
ked :
|
|
23
|
-
ket :
|
|
22
|
+
ked : @"edt",
|
|
23
|
+
ket : @"emt",
|
|
24
24
|
km : km,
|
|
25
|
-
kis_emp :
|
|
25
|
+
kis_emp : @"em"
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
28
|
- (dispatch_queue_t)methodQueue {
|
|
@@ -103,10 +103,11 @@ RCT_EXPORT_METHOD(pushNotificationClicked:(NSDictionary*)userInfo)
|
|
|
103
103
|
{
|
|
104
104
|
[[appICE sharedInstance] pushNotificationClickedEvent:userInfo];
|
|
105
105
|
}
|
|
106
|
+
|
|
106
107
|
RCT_EXPORT_METHOD(setUser:(NSDictionary*)userProfile)
|
|
107
108
|
{
|
|
108
|
-
NSArray *items = [NSArray arrayWithObjects:
|
|
109
|
-
|
|
109
|
+
NSArray *items = [NSArray arrayWithObjects:kAIUserName,kAIUserEmail,kAIUserPhone,kAIUserGender,kAIUserBirthYear,kAIUserAge,kAIUserIsUserEmployed,kAIUserEmploymentType,kAIUserEducationType,kAIUserIsUserMarried, nil];
|
|
110
|
+
appICEUserDetails *app=[appICEUserDetails new];
|
|
110
111
|
for(int i= 0; i< items.count ;i++)
|
|
111
112
|
{
|
|
112
113
|
|
|
@@ -125,21 +126,21 @@ RCT_EXPORT_METHOD(setUser:(NSDictionary*)userProfile)
|
|
|
125
126
|
app.gender = userProfile[items[i]];
|
|
126
127
|
break;
|
|
127
128
|
case 4:
|
|
128
|
-
app.dob = userProfile[items[i]];
|
|
129
|
+
app.dob = [userProfile[items[i]]longValue];
|
|
129
130
|
break;
|
|
130
131
|
case 5:
|
|
131
|
-
app.age =
|
|
132
|
+
app.age = [userProfile[items[i] ]intValue];
|
|
132
133
|
break;
|
|
133
134
|
case 6:
|
|
134
135
|
app.is_user_employed = userProfile[items[i]];
|
|
135
136
|
break;
|
|
136
|
-
case
|
|
137
|
+
case 7:
|
|
137
138
|
app.employment_type = userProfile[items[i]];
|
|
138
139
|
break;
|
|
139
|
-
case
|
|
140
|
+
case 8:
|
|
140
141
|
app.education_type = userProfile[items[i]];
|
|
141
142
|
break;
|
|
142
|
-
case
|
|
143
|
+
case 9:
|
|
143
144
|
app.is_user_married = userProfile[items[i]];
|
|
144
145
|
break;
|
|
145
146
|
default:
|
|
@@ -149,15 +150,16 @@ RCT_EXPORT_METHOD(setUser:(NSDictionary*)userProfile)
|
|
|
149
150
|
}
|
|
150
151
|
if(app != nil)
|
|
151
152
|
{
|
|
152
|
-
|
|
153
|
+
[[appICE sharedInstance] setUserDetail:app];
|
|
153
154
|
}
|
|
154
155
|
|
|
155
|
-
|
|
156
|
+
}
|
|
156
157
|
|
|
157
158
|
+ (void)pushNotificationClicked:(NSDictionary *)userInfo {
|
|
158
159
|
NSDictionary *event = @{ kAppICEPushNotificationClicked : userInfo};
|
|
159
160
|
[[NSNotificationCenter defaultCenter] postNotificationName:kAppICEPushNotificationClicked object:nil userInfo:event];
|
|
160
161
|
}
|
|
162
|
+
|
|
161
163
|
+ (void)pushNotificationReceived:(NSDictionary *)userInfo {
|
|
162
164
|
[[appICE sharedInstance]pushNotificationReceived:userInfo];
|
|
163
165
|
}
|