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