react-native-flyy 1.4.31 → 1.4.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/android/.project +1 -1
  2. package/android/.settings/org.eclipse.buildship.core.prefs +2 -5
  3. package/android/build.gradle +1 -1
  4. package/android/src/main/java/com/reactnativeflyy/FlyyModule.kt +49 -155
  5. package/android/src/main/java/com/reactnativeflyy/FlyyRouteActivity.java +0 -16
  6. package/ios/ReactNativeFlyy.m +122 -276
  7. package/lib/commonjs/index.js +3 -591
  8. package/lib/commonjs/index.js.map +1 -1
  9. package/lib/module/index.js +3 -579
  10. package/lib/module/index.js.map +1 -1
  11. package/lib/typescript/index.d.ts +0 -12
  12. package/package.json +1 -1
  13. package/react-native-flyy.podspec +1 -1
  14. package/src/index.tsx +1 -543
  15. package/ios/Montserrat-Bold.ttf +0 -0
  16. package/lib/commonjs/assets/images/check.png +0 -0
  17. package/lib/commonjs/assets/images/medal.png +0 -0
  18. package/lib/commonjs/assets/images/radio.png +0 -0
  19. package/lib/commonjs/assets/images/reward_flyy.png +0 -0
  20. package/lib/commonjs/assets/images/xmark.png +0 -0
  21. package/lib/commonjs/flyy_checkin_view.js +0 -379
  22. package/lib/commonjs/flyy_checkin_view.js.map +0 -1
  23. package/lib/module/assets/images/check.png +0 -0
  24. package/lib/module/assets/images/medal.png +0 -0
  25. package/lib/module/assets/images/radio.png +0 -0
  26. package/lib/module/assets/images/reward_flyy.png +0 -0
  27. package/lib/module/assets/images/xmark.png +0 -0
  28. package/lib/module/flyy_checkin_view.js +0 -365
  29. package/lib/module/flyy_checkin_view.js.map +0 -1
  30. package/lib/typescript/flyy_checkin_view.d.ts +0 -19
  31. package/src/assets/images/check.png +0 -0
  32. package/src/assets/images/medal.png +0 -0
  33. package/src/assets/images/radio.png +0 -0
  34. package/src/assets/images/reward_flyy.png +0 -0
  35. package/src/assets/images/xmark.png +0 -0
  36. package/src/flyy_checkin_view.tsx +0 -213
@@ -1,351 +1,9 @@
1
- // @ts-nocheck
2
- import React, { useEffect, useState } from 'react';
3
- import { Image, NativeModules, Text, TouchableOpacity, View, Dimensions, FlatList } from 'react-native';
4
- import FlyyCheckinComponent from './flyy_checkin_view';
1
+ import React from 'react';
2
+ import { Image, NativeModules, Text, TouchableOpacity, View } from 'react-native';
5
3
  const {
6
4
  Flyy
7
5
  } = NativeModules;
8
- export default Flyy; // ****** Flyy CheckinView Widget ******
9
-
10
- export const FlyyCheckinView = props => {
11
- return /*#__PURE__*/React.createElement(FlyyCheckinComponent, {
12
- style: {
13
- checkInBtnTextColor: props.checkInBtnTextColor,
14
- checkInTitleColor: props.checkInTitleColor,
15
- checkInDescriptionColor: props.checkInDescriptionColor,
16
- checkInDaysColor: props.checkInDaysColor,
17
- checkInEarnColor: props.checkInEarnColor,
18
- fontFamily: props.fontFamily
19
- }
20
- });
21
- };
22
- const windowHeight = Dimensions.get('window').height;
23
- const windowWidth = Dimensions.get('window').width; // ****** Flyy Floating Widget ******
24
- // export const FlyyFloatingWidget = ({
25
- // props = {
26
- // backgroundColor: "#654EA3",
27
- // buttonHeight: 55,
28
- // buttonWidth: 55,
29
- // buttonCornerRadius: 40,
30
- // buttonIcon: require('./assets/images/rewardwidget.png'),
31
- // onPress: () => { },
32
- // x: windowWidth - 75,
33
- // y: windowHeight - 100,
34
- // minX: 5,
35
- // minY: 5,
36
- // maxX: windowWidth - 5,
37
- // maxY: windowHeight - 5,
38
- // show: true,
39
- // stick: false,
40
- // startDate: 0,
41
- // endDate: 0
42
- // } }) => {
43
- // const [showWidget,setShowWidget] = useState(false);
44
- // const [userData,setUserData] = useState({});
45
- // const [iconUrl,setIconUrl] = useState(require('./assets/images/rewardwidget.png'));
46
- // const [backgroundColor,setBackgroundColor] = useState("#654EA3");
47
- // const [buttonSize,setButtonSize] = useState(55);
48
- // const [buttonXPosition,setButtonXPosition] = useState(windowWidth - 75);
49
- // const [buttonYPosition,setButtonYPosition] = useState(windowHeight - 100);
50
- // const [deeplink,setDeeplink] = useState(null);
51
- // const flyyConfigDate = "flyy_config_date";
52
- // const flyyConfigUserId = "user_id";
53
- // var oldState = null;
54
- // var currentState = null;
55
- // var data = null;
56
- // useEffect(()=>{
57
- // fetchData();
58
- // },[]);
59
- // const fetchData = async() => {
60
- // const sdkInfo = await Flyy.getUserData();
61
- // const appData = await Flyy.getAppData();
62
- // const resp = await fetch(`https://${sdkInfo["environment"] == 0 ? "ghc-stage" : "ghc"}.theflyy.com/api/v8/flyy_app_info`, {
63
- // headers: {
64
- // "X-Key": sdkInfo["partner_id"],
65
- // "Content-Type": "application/json",
66
- // "X-App-Data": appData
67
- // }
68
- // });
69
- // data = await resp.json();
70
- // if(!data.success){
71
- // if (Platform.OS === 'android') {
72
- // ToastAndroid.show(data.message, ToastAndroid.SHORT);
73
- // } else {
74
- // // Toast.showWithGravity(data.message, Toast.SHORT, Toast.BOTTOM);
75
- // }
76
- // return;
77
- // }
78
- // const widgetConfig = data.info.floating_widget_configuration;
79
- // if (widgetConfig.icon_url != null && widgetConfig.icon_url != '') {
80
- // setIconUrl({ uri: widgetConfig.icon_url })
81
- // } else {
82
- // setIconUrl(props.buttonIcon)
83
- // }
84
- // if (widgetConfig.color != null && widgetConfig.color != '') {
85
- // setBackgroundColor(widgetConfig.color)
86
- // } else {
87
- // setBackgroundColor(props.backgroundColor)
88
- // }
89
- // if (widgetConfig.size != null && widgetConfig.color != 0) {
90
- // setButtonSize(parseInt(data.info.floating_widget_configuration.size))
91
- // } else {
92
- // setButtonSize(props.buttonHeight)
93
- // }
94
- // //FloatingButton Position
95
- // if (widgetConfig.position == "bottom_left") {
96
- // setButtonXPosition(10)
97
- // } else if (widgetConfig.position == "bottom_right") {
98
- // setButtonXPosition(windowWidth - 75)
99
- // } else if (widgetConfig.position == "upper_left") {
100
- // setButtonXPosition(10)
101
- // if (Platform.OS === 'android'){
102
- // setButtonYPosition(10)
103
- // }else{
104
- // setButtonYPosition(50)
105
- // }
106
- // } else if (widgetConfig.position == "upper_right") {
107
- // setButtonXPosition(windowWidth - 75)
108
- // if (Platform.OS === 'android'){
109
- // setButtonYPosition(10)
110
- // }else{
111
- // setButtonYPosition(50)
112
- // }
113
- // }
114
- // //Set DeepLink
115
- // if (widgetConfig.deeplink != null && widgetConfig.deeplink != "") {
116
- // setDeeplink(widgetConfig.deeplink)
117
- // }
118
- // //Set Visibility of FloatingButton
119
- // var currentDate = new Date();
120
- // const getDate = await AsyncStorage.getItem(flyyConfigDate);
121
- // const userId = await AsyncStorage.getItem(flyyConfigUserId);
122
- // var date = new Date(parseInt(getDate));
123
- // const diffTime = Math.abs(getDate - currentDate);
124
- // const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24))-1;
125
- // if(diffDays != 0 || userId == null || userId != sdkInfo[flyyConfigUserId]){
126
- // var data = await Flyy.getAppOccurence(1);
127
- // await AsyncStorage.setItem(
128
- // flyyConfigUserId,
129
- // sdkInfo[flyyConfigUserId]
130
- // );
131
- // }
132
- // const occurrenceCount = await Flyy.getAppOccurence(0);
133
- // if (widgetConfig.show_to_user && occurrenceCount <= parseInt(widgetConfig.num_times)) {
134
- // // var numberOfDaysToAdd = widgetConfig.num_days+1;
135
- // // var result = currentDate.setDate(currentDate.getDate() + numberOfDaysToAdd);
136
- // if(getDate === null || userId == null || userId != sdkInfo[flyyConfigUserId]){
137
- // await AsyncStorage.setItem(
138
- // flyyConfigDate,
139
- // JSON.stringify(currentDate.getTime())
140
- // );
141
- // }
142
- // const getDate2 = await AsyncStorage.getItem(flyyConfigDate);
143
- // var date = new Date(parseInt(getDate2));
144
- // const diffTime = Math.abs(getDate2 - currentDate);
145
- // const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24))-1;
146
- // //Show widget on same day
147
- // if(diffDays === 0 || diffDays === -1){
148
- // setShowWidget(true)
149
- // }else{
150
- // //reset occurrence on next day
151
- // await Flyy.getAppOccurence(1);
152
- // if(diffDays >= parseInt(widgetConfig.num_days)+1){
153
- // await AsyncStorage.setItem(
154
- // flyyConfigDate,
155
- // JSON.stringify(currentDate.getTime())
156
- // );
157
- // setShowWidget(true)
158
- // }
159
- // }
160
- // }else{
161
- // setShowWidget(false);
162
- // const getDate2 = await AsyncStorage.getItem(flyyConfigDate);
163
- // var date = new Date(parseInt(getDate2));
164
- // const diffTime = Math.abs(getDate2 - currentDate);
165
- // const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
166
- // if(diffDays != 1){
167
- // var data = await Flyy.getAppOccurence(1);
168
- // }
169
- // }
170
- // }
171
- // // if(props.show){
172
- // // if(props.startDate != null && props.startDate != 0){
173
- // // var now = new Date().getTime();
174
- // // if(now >= props.startDate && now <= props.endDate){
175
- // // props.show = true
176
- // // }else{
177
- // // props.show = false
178
- // // }
179
- // // }
180
- // // }
181
- // // AppState.addEventListener('change', state =>{
182
- // // console.log('AppState updated to', AppState.currentState)
183
- // // oldState = currentState;
184
- // // currentState = state;
185
- // // if(oldState == null){
186
- // // console.log('App is newly start :::')
187
- // // }})
188
- // return (
189
- // // @ts-ignore
190
- // props.show && showWidget? <Draggable x={buttonXPosition}
191
- // y={buttonYPosition}
192
- // minX={props.minX ?? 5}
193
- // minY={props.minY ?? 5}
194
- // maxX={props.maxX ?? windowWidth - 5}
195
- // maxY={props.maxY ?? windowHeight - 5}
196
- // renderSize={56}
197
- // // shouldReverse = {true}
198
- // onDragRelease={props.stick ? () => {
199
- // } : null} isCircle>
200
- // <TouchableOpacity
201
- // onPress={deeplink != null ? async()=>{
202
- // if (Platform.OS === 'android' || !deeplink.startsWith("flyy://")) {
203
- // const supported = await Linking.canOpenURL(deeplink);
204
- // await Linking.openURL(deeplink);
205
- // } else {
206
- // navigateTo(deeplink);
207
- // }
208
- // }:props.onPress}
209
- // style={{
210
- // height: buttonSize,
211
- // width: buttonSize,
212
- // backgroundColor: backgroundColor,
213
- // borderRadius: buttonSize/2,
214
- // justifyContent: 'center',
215
- // alignItems: 'center',
216
- // }}>
217
- // <Image source={iconUrl} style={{ height: buttonSize*55/100, width: buttonSize*55/100 }} />
218
- // <TouchableOpacity
219
- // onPress={()=>{
220
- // props.show = false;
221
- // setShowWidget(false);
222
- // }}
223
- // style = {{height: 20, width: 20, backgroundColor: "transparent",position:'absolute',left:buttonSize-11, bottom: buttonSize*72/100}}>
224
- // <Image source={require('./assets/images/xmark.png')} style={{ height: 18, width: 18, tintColor: "black"}} />
225
- // </TouchableOpacity>
226
- // </TouchableOpacity>
227
- // </Draggable> : <View/>
228
- // );
229
- // }
230
-
231
- const navigateTo = deeplink => {
232
- let components = deeplink.split("/");
233
- let screenCode = components[components.length - 1];
234
-
235
- switch (screenCode) {
236
- case "flyy_offers":
237
- {
238
- Flyy.openOffersScreen();
239
- }
240
- break;
241
-
242
- case "challenge_details":
243
- {
244
- Flyy.openFlyyChallengeDetailPage(0);
245
- }
246
- break;
247
-
248
- case "flyy_quiz_list":
249
- {
250
- Flyy.openFlyyQuizListPage();
251
- }
252
- break;
253
-
254
- case "stamp_campaign_new":
255
- {
256
- Flyy.openFlyyStampsPage();
257
- }
258
- break;
259
-
260
- case "campaign_home":
261
- {
262
- Flyy.openFlyyStampsPage();
263
- }
264
- break;
265
-
266
- case "bonanza_details":
267
- {
268
- Flyy.openFlyyBonanzaPage();
269
- }
270
- break;
271
-
272
- case "invite_earn":
273
- {
274
- Flyy.openFlyyInviteAndEarnPage(0);
275
- }
276
- break;
277
-
278
- case "invite_details":
279
- {
280
- Flyy.openFlyyInviteDetailsPage(0);
281
- }
282
- break;
283
-
284
- case "custom_invite_details":
285
- {
286
- Flyy.openFlyyCustomInviteAndEarnPage(0, FlyyFlutterPlugin.themeColor);
287
- }
288
- break;
289
-
290
- case "raffle_details":
291
- {
292
- Flyy.openFlyyRafflePage(0);
293
- }
294
- break;
295
-
296
- case "quiz_history":
297
- {
298
- Flyy.openFlyyQuizHistoryPage();
299
- }
300
- break;
301
-
302
- case "flyy_rewards":
303
- {
304
- Flyy.openRewardsScreen();
305
- }
306
- break;
307
-
308
- case "flyy_referrals":
309
- {
310
- Flyy.openReferralHistory();
311
- }
312
- break;
313
-
314
- case "flyy_gift_cards":
315
- {
316
- Flyy.openGiftCardScreen();
317
- }
318
- break;
319
-
320
- case "flyy_wallet":
321
- {
322
- Flyy.openWalletScreen();
323
- }
324
- break;
325
-
326
- case "game_list":
327
- {
328
- Flyy.openFlyyGamesPage();
329
- }
330
- break;
331
-
332
- case "flyy_bonanza":
333
- {
334
- Flyy.openFlyyBonanzaPage();
335
- }
336
- break;
337
-
338
- case "flyy_quiz_detail":
339
- {
340
- Flyy.openFlyyQuizPage(0);
341
- }
342
- break;
343
-
344
- default: // Toast.showWithGravity("ACTION NOT FOUND", Toast.SHORT, Toast.BOTTOM);
345
-
346
- }
347
- };
348
-
6
+ export default Flyy;
349
7
  export const FlyyWidget = ({
350
8
  widgetStyle = {
351
9
  rewardsButtonIcon: require('./assets/images/rewardwidget.png'),
@@ -480,239 +138,5 @@ const FlyyCardView = ({
480
138
  height: 10
481
139
  }
482
140
  }));
483
- }; // ****** Flyy Stories Widget ******
484
-
485
-
486
- export const FlyyStories = ({
487
- widgetStyle = {
488
- titleColor: 'black',
489
- iconButtonBgColor: '#654EA3',
490
- fontSize: 16.0,
491
- iconCornerRadius: 55,
492
- iconSize: 60,
493
- iconBgSize: 100
494
- }
495
- }) => {
496
- const [data, setData] = useState(null);
497
- useEffect(() => {
498
- fetchStoriesData();
499
- }, []);
500
-
501
- const fetchStoriesData = async () => {
502
- const sdkInfo = await Flyy.getUserData();
503
- const appData = await Flyy.getAppData();
504
- const resp = await fetch(`https://${sdkInfo["environment"] == 0 ? "ghc-stage" : "ghc"}.theflyy.com/api/storyboard`, {
505
- headers: {
506
- "X-Key": sdkInfo["partner_id"],
507
- "Content-Type": "application/json",
508
- "X-App-Data": appData
509
- }
510
- });
511
- const responseData = await resp.json();
512
- setData(responseData.storyboard_items);
513
- };
514
-
515
- const navigateTo = screenCode => {
516
- switch (screenCode) {
517
- case "offers":
518
- {
519
- Flyy.openOffersScreen();
520
- }
521
- break;
522
-
523
- case "spin_wheel":
524
- {
525
- Flyy.openFlyySpinTheWheelPage(0);
526
- }
527
- break;
528
-
529
- case "challenge":
530
- {
531
- Flyy.openFlyyChallengeDetailPage(0);
532
- }
533
- break;
534
-
535
- case "quiz_list":
536
- {
537
- Flyy.openFlyyQuizListPage();
538
- }
539
- break;
540
-
541
- case "stamp_campaign":
542
- {
543
- Flyy.openFlyyStampsPage();
544
- }
545
- break;
546
-
547
- case "campaign_home":
548
- {
549
- Flyy.openFlyyStampsPage();
550
- }
551
- break;
552
-
553
- case "bonanza_details":
554
- {
555
- Flyy.openFlyyBonanzaPage();
556
- }
557
- break;
558
-
559
- case "invite_earn":
560
- {
561
- Flyy.openFlyyInviteAndEarnPage(0);
562
- }
563
- break;
564
-
565
- case "invite_details":
566
- {
567
- Flyy.openFlyyInviteDetailsPage(0);
568
- }
569
- break;
570
-
571
- case "custom_invite_details":
572
- {
573
- Flyy.openFlyyCustomInviteAndEarnPage(0, FlyyFlutterPlugin.themeColor);
574
- }
575
- break;
576
-
577
- case "raffle":
578
- {
579
- Flyy.openFlyyRafflePage(0);
580
- }
581
- break;
582
-
583
- case "quiz_history":
584
- {
585
- Flyy.openFlyyQuizHistoryPage();
586
- }
587
- break;
588
-
589
- case "flyy_rewards":
590
- {
591
- Flyy.openRewardsScreen();
592
- }
593
- break;
594
-
595
- case "referrals":
596
- {
597
- Flyy.openReferralHistory();
598
- }
599
- break;
600
-
601
- case "flyy_gift_cards":
602
- {
603
- Flyy.openGiftCardScreen();
604
- }
605
- break;
606
-
607
- case "wallet":
608
- {
609
- Flyy.openWalletScreen();
610
- }
611
- break;
612
-
613
- case "game_list":
614
- {
615
- Flyy.openFlyyGamesPage();
616
- }
617
- break;
618
-
619
- case "bonanza":
620
- {
621
- Flyy.openFlyyBonanzaPage();
622
- }
623
- break;
624
-
625
- case "quiz_detail":
626
- {
627
- Flyy.openFlyyQuizPage(0);
628
- }
629
- break;
630
-
631
- default: // Toast.showWithGravity("ACTION NOT FOUND", Toast.SHORT, Toast.BOTTOM);
632
-
633
- }
634
- };
635
-
636
- const StoriesItem = ({
637
- data
638
- }) => {
639
- var _widgetStyle$iconButt, _widgetStyle$iconBgSi, _widgetStyle$iconBgSi2, _widgetStyle$iconCorn, _widgetStyle$titleCol, _widgetStyle$fontSize;
640
-
641
- return /*#__PURE__*/React.createElement(View, {
642
- style: {
643
- alignItems: 'center'
644
- }
645
- }, /*#__PURE__*/React.createElement(View, {
646
- style: {
647
- height: 10
648
- }
649
- }), /*#__PURE__*/React.createElement(TouchableOpacity, {
650
- onPress: () => {
651
- navigateTo(data.screen_code);
652
- },
653
- style: {
654
- backgroundColor: (_widgetStyle$iconButt = widgetStyle.iconButtonBgColor) !== null && _widgetStyle$iconButt !== void 0 ? _widgetStyle$iconButt : '#654EA3',
655
- height: (_widgetStyle$iconBgSi = widgetStyle.iconBgSize) !== null && _widgetStyle$iconBgSi !== void 0 ? _widgetStyle$iconBgSi : 60,
656
- width: (_widgetStyle$iconBgSi2 = widgetStyle.iconBgSize) !== null && _widgetStyle$iconBgSi2 !== void 0 ? _widgetStyle$iconBgSi2 : 60,
657
- borderRadius: (_widgetStyle$iconCorn = widgetStyle.iconCornerRadius) !== null && _widgetStyle$iconCorn !== void 0 ? _widgetStyle$iconCorn : 55,
658
- alignSelf: 'center',
659
- justifyContent: 'center',
660
- alignItems: 'center',
661
- marginHorizontal: 10
662
- }
663
- }, /*#__PURE__*/React.createElement(Image, {
664
- source: {
665
- uri: data.icon_url
666
- },
667
- style: {
668
- height: 60,
669
- width: 60
670
- }
671
- })), /*#__PURE__*/React.createElement(View, {
672
- style: {
673
- height: 10
674
- }
675
- }), /*#__PURE__*/React.createElement(View, {
676
- style: {
677
- width: 120
678
- }
679
- }, /*#__PURE__*/React.createElement(Text, {
680
- style: {
681
- alignSelf: 'center',
682
- flexShrink: 1,
683
- color: (_widgetStyle$titleCol = widgetStyle.titleColor) !== null && _widgetStyle$titleCol !== void 0 ? _widgetStyle$titleCol : 'black',
684
- fontSize: (_widgetStyle$fontSize = widgetStyle.fontSize) !== null && _widgetStyle$fontSize !== void 0 ? _widgetStyle$fontSize : 14,
685
- fontFamily: 'Montserrat-Bold',
686
- textAlign: 'center',
687
- paddingLeft: 5,
688
- paddingRight: 5
689
- },
690
- numberOfLines: 2
691
- }, data.title)), /*#__PURE__*/React.createElement(View, {
692
- style: {
693
- height: 10
694
- }
695
- }));
696
- };
697
-
698
- return /*#__PURE__*/React.createElement(View, {
699
- style: {
700
- flexDirection: "row",
701
- justifyContent: "center",
702
- width: "100%",
703
- alignItems: 'center',
704
- alignContent: 'center',
705
- backgroundColor: "white"
706
- }
707
- }, /*#__PURE__*/React.createElement(FlatList, {
708
- horizontal: true,
709
- data: data,
710
- renderItem: ({
711
- item
712
- }) => /*#__PURE__*/React.createElement(StoriesItem, {
713
- data: item
714
- }),
715
- keyExtractor: item => item.id
716
- }));
717
141
  };
718
142
  //# sourceMappingURL=index.js.map