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