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