react-native-flyy 1.4.32 → 1.4.33
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/android/.project +1 -1
- package/android/.settings/org.eclipse.buildship.core.prefs +5 -2
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/reactnativeflyy/FlyyModule.kt +155 -49
- package/android/src/main/java/com/reactnativeflyy/FlyyRouteActivity.java +16 -0
- package/ios/Montserrat-Bold.ttf +0 -0
- package/ios/ReactNativeFlyy.m +276 -122
- package/lib/commonjs/assets/images/check.png +0 -0
- package/lib/commonjs/assets/images/medal.png +0 -0
- package/lib/commonjs/assets/images/radio.png +0 -0
- package/lib/commonjs/assets/images/reward_flyy.png +0 -0
- package/lib/commonjs/assets/images/xmark.png +0 -0
- package/lib/commonjs/flyy_checkin_view.js +379 -0
- package/lib/commonjs/flyy_checkin_view.js.map +1 -0
- package/lib/commonjs/index.js +634 -3
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/assets/images/check.png +0 -0
- package/lib/module/assets/images/medal.png +0 -0
- package/lib/module/assets/images/radio.png +0 -0
- package/lib/module/assets/images/reward_flyy.png +0 -0
- package/lib/module/assets/images/xmark.png +0 -0
- package/lib/module/flyy_checkin_view.js +365 -0
- package/lib/module/flyy_checkin_view.js.map +1 -0
- package/lib/module/index.js +616 -3
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/flyy_checkin_view.d.ts +19 -0
- package/lib/typescript/index.d.ts +32 -0
- package/package.json +3 -1
- package/react-native-flyy.podspec +1 -1
- package/src/assets/images/check.png +0 -0
- package/src/assets/images/medal.png +0 -0
- package/src/assets/images/radio.png +0 -0
- package/src/assets/images/reward_flyy.png +0 -0
- package/src/assets/images/xmark.png +0 -0
- package/src/flyy_checkin_view.tsx +213 -0
- package/src/index.tsx +548 -1
package/ios/ReactNativeFlyy.m
CHANGED
|
@@ -15,6 +15,9 @@ RCT_EXPORT_MODULE(Flyy)
|
|
|
15
15
|
static NSString * STAGE = @"STAGE";
|
|
16
16
|
static NSString * PRODUCTION = @"PRODUCTION";
|
|
17
17
|
NSString * themeColor = @"";
|
|
18
|
+
NSString * extPartnerId = @"";
|
|
19
|
+
NSString * extUserId = @"";
|
|
20
|
+
int extEnvironment = 0;
|
|
18
21
|
RCTResponseSenderBlock sdkClosedCallback;
|
|
19
22
|
|
|
20
23
|
-(void)set_navigation_controller:(UINavigationController*)navigation withCurrentViewController:(UIViewController*) controller
|
|
@@ -27,25 +30,25 @@ RCT_EXPORT_METHOD(setPackageName: (NSString *)packageName)
|
|
|
27
30
|
{
|
|
28
31
|
//Instance of flyy class
|
|
29
32
|
flyy = [Flyy sharedFlyyInstance];
|
|
30
|
-
|
|
33
|
+
|
|
31
34
|
[flyy setPackageWithPackageName:packageName];
|
|
32
35
|
}
|
|
33
36
|
|
|
34
|
-
//set stage Domain name
|
|
37
|
+
//set stage Domain name
|
|
35
38
|
RCT_EXPORT_METHOD(setBaseStageDomainName: (NSString *)domainName)
|
|
36
39
|
{
|
|
37
40
|
//Instance of flyy class
|
|
38
41
|
flyy = [Flyy sharedFlyyInstance];
|
|
39
|
-
|
|
42
|
+
|
|
40
43
|
[flyy setBaseStageFlyyDomainWithDomain:domainName];
|
|
41
44
|
}
|
|
42
45
|
|
|
43
|
-
//set production Domain name
|
|
46
|
+
//set production Domain name
|
|
44
47
|
RCT_EXPORT_METHOD(setBaseDomainName: (NSString *)domainName)
|
|
45
48
|
{
|
|
46
49
|
//Instance of flyy class
|
|
47
50
|
flyy = [Flyy sharedFlyyInstance];
|
|
48
|
-
|
|
51
|
+
|
|
49
52
|
[flyy setBaseFlyyDomainWithDomain:domainName];
|
|
50
53
|
}
|
|
51
54
|
|
|
@@ -53,17 +56,79 @@ RCT_EXPORT_METHOD(setBaseDomainName: (NSString *)domainName)
|
|
|
53
56
|
RCT_EXPORT_METHOD(initSDK: (NSString *)partnerToken :(int)environment)
|
|
54
57
|
{
|
|
55
58
|
//Instance of flyy class
|
|
59
|
+
extPartnerId = partnerToken;
|
|
60
|
+
extEnvironment = environment;
|
|
56
61
|
flyy = [Flyy sharedFlyyInstance];
|
|
57
|
-
|
|
62
|
+
|
|
58
63
|
[flyy initSDKWithPartnerToken:partnerToken environment: environment];
|
|
64
|
+
|
|
65
|
+
saveToUserDefaults();
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
void saveToUserDefaults()
|
|
69
|
+
{
|
|
70
|
+
NSUserDefaults *standardUserDefaults = [NSUserDefaults standardUserDefaults];
|
|
71
|
+
|
|
72
|
+
if (standardUserDefaults)
|
|
73
|
+
{
|
|
74
|
+
NSInteger invalue = 1;
|
|
75
|
+
|
|
76
|
+
NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
|
|
77
|
+
BOOL newUserExist = [prefs valueForKey:@"timestamps"];
|
|
78
|
+
|
|
79
|
+
if (newUserExist == YES) {
|
|
80
|
+
|
|
81
|
+
invalue = [prefs integerForKey:@"timestamps"];
|
|
82
|
+
invalue = invalue + 1;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
[standardUserDefaults setInteger:invalue forKey:@"timestamps"];
|
|
86
|
+
[standardUserDefaults synchronize];
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
//get user data
|
|
94
|
+
RCT_EXPORT_METHOD(getAppOccurence:(NSInteger *)type
|
|
95
|
+
resolver:(RCTPromiseResolveBlock)resolve
|
|
96
|
+
rejecter:(RCTPromiseRejectBlock)reject)
|
|
97
|
+
{
|
|
98
|
+
NSUserDefaults *standardUserDefaults = [NSUserDefaults standardUserDefaults];
|
|
99
|
+
NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
|
|
100
|
+
|
|
101
|
+
if(type == 1){
|
|
102
|
+
[standardUserDefaults setInteger:1 forKey:@"timestamps"];
|
|
103
|
+
[standardUserDefaults synchronize];
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// getting an NSString
|
|
107
|
+
NSInteger myInt = [prefs integerForKey:@"timestamps"];
|
|
108
|
+
NSNumber *val = [NSNumber numberWithInteger:myInt];
|
|
109
|
+
resolve(val);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
//Init flyy with callback
|
|
113
|
+
RCT_EXPORT_METHOD(initSDKWithCallback: (NSString *)partnerToken :(int)environment: (RCTResponseSenderBlock)callback)
|
|
114
|
+
{
|
|
115
|
+
//Instance of flyy class
|
|
116
|
+
extPartnerId = partnerToken;
|
|
117
|
+
extEnvironment = environment;
|
|
118
|
+
flyy = [Flyy sharedFlyyInstance];
|
|
119
|
+
|
|
120
|
+
[flyy initSDKWithPartnerToken:partnerToken environment: environment];
|
|
121
|
+
callback(@"true");
|
|
59
122
|
}
|
|
60
123
|
|
|
61
124
|
//Init flyy sdk with referral callback
|
|
62
125
|
RCT_EXPORT_METHOD(initSDKWithReferralCallback: (NSString *)partnerToken :(int)environment :(RCTResponseSenderBlock)callback)
|
|
63
126
|
{
|
|
64
127
|
//Instance of flyy class
|
|
128
|
+
extPartnerId = partnerToken;
|
|
129
|
+
extEnvironment = environment;
|
|
65
130
|
flyy = [Flyy sharedFlyyInstance];
|
|
66
|
-
|
|
131
|
+
|
|
67
132
|
[flyy initSDKWithPartnerToken:partnerToken environment: environment onComplete: ^(BOOL success, NSString * referralData) {
|
|
68
133
|
if(success) {
|
|
69
134
|
callback(@[referralData]);
|
|
@@ -71,6 +136,17 @@ RCT_EXPORT_METHOD(initSDKWithReferralCallback: (NSString *)partnerToken :(int)en
|
|
|
71
136
|
}];
|
|
72
137
|
}
|
|
73
138
|
|
|
139
|
+
//set custom font
|
|
140
|
+
//RCT_EXPORT_METHOD(setCustomFontName: (NSString *)regularFont :(NSString *)mediumFont :(NSString *)boldFont)
|
|
141
|
+
//{
|
|
142
|
+
// flyy = [Flyy sharedFlyyInstance];
|
|
143
|
+
// dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
144
|
+
// dispatch_async(dispatch_get_main_queue(), ^(){
|
|
145
|
+
// [self->flyy setCustomFontNameWithRegularFont:regularFont mediumFont:mediumFont boldFont:boldFont];
|
|
146
|
+
// });
|
|
147
|
+
// });
|
|
148
|
+
//}
|
|
149
|
+
|
|
74
150
|
////Init flyy sdk with theme colors
|
|
75
151
|
//RCT_EXPORT_METHOD(initSDKWithThemeColors: (NSString *)partnerToken :(int)environment
|
|
76
152
|
// :(NSString *)colorPrimary :(NSString *)colorPrimaryDark)
|
|
@@ -85,8 +161,9 @@ RCT_EXPORT_METHOD(initSDKWithReferralCallback: (NSString *)partnerToken :(int)en
|
|
|
85
161
|
RCT_EXPORT_METHOD(setUser: (NSString *)userId)
|
|
86
162
|
{
|
|
87
163
|
//Instance of flyy class
|
|
164
|
+
extUserId = userId;
|
|
88
165
|
flyy = [Flyy sharedFlyyInstance];
|
|
89
|
-
|
|
166
|
+
extUserId = userId;
|
|
90
167
|
[flyy setUserWithExternalUserId:userId];
|
|
91
168
|
}
|
|
92
169
|
|
|
@@ -95,7 +172,8 @@ RCT_EXPORT_METHOD(setUserWithSegment: (NSString *)userId :(NSString *)segmentId
|
|
|
95
172
|
{
|
|
96
173
|
//Instance of flyy class
|
|
97
174
|
flyy = [Flyy sharedFlyyInstance];
|
|
98
|
-
|
|
175
|
+
extUserId = userId;
|
|
176
|
+
|
|
99
177
|
[flyy setUserWithExternalUserId:userId segmentId:segmentId onComplete: ^(BOOL success) {
|
|
100
178
|
if(success) {
|
|
101
179
|
}
|
|
@@ -103,14 +181,18 @@ RCT_EXPORT_METHOD(setUserWithSegment: (NSString *)userId :(NSString *)segmentId
|
|
|
103
181
|
}
|
|
104
182
|
|
|
105
183
|
//set user with callback
|
|
106
|
-
RCT_EXPORT_METHOD(setUserWithCallBack: (NSString *)userId
|
|
184
|
+
RCT_EXPORT_METHOD(setUserWithCallBack: (NSString *)userId
|
|
185
|
+
resolver:(RCTPromiseResolveBlock)resolve
|
|
186
|
+
rejecter:(RCTPromiseRejectBlock)reject)
|
|
107
187
|
{
|
|
108
188
|
//Instance of flyy class
|
|
189
|
+
extUserId = userId;
|
|
109
190
|
flyy = [Flyy sharedFlyyInstance];
|
|
110
|
-
|
|
191
|
+
extUserId = userId;
|
|
192
|
+
|
|
111
193
|
[flyy setUserWithExternalUserId:userId onComplete: ^(BOOL success) {
|
|
112
194
|
if(success) {
|
|
113
|
-
|
|
195
|
+
resolve(@[@("success")]);
|
|
114
196
|
}
|
|
115
197
|
}];
|
|
116
198
|
}
|
|
@@ -120,7 +202,8 @@ RCT_EXPORT_METHOD(setUserWithSegmentCallback: (NSString *)userId :(NSString *)se
|
|
|
120
202
|
{
|
|
121
203
|
//Instance of flyy class
|
|
122
204
|
flyy = [Flyy sharedFlyyInstance];
|
|
123
|
-
|
|
205
|
+
extUserId = userId;
|
|
206
|
+
|
|
124
207
|
[flyy setUserWithExternalUserId:userId segmentId:segmentId onComplete: ^(BOOL success) {
|
|
125
208
|
if(success) {
|
|
126
209
|
callback(@[@("success")]);
|
|
@@ -133,7 +216,7 @@ RCT_EXPORT_METHOD(setNewUser: (NSString *)userId)
|
|
|
133
216
|
{
|
|
134
217
|
//Instance of flyy class
|
|
135
218
|
flyy = [Flyy sharedFlyyInstance];
|
|
136
|
-
|
|
219
|
+
|
|
137
220
|
[flyy setNewUserWithExternalUserId:userId];
|
|
138
221
|
}
|
|
139
222
|
|
|
@@ -142,7 +225,7 @@ RCT_EXPORT_METHOD(setNewUserWithSegment: (NSString *)userId :(NSString *)segment
|
|
|
142
225
|
{
|
|
143
226
|
//Instance of flyy class
|
|
144
227
|
flyy = [Flyy sharedFlyyInstance];
|
|
145
|
-
|
|
228
|
+
|
|
146
229
|
[flyy setNewUserWithExternalUserId:userId segmentId:segmentId onComplete: ^(BOOL success) {
|
|
147
230
|
if(success) {
|
|
148
231
|
}
|
|
@@ -154,7 +237,7 @@ RCT_EXPORT_METHOD(setNewUserWithSegmentCallback: (NSString *)userId :(NSString *
|
|
|
154
237
|
{
|
|
155
238
|
//Instance of flyy class
|
|
156
239
|
flyy = [Flyy sharedFlyyInstance];
|
|
157
|
-
|
|
240
|
+
|
|
158
241
|
[flyy setNewUserWithExternalUserId:userId segmentId:segmentId onComplete: ^(BOOL success) {
|
|
159
242
|
if(success) {
|
|
160
243
|
callback(@[@("success")]);
|
|
@@ -163,14 +246,17 @@ RCT_EXPORT_METHOD(setNewUserWithSegmentCallback: (NSString *)userId :(NSString *
|
|
|
163
246
|
}
|
|
164
247
|
|
|
165
248
|
//set new user with callback
|
|
166
|
-
RCT_EXPORT_METHOD(setNewUserWithCallBack: (NSString *)userId
|
|
249
|
+
RCT_EXPORT_METHOD(setNewUserWithCallBack: (NSString *)userId
|
|
250
|
+
resolver:(RCTPromiseResolveBlock)resolve
|
|
251
|
+
rejecter:(RCTPromiseRejectBlock)reject)
|
|
167
252
|
{
|
|
168
253
|
//Instance of flyy class
|
|
254
|
+
extUserId = userId;
|
|
169
255
|
flyy = [Flyy sharedFlyyInstance];
|
|
170
|
-
|
|
256
|
+
|
|
171
257
|
[flyy setNewUserWithExternalUserId:userId onComplete: ^(BOOL success) {
|
|
172
258
|
if(success) {
|
|
173
|
-
|
|
259
|
+
resolve(@[@("success")]);
|
|
174
260
|
}
|
|
175
261
|
}];
|
|
176
262
|
}
|
|
@@ -180,7 +266,7 @@ RCT_EXPORT_METHOD(setNewUserWithSegment: (NSString *)userId :(NSString *)segment
|
|
|
180
266
|
{
|
|
181
267
|
//Instance of flyy class
|
|
182
268
|
flyy = [Flyy sharedFlyyInstance];
|
|
183
|
-
|
|
269
|
+
|
|
184
270
|
[flyy setNewUserWithExternalUserId:userId segmentId:segmentId onComplete: ^(BOOL success) {
|
|
185
271
|
if(success) {
|
|
186
272
|
callback(@[@("success")]);
|
|
@@ -193,7 +279,7 @@ RCT_EXPORT_METHOD(setUserName: (NSString *)userName)
|
|
|
193
279
|
{
|
|
194
280
|
//Instance of flyy class
|
|
195
281
|
flyy = [Flyy sharedFlyyInstance];
|
|
196
|
-
|
|
282
|
+
|
|
197
283
|
[flyy setUserNameWithUserName:userName];
|
|
198
284
|
}
|
|
199
285
|
|
|
@@ -202,7 +288,7 @@ RCT_EXPORT_METHOD(setUserNameWithCallBack: (NSString *)userName :(RCTResponseSen
|
|
|
202
288
|
{
|
|
203
289
|
//Instance of flyy class
|
|
204
290
|
flyy = [Flyy sharedFlyyInstance];
|
|
205
|
-
|
|
291
|
+
|
|
206
292
|
[flyy setUserNameWithUserName:userName onComplete: ^(BOOL success) {
|
|
207
293
|
if(success) {
|
|
208
294
|
callback(@[@("success")]);
|
|
@@ -215,7 +301,7 @@ RCT_EXPORT_METHOD(sendEvent: (NSString *)key withString:(NSString *)value)
|
|
|
215
301
|
{
|
|
216
302
|
//Instance of flyy class
|
|
217
303
|
flyy = [Flyy sharedFlyyInstance];
|
|
218
|
-
|
|
304
|
+
|
|
219
305
|
[flyy sendEventWithKey:key value:value];
|
|
220
306
|
}
|
|
221
307
|
|
|
@@ -224,7 +310,7 @@ RCT_EXPORT_METHOD(sendEventWithCallBack: (NSString *)key withString:(NSString *)
|
|
|
224
310
|
{
|
|
225
311
|
//Instance of flyy class
|
|
226
312
|
flyy = [Flyy sharedFlyyInstance];
|
|
227
|
-
|
|
313
|
+
|
|
228
314
|
[flyy sendEventWithKey:key value:value onComplete: ^(BOOL success) {
|
|
229
315
|
if(success) {
|
|
230
316
|
callback(@[@("success")]);
|
|
@@ -265,7 +351,7 @@ RCT_EXPORT_METHOD(addUserToSegment: (NSString *)segmentTitle withString:(NSStrin
|
|
|
265
351
|
{
|
|
266
352
|
//Instance of flyy class
|
|
267
353
|
flyy = [Flyy sharedFlyyInstance];
|
|
268
|
-
|
|
354
|
+
|
|
269
355
|
[flyy addUserToSegmentWithSegmentTitle:segmentTitle segmentKey:segmentKey onComplete: ^(BOOL success) {
|
|
270
356
|
if(success) {
|
|
271
357
|
// callback(@[@("success")]);
|
|
@@ -307,7 +393,7 @@ RCT_EXPORT_METHOD(getReferralCode: (RCTResponseSenderBlock)callback) {
|
|
|
307
393
|
RCT_EXPORT_METHOD(setSegmentId: (NSString *)segmentId) {
|
|
308
394
|
//Instance of flyy class
|
|
309
395
|
flyy = [Flyy sharedFlyyInstance];
|
|
310
|
-
|
|
396
|
+
|
|
311
397
|
[flyy setSegmentIdWithSegementId:segmentId];
|
|
312
398
|
}
|
|
313
399
|
|
|
@@ -316,7 +402,7 @@ RCT_EXPORT_METHOD(verifyReferralCode: (NSString *)referralCode :(RCTResponseSend
|
|
|
316
402
|
{
|
|
317
403
|
//Instance of flyy class
|
|
318
404
|
flyy = [Flyy sharedFlyyInstance];
|
|
319
|
-
|
|
405
|
+
|
|
320
406
|
[flyy verifyReferralCodeWithReferralCode:referralCode onComplete:^(bool isValid, NSString* referralUrl) {
|
|
321
407
|
if (isValid) {
|
|
322
408
|
callback(@[@"true", referralUrl]);
|
|
@@ -331,7 +417,7 @@ RCT_EXPORT_METHOD(getShareData: (RCTResponseSenderBlock)callback)
|
|
|
331
417
|
{
|
|
332
418
|
//Instance of flyy class
|
|
333
419
|
flyy = [Flyy sharedFlyyInstance];
|
|
334
|
-
|
|
420
|
+
|
|
335
421
|
[flyy getShareDataOnComplete: ^(BOOL success, NSArray<NSString *> *referralDetails) {
|
|
336
422
|
if (success) {
|
|
337
423
|
NSDictionary* jsonObject = @{ @"success": @true,
|
|
@@ -348,8 +434,8 @@ RCT_EXPORT_METHOD(getShareData: (RCTResponseSenderBlock)callback)
|
|
|
348
434
|
};
|
|
349
435
|
callback(@[jsonObject]);
|
|
350
436
|
}
|
|
351
|
-
|
|
352
|
-
|
|
437
|
+
|
|
438
|
+
|
|
353
439
|
}];
|
|
354
440
|
}
|
|
355
441
|
|
|
@@ -358,7 +444,7 @@ RCT_EXPORT_METHOD(getShareDataWithOfferId: (int)offerId :(RCTResponseSenderBlock
|
|
|
358
444
|
{
|
|
359
445
|
//Instance of flyy class
|
|
360
446
|
flyy = [Flyy sharedFlyyInstance];
|
|
361
|
-
|
|
447
|
+
|
|
362
448
|
[flyy getShareDataWithOfferId:offerId onComplete:^(BOOL success, NSArray<NSString *> *referralDetails) {
|
|
363
449
|
if (success) {
|
|
364
450
|
NSDictionary* jsonObject = @{ @"success": @true,
|
|
@@ -375,8 +461,8 @@ RCT_EXPORT_METHOD(getShareDataWithOfferId: (int)offerId :(RCTResponseSenderBlock
|
|
|
375
461
|
};
|
|
376
462
|
callback(@[jsonObject]);
|
|
377
463
|
}
|
|
378
|
-
|
|
379
|
-
|
|
464
|
+
|
|
465
|
+
|
|
380
466
|
}];
|
|
381
467
|
}
|
|
382
468
|
|
|
@@ -385,22 +471,22 @@ RCT_EXPORT_METHOD(getReferralCount:(RCTResponseSenderBlock)callback)
|
|
|
385
471
|
{
|
|
386
472
|
//Instance of flyy class
|
|
387
473
|
flyy = [Flyy sharedFlyyInstance];
|
|
388
|
-
|
|
474
|
+
|
|
389
475
|
[flyy getReferralCountOnComplete:^(BOOL success, NSInteger referralCount) {
|
|
390
476
|
callback(@[@(referralCount)]);
|
|
391
477
|
}];
|
|
392
|
-
|
|
478
|
+
|
|
393
479
|
}
|
|
394
480
|
|
|
395
481
|
//set theme color
|
|
396
482
|
RCT_EXPORT_METHOD(setThemeColor: (NSString *)colorPrimary :(NSString *)colorPrimaryDark)
|
|
397
483
|
{
|
|
398
484
|
themeColor = colorPrimary;
|
|
399
|
-
|
|
485
|
+
|
|
400
486
|
//Instance of flyy class
|
|
401
487
|
flyy = [Flyy sharedFlyyInstance];
|
|
402
488
|
[flyy setThemeColorWithColorPrimary:colorPrimary colorPrimaryDark:colorPrimaryDark];
|
|
403
|
-
|
|
489
|
+
|
|
404
490
|
}
|
|
405
491
|
|
|
406
492
|
//set user token
|
|
@@ -506,9 +592,9 @@ RCT_EXPORT_METHOD(getScratchCardCount: (RCTResponseSenderBlock)callback)
|
|
|
506
592
|
};
|
|
507
593
|
callback(@[jsonObject]);
|
|
508
594
|
}
|
|
509
|
-
|
|
595
|
+
|
|
510
596
|
}];
|
|
511
|
-
|
|
597
|
+
|
|
512
598
|
}
|
|
513
599
|
|
|
514
600
|
//get wallet balance
|
|
@@ -533,7 +619,7 @@ RCT_EXPORT_METHOD(getWalletBalance: (NSString *)walletLabel :(RCTResponseSenderB
|
|
|
533
619
|
callback(@[jsonObject]);
|
|
534
620
|
}
|
|
535
621
|
}];
|
|
536
|
-
|
|
622
|
+
|
|
537
623
|
}
|
|
538
624
|
|
|
539
625
|
//get referrer details
|
|
@@ -558,7 +644,7 @@ RCT_EXPORT_METHOD(getReferrerDetails: (RCTResponseSenderBlock)callback)
|
|
|
558
644
|
callback(@[jsonObject]);
|
|
559
645
|
}
|
|
560
646
|
}];
|
|
561
|
-
|
|
647
|
+
|
|
562
648
|
}
|
|
563
649
|
|
|
564
650
|
//TODO VISHAL
|
|
@@ -585,7 +671,7 @@ RCT_EXPORT_METHOD(getPreviousLeaderboardWinners: (NSString *)tag :(RCTResponseSe
|
|
|
585
671
|
};
|
|
586
672
|
callback(@[jsonObject]);
|
|
587
673
|
}
|
|
588
|
-
|
|
674
|
+
|
|
589
675
|
}];
|
|
590
676
|
}
|
|
591
677
|
|
|
@@ -612,7 +698,7 @@ RCT_EXPORT_METHOD(getLeaderboardParticipants: (NSString *)tag :(RCTResponseSende
|
|
|
612
698
|
};
|
|
613
699
|
callback(@[jsonObject]);
|
|
614
700
|
}
|
|
615
|
-
|
|
701
|
+
|
|
616
702
|
}];
|
|
617
703
|
}
|
|
618
704
|
|
|
@@ -638,16 +724,16 @@ RCT_EXPORT_METHOD(handleBackgroundNotification: (NSString *)remoteMessageString)
|
|
|
638
724
|
//Instance of flyy class
|
|
639
725
|
flyy = [Flyy sharedFlyyInstance];
|
|
640
726
|
NSLog(@"userinfo %@",remoteMessageString);
|
|
641
|
-
|
|
727
|
+
|
|
642
728
|
if (remoteMessageString != nil) {
|
|
643
|
-
|
|
729
|
+
|
|
644
730
|
NSError * err;
|
|
645
731
|
NSData *data = [remoteMessageString dataUsingEncoding:NSUTF8StringEncoding];
|
|
646
732
|
NSDictionary * userInfo;
|
|
647
733
|
if(data!=nil){
|
|
648
734
|
userInfo = (NSDictionary *)[NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:&err];
|
|
649
735
|
}
|
|
650
|
-
|
|
736
|
+
|
|
651
737
|
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
652
738
|
dispatch_async(dispatch_get_main_queue(), ^(){
|
|
653
739
|
[self->flyy handleBackgroundNotificationWithUserInfo:userInfo];
|
|
@@ -661,7 +747,7 @@ RCT_EXPORT_METHOD(handleForegroundNotification: (NSString *)remoteMessageString)
|
|
|
661
747
|
//Instance of flyy class
|
|
662
748
|
flyy = [Flyy sharedFlyyInstance];
|
|
663
749
|
NSLog(@"userinfo %@",remoteMessageString);
|
|
664
|
-
|
|
750
|
+
|
|
665
751
|
if (remoteMessageString != nil) {
|
|
666
752
|
NSError * err;
|
|
667
753
|
NSData *data = [remoteMessageString dataUsingEncoding:NSUTF8StringEncoding];
|
|
@@ -669,7 +755,7 @@ RCT_EXPORT_METHOD(handleForegroundNotification: (NSString *)remoteMessageString)
|
|
|
669
755
|
if(data!=nil){
|
|
670
756
|
userInfo = (NSDictionary *)[NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:&err];
|
|
671
757
|
}
|
|
672
|
-
|
|
758
|
+
|
|
673
759
|
[self->flyy handleForegroundNotificationWithUserInfo:userInfo];
|
|
674
760
|
|
|
675
761
|
// dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
@@ -696,7 +782,7 @@ RCT_EXPORT_METHOD(getOffersCount: (RCTResponseSenderBlock)callback)
|
|
|
696
782
|
{
|
|
697
783
|
//Instance of flyy class
|
|
698
784
|
flyy = [Flyy sharedFlyyInstance];
|
|
699
|
-
|
|
785
|
+
|
|
700
786
|
[flyy getOffersCountOnComplete: ^(BOOL success, NSArray<NSNumber *> *offersCount) {
|
|
701
787
|
if (success) {
|
|
702
788
|
NSDictionary* jsonObject = @{ @"success": @true,
|
|
@@ -712,18 +798,18 @@ RCT_EXPORT_METHOD(getOffersCount: (RCTResponseSenderBlock)callback)
|
|
|
712
798
|
callback(@[jsonObject]);
|
|
713
799
|
}
|
|
714
800
|
}];
|
|
715
|
-
|
|
801
|
+
|
|
716
802
|
}
|
|
717
803
|
|
|
718
804
|
//open offers screen
|
|
719
805
|
RCT_EXPORT_METHOD(openOffersScreen)
|
|
720
806
|
{
|
|
721
807
|
flyy = [Flyy sharedFlyyInstance];
|
|
722
|
-
|
|
808
|
+
|
|
723
809
|
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
724
|
-
|
|
810
|
+
|
|
725
811
|
dispatch_async(dispatch_get_main_queue(), ^(){
|
|
726
|
-
|
|
812
|
+
|
|
727
813
|
[self->flyy openOffersPage];
|
|
728
814
|
});
|
|
729
815
|
});
|
|
@@ -735,30 +821,30 @@ RCT_EXPORT_METHOD(openOffersScreenWithCallBack: (RCTResponseSenderBlock)callback
|
|
|
735
821
|
flyy = [Flyy sharedFlyyInstance];
|
|
736
822
|
sdkClosedCallback = callback;
|
|
737
823
|
[flyy setSDKClosedListenerWithFlyysdkclosedlistener:self];
|
|
738
|
-
|
|
824
|
+
|
|
739
825
|
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
740
|
-
|
|
826
|
+
|
|
741
827
|
dispatch_async(dispatch_get_main_queue(), ^(){
|
|
742
|
-
|
|
828
|
+
|
|
743
829
|
[self->flyy openOffersPage];
|
|
744
830
|
});
|
|
745
831
|
});
|
|
746
|
-
|
|
832
|
+
|
|
747
833
|
}
|
|
748
834
|
|
|
749
835
|
//open offers screen with segemnt id
|
|
750
836
|
RCT_EXPORT_METHOD(openOffersScreenWithSegment: (NSString *)segmentId)
|
|
751
837
|
{
|
|
752
838
|
flyy = [Flyy sharedFlyyInstance];
|
|
753
|
-
|
|
839
|
+
|
|
754
840
|
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
755
|
-
|
|
841
|
+
|
|
756
842
|
dispatch_async(dispatch_get_main_queue(), ^(){
|
|
757
|
-
|
|
843
|
+
|
|
758
844
|
[self->flyy openOffersPageWithSegmentId:segmentId];
|
|
759
845
|
});
|
|
760
846
|
});
|
|
761
|
-
|
|
847
|
+
|
|
762
848
|
}
|
|
763
849
|
|
|
764
850
|
//open offers screen with segment and callback
|
|
@@ -767,30 +853,30 @@ RCT_EXPORT_METHOD(openOffersScreenWithSegmentCallBack: (NSString *)segmentId :(R
|
|
|
767
853
|
flyy = [Flyy sharedFlyyInstance];
|
|
768
854
|
sdkClosedCallback = callback;
|
|
769
855
|
[flyy setSDKClosedListenerWithFlyysdkclosedlistener:self];
|
|
770
|
-
|
|
856
|
+
|
|
771
857
|
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
772
|
-
|
|
858
|
+
|
|
773
859
|
dispatch_async(dispatch_get_main_queue(), ^(){
|
|
774
|
-
|
|
860
|
+
|
|
775
861
|
[self->flyy openOffersPageWithSegmentId:segmentId];
|
|
776
862
|
});
|
|
777
863
|
});
|
|
778
|
-
|
|
864
|
+
|
|
779
865
|
}
|
|
780
866
|
|
|
781
867
|
//open rewards screen
|
|
782
868
|
RCT_EXPORT_METHOD(openRewardsScreen)
|
|
783
869
|
{
|
|
784
870
|
flyy = [Flyy sharedFlyyInstance];
|
|
785
|
-
|
|
871
|
+
|
|
786
872
|
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
787
|
-
|
|
873
|
+
|
|
788
874
|
dispatch_async(dispatch_get_main_queue(), ^(){
|
|
789
|
-
|
|
875
|
+
|
|
790
876
|
[self->flyy openRewardsPage];
|
|
791
877
|
});
|
|
792
878
|
});
|
|
793
|
-
|
|
879
|
+
|
|
794
880
|
}
|
|
795
881
|
|
|
796
882
|
//open rewards screen with callback
|
|
@@ -799,30 +885,30 @@ RCT_EXPORT_METHOD(openRewardsScreenWithCallBack: (RCTResponseSenderBlock)callbac
|
|
|
799
885
|
flyy = [Flyy sharedFlyyInstance];
|
|
800
886
|
sdkClosedCallback = callback;
|
|
801
887
|
[flyy setSDKClosedListenerWithFlyysdkclosedlistener:self];
|
|
802
|
-
|
|
888
|
+
|
|
803
889
|
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
804
|
-
|
|
890
|
+
|
|
805
891
|
dispatch_async(dispatch_get_main_queue(), ^(){
|
|
806
|
-
|
|
892
|
+
|
|
807
893
|
[self->flyy openRewardsPage];
|
|
808
894
|
});
|
|
809
895
|
});
|
|
810
|
-
|
|
896
|
+
|
|
811
897
|
}
|
|
812
898
|
|
|
813
899
|
//open wallet screen
|
|
814
900
|
RCT_EXPORT_METHOD(openWalletScreen)
|
|
815
901
|
{
|
|
816
902
|
flyy = [Flyy sharedFlyyInstance];
|
|
817
|
-
|
|
903
|
+
|
|
818
904
|
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
819
|
-
|
|
905
|
+
|
|
820
906
|
dispatch_async(dispatch_get_main_queue(), ^(){
|
|
821
|
-
|
|
907
|
+
|
|
822
908
|
[self->flyy openWalletPage];
|
|
823
909
|
});
|
|
824
910
|
});
|
|
825
|
-
|
|
911
|
+
|
|
826
912
|
}
|
|
827
913
|
|
|
828
914
|
//open wallet screen with callback
|
|
@@ -831,15 +917,15 @@ RCT_EXPORT_METHOD(openWalletScreenWithCallBack: (RCTResponseSenderBlock)callback
|
|
|
831
917
|
flyy = [Flyy sharedFlyyInstance];
|
|
832
918
|
sdkClosedCallback = callback;
|
|
833
919
|
[flyy setSDKClosedListenerWithFlyysdkclosedlistener:self];
|
|
834
|
-
|
|
920
|
+
|
|
835
921
|
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
836
|
-
|
|
922
|
+
|
|
837
923
|
dispatch_async(dispatch_get_main_queue(), ^(){
|
|
838
|
-
|
|
924
|
+
|
|
839
925
|
[self->flyy openWalletPage];
|
|
840
926
|
});
|
|
841
927
|
});
|
|
842
|
-
|
|
928
|
+
|
|
843
929
|
}
|
|
844
930
|
|
|
845
931
|
//open gift cards screen
|
|
@@ -847,24 +933,24 @@ RCT_EXPORT_METHOD(openGiftCardScreen)
|
|
|
847
933
|
{
|
|
848
934
|
flyy = [Flyy sharedFlyyInstance];
|
|
849
935
|
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
850
|
-
|
|
936
|
+
|
|
851
937
|
dispatch_async(dispatch_get_main_queue(), ^(){
|
|
852
|
-
|
|
938
|
+
|
|
853
939
|
[self->flyy openGiftCardPage];
|
|
854
940
|
});
|
|
855
941
|
});
|
|
856
|
-
|
|
942
|
+
|
|
857
943
|
}
|
|
858
944
|
|
|
859
945
|
//open referral history screen
|
|
860
946
|
RCT_EXPORT_METHOD(openReferralHistory)
|
|
861
947
|
{
|
|
862
948
|
flyy = [Flyy sharedFlyyInstance];
|
|
863
|
-
|
|
949
|
+
|
|
864
950
|
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
865
|
-
|
|
951
|
+
|
|
866
952
|
dispatch_async(dispatch_get_main_queue(), ^(){
|
|
867
|
-
|
|
953
|
+
|
|
868
954
|
[self->flyy openReferralHistoryPage];
|
|
869
955
|
});
|
|
870
956
|
});
|
|
@@ -874,11 +960,11 @@ RCT_EXPORT_METHOD(openReferralHistory)
|
|
|
874
960
|
RCT_EXPORT_METHOD(openFlyyQuizPage: (NSInteger)quizId)
|
|
875
961
|
{
|
|
876
962
|
flyy = [Flyy sharedFlyyInstance];
|
|
877
|
-
|
|
963
|
+
|
|
878
964
|
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
879
|
-
|
|
965
|
+
|
|
880
966
|
dispatch_async(dispatch_get_main_queue(), ^(){
|
|
881
|
-
|
|
967
|
+
|
|
882
968
|
[self->flyy openQuizListDetailPageWithQuizId:quizId];
|
|
883
969
|
});
|
|
884
970
|
});
|
|
@@ -888,26 +974,26 @@ RCT_EXPORT_METHOD(openFlyyQuizPage: (NSInteger)quizId)
|
|
|
888
974
|
RCT_EXPORT_METHOD(openFlyyQuizHistoryPage)
|
|
889
975
|
{
|
|
890
976
|
flyy = [Flyy sharedFlyyInstance];
|
|
891
|
-
|
|
977
|
+
|
|
892
978
|
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
893
|
-
|
|
979
|
+
|
|
894
980
|
dispatch_async(dispatch_get_main_queue(), ^(){
|
|
895
|
-
|
|
981
|
+
|
|
896
982
|
[self->flyy openQuizHistoryPage];
|
|
897
983
|
});
|
|
898
984
|
});
|
|
899
|
-
|
|
985
|
+
|
|
900
986
|
}
|
|
901
987
|
|
|
902
988
|
//open quiz list screen
|
|
903
989
|
RCT_EXPORT_METHOD(openFlyyQuizListPage)
|
|
904
990
|
{
|
|
905
991
|
flyy = [Flyy sharedFlyyInstance];
|
|
906
|
-
|
|
992
|
+
|
|
907
993
|
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
908
|
-
|
|
994
|
+
|
|
909
995
|
dispatch_async(dispatch_get_main_queue(), ^(){
|
|
910
|
-
|
|
996
|
+
|
|
911
997
|
[self->flyy openQuizListPage];
|
|
912
998
|
});
|
|
913
999
|
});
|
|
@@ -916,18 +1002,18 @@ RCT_EXPORT_METHOD(openFlyyQuizListPage)
|
|
|
916
1002
|
//open stamps screen
|
|
917
1003
|
RCT_EXPORT_METHOD(openFlyyStampsPage)
|
|
918
1004
|
{
|
|
919
|
-
|
|
1005
|
+
|
|
920
1006
|
}
|
|
921
1007
|
|
|
922
1008
|
//open invite details screen
|
|
923
1009
|
RCT_EXPORT_METHOD(openFlyyInviteDetailsPage: (NSInteger *)offerId)
|
|
924
1010
|
{
|
|
925
1011
|
flyy = [Flyy sharedFlyyInstance];
|
|
926
|
-
|
|
1012
|
+
|
|
927
1013
|
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
928
|
-
|
|
1014
|
+
|
|
929
1015
|
dispatch_async(dispatch_get_main_queue(), ^(){
|
|
930
|
-
|
|
1016
|
+
|
|
931
1017
|
[self->flyy openInviteDetailsPageWithOfferId:*offerId];
|
|
932
1018
|
});
|
|
933
1019
|
});
|
|
@@ -937,11 +1023,11 @@ RCT_EXPORT_METHOD(openFlyyInviteDetailsPage: (NSInteger *)offerId)
|
|
|
937
1023
|
RCT_EXPORT_METHOD(openFlyyChallengeDetailPage: (NSInteger *)offerId)
|
|
938
1024
|
{
|
|
939
1025
|
flyy = [Flyy sharedFlyyInstance];
|
|
940
|
-
|
|
1026
|
+
|
|
941
1027
|
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
942
|
-
|
|
1028
|
+
|
|
943
1029
|
dispatch_async(dispatch_get_main_queue(), ^(){
|
|
944
|
-
|
|
1030
|
+
|
|
945
1031
|
[self->flyy openFlyyChallengesPageWithOfferId:offerId];
|
|
946
1032
|
});
|
|
947
1033
|
});
|
|
@@ -951,25 +1037,53 @@ RCT_EXPORT_METHOD(openFlyyChallengeDetailPage: (NSInteger *)offerId)
|
|
|
951
1037
|
RCT_EXPORT_METHOD(openFlyyBonanzaPage)
|
|
952
1038
|
{
|
|
953
1039
|
flyy = [Flyy sharedFlyyInstance];
|
|
954
|
-
|
|
1040
|
+
|
|
955
1041
|
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
956
|
-
|
|
1042
|
+
|
|
957
1043
|
dispatch_async(dispatch_get_main_queue(), ^(){
|
|
958
|
-
|
|
1044
|
+
|
|
959
1045
|
[self->flyy openBonanzaPage];
|
|
960
1046
|
});
|
|
961
1047
|
});
|
|
962
1048
|
}
|
|
963
1049
|
|
|
1050
|
+
//open games screen
|
|
1051
|
+
RCT_EXPORT_METHOD(openFlyyGamesPage)
|
|
1052
|
+
{
|
|
1053
|
+
flyy = [Flyy sharedFlyyInstance];
|
|
1054
|
+
|
|
1055
|
+
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
1056
|
+
|
|
1057
|
+
dispatch_async(dispatch_get_main_queue(), ^(){
|
|
1058
|
+
|
|
1059
|
+
[self->flyy openGameListPage];
|
|
1060
|
+
});
|
|
1061
|
+
});
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
//open games history screen
|
|
1065
|
+
RCT_EXPORT_METHOD(openFlyyGamesHistory)
|
|
1066
|
+
{
|
|
1067
|
+
flyy = [Flyy sharedFlyyInstance];
|
|
1068
|
+
|
|
1069
|
+
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
1070
|
+
|
|
1071
|
+
dispatch_async(dispatch_get_main_queue(), ^(){
|
|
1072
|
+
|
|
1073
|
+
[self->flyy openGameHistoryPage];
|
|
1074
|
+
});
|
|
1075
|
+
});
|
|
1076
|
+
}
|
|
1077
|
+
|
|
964
1078
|
//open custom invite and earn screen
|
|
965
1079
|
RCT_EXPORT_METHOD(openFlyyCustomInviteAndEarnPage: (NSInteger *)offerId :(NSString *)headerColor)
|
|
966
1080
|
{
|
|
967
1081
|
flyy = [Flyy sharedFlyyInstance];
|
|
968
|
-
|
|
1082
|
+
|
|
969
1083
|
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
970
|
-
|
|
1084
|
+
|
|
971
1085
|
dispatch_async(dispatch_get_main_queue(), ^(){
|
|
972
|
-
|
|
1086
|
+
|
|
973
1087
|
[self->flyy openFlyyCustomInviteAndEarnVCWithOfferId:offerId headerColor:headerColor];
|
|
974
1088
|
});
|
|
975
1089
|
});
|
|
@@ -979,11 +1093,11 @@ RCT_EXPORT_METHOD(openFlyyCustomInviteAndEarnPage: (NSInteger *)offerId :(NSStri
|
|
|
979
1093
|
RCT_EXPORT_METHOD(openFlyyInviteAndEarnPage: (NSInteger *)offerId)
|
|
980
1094
|
{
|
|
981
1095
|
flyy = [Flyy sharedFlyyInstance];
|
|
982
|
-
|
|
1096
|
+
|
|
983
1097
|
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
984
|
-
|
|
1098
|
+
|
|
985
1099
|
dispatch_async(dispatch_get_main_queue(), ^(){
|
|
986
|
-
|
|
1100
|
+
|
|
987
1101
|
[self->flyy openInviteAndEarnPageWithOfferId:offerId];
|
|
988
1102
|
});
|
|
989
1103
|
});
|
|
@@ -993,9 +1107,9 @@ RCT_EXPORT_METHOD(openFlyyInviteAndEarnPage: (NSInteger *)offerId)
|
|
|
993
1107
|
RCT_EXPORT_METHOD(openFlyySpinTheWheelPage: (NSInteger)wheelId)
|
|
994
1108
|
{
|
|
995
1109
|
flyy = [Flyy sharedFlyyInstance];
|
|
996
|
-
|
|
1110
|
+
|
|
997
1111
|
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
998
|
-
|
|
1112
|
+
|
|
999
1113
|
dispatch_async(dispatch_get_main_queue(), ^(){
|
|
1000
1114
|
[self->flyy openSpinTheWheelPageWithSpinWheelId:wheelId];
|
|
1001
1115
|
});
|
|
@@ -1006,10 +1120,24 @@ RCT_EXPORT_METHOD(openFlyySpinTheWheelPage: (NSInteger)wheelId)
|
|
|
1006
1120
|
RCT_EXPORT_METHOD(openFlyyCheckinPage)
|
|
1007
1121
|
{
|
|
1008
1122
|
flyy = [Flyy sharedFlyyInstance];
|
|
1009
|
-
|
|
1123
|
+
|
|
1124
|
+
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
1125
|
+
|
|
1126
|
+
dispatch_async(dispatch_get_main_queue(), ^(){
|
|
1127
|
+
[self->flyy openDailyCheckinPage];
|
|
1128
|
+
});
|
|
1129
|
+
});
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
//open Checkin screen
|
|
1133
|
+
RCT_EXPORT_METHOD(openCheckinScreen)
|
|
1134
|
+
{
|
|
1135
|
+
flyy = [Flyy sharedFlyyInstance];
|
|
1136
|
+
|
|
1010
1137
|
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
1011
|
-
|
|
1138
|
+
|
|
1012
1139
|
dispatch_async(dispatch_get_main_queue(), ^(){
|
|
1140
|
+
|
|
1013
1141
|
[self->flyy openDailyCheckinPage];
|
|
1014
1142
|
});
|
|
1015
1143
|
});
|
|
@@ -1019,20 +1147,46 @@ RCT_EXPORT_METHOD(openFlyyCheckinPage)
|
|
|
1019
1147
|
RCT_EXPORT_METHOD(openFlyyRafflePage: (NSInteger *)raffleId)
|
|
1020
1148
|
{
|
|
1021
1149
|
flyy = [Flyy sharedFlyyInstance];
|
|
1022
|
-
|
|
1150
|
+
|
|
1023
1151
|
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
1024
|
-
|
|
1152
|
+
|
|
1025
1153
|
dispatch_async(dispatch_get_main_queue(), ^(){
|
|
1026
|
-
|
|
1027
|
-
|
|
1154
|
+
|
|
1155
|
+
|
|
1028
1156
|
});
|
|
1029
1157
|
});
|
|
1030
1158
|
}
|
|
1031
1159
|
|
|
1160
|
+
//get user data
|
|
1161
|
+
RCT_EXPORT_METHOD(getUserData:(RCTPromiseResolveBlock)resolve
|
|
1162
|
+
rejecter:(RCTPromiseRejectBlock)reject)
|
|
1163
|
+
{
|
|
1164
|
+
NSDictionary* jsonObject = @{ @"partner_id": extPartnerId,
|
|
1165
|
+
@"user_id": extUserId,
|
|
1166
|
+
@"environment": [NSNumber numberWithInt: extEnvironment]
|
|
1167
|
+
};
|
|
1168
|
+
|
|
1169
|
+
resolve(jsonObject);
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
// get App data
|
|
1173
|
+
RCT_EXPORT_METHOD(getAppData:(RCTPromiseResolveBlock)resolve
|
|
1174
|
+
rejecter:(RCTPromiseRejectBlock)reject)
|
|
1175
|
+
{
|
|
1176
|
+
//Instance of flyy class
|
|
1177
|
+
flyy = [Flyy sharedFlyyInstance];
|
|
1178
|
+
[flyy getFlyyAppDataOnComplete:^(NSString * _Nonnull data) {
|
|
1179
|
+
resolve(data);
|
|
1180
|
+
}];
|
|
1181
|
+
// resolve(@"Hello");
|
|
1182
|
+
}
|
|
1183
|
+
|
|
1184
|
+
|
|
1185
|
+
|
|
1032
1186
|
//our internal protocol stub method
|
|
1033
1187
|
- (void)onSDKClosedWithScreenName:(NSString * _Nonnull)screenName {
|
|
1034
1188
|
NSLog(@"%@", screenName);
|
|
1035
|
-
|
|
1189
|
+
|
|
1036
1190
|
if(sdkClosedCallback != nil) {
|
|
1037
1191
|
sdkClosedCallback(@[@("success")]);
|
|
1038
1192
|
sdkClosedCallback = nil;
|