react-native-flyy 1.4.32 → 1.4.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/android/.project +1 -1
  2. package/android/.settings/org.eclipse.buildship.core.prefs +5 -2
  3. package/android/build.gradle +1 -1
  4. package/android/src/main/java/com/reactnativeflyy/FlyyModule.kt +155 -49
  5. package/android/src/main/java/com/reactnativeflyy/FlyyRouteActivity.java +16 -0
  6. package/ios/Montserrat-Bold.ttf +0 -0
  7. package/ios/ReactNativeFlyy.m +276 -122
  8. package/lib/commonjs/assets/images/check.png +0 -0
  9. package/lib/commonjs/assets/images/medal.png +0 -0
  10. package/lib/commonjs/assets/images/radio.png +0 -0
  11. package/lib/commonjs/assets/images/reward_flyy.png +0 -0
  12. package/lib/commonjs/assets/images/xmark.png +0 -0
  13. package/lib/commonjs/flyy_checkin_view.js +379 -0
  14. package/lib/commonjs/flyy_checkin_view.js.map +1 -0
  15. package/lib/commonjs/index.js +634 -3
  16. package/lib/commonjs/index.js.map +1 -1
  17. package/lib/module/assets/images/check.png +0 -0
  18. package/lib/module/assets/images/medal.png +0 -0
  19. package/lib/module/assets/images/radio.png +0 -0
  20. package/lib/module/assets/images/reward_flyy.png +0 -0
  21. package/lib/module/assets/images/xmark.png +0 -0
  22. package/lib/module/flyy_checkin_view.js +365 -0
  23. package/lib/module/flyy_checkin_view.js.map +1 -0
  24. package/lib/module/index.js +616 -3
  25. package/lib/module/index.js.map +1 -1
  26. package/lib/typescript/flyy_checkin_view.d.ts +19 -0
  27. package/lib/typescript/index.d.ts +32 -0
  28. package/package.json +3 -1
  29. package/react-native-flyy.podspec +1 -1
  30. package/src/assets/images/check.png +0 -0
  31. package/src/assets/images/medal.png +0 -0
  32. package/src/assets/images/radio.png +0 -0
  33. package/src/assets/images/reward_flyy.png +0 -0
  34. package/src/assets/images/xmark.png +0 -0
  35. package/src/flyy_checkin_view.tsx +213 -0
  36. package/src/index.tsx +548 -1
@@ -0,0 +1,379 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _react = _interopRequireWildcard(require("react"));
9
+
10
+ var _reactNative = require("react-native");
11
+
12
+ 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); }
13
+
14
+ 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; }
15
+
16
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
17
+
18
+ const {
19
+ Flyy
20
+ } = _reactNative.NativeModules;
21
+
22
+ class FlyyCheckinComponent extends _react.Component {
23
+ constructor(...args) {
24
+ super(...args);
25
+
26
+ _defineProperty(this, "state", {
27
+ mileStoneData: [],
28
+ checkinOffer: [],
29
+ listItems: [],
30
+ persons: [1, 2, 3, 4, 5],
31
+ partnerId: "",
32
+ userId: "",
33
+ appData: "",
34
+ environment: 0
35
+ });
36
+ }
37
+
38
+ async componentDidMount() {
39
+ try {
40
+ const data = await Flyy.getUserData();
41
+ const appData = await Flyy.getAppData();
42
+ this.setState({
43
+ partnerId: data["partner_id"],
44
+ userId: data["user_id"],
45
+ environment: data["environment"],
46
+ appData: appData
47
+ });
48
+ } catch (e) {
49
+ console.error(e);
50
+ }
51
+
52
+ await this.fetchData();
53
+ }
54
+
55
+ async fetchData() {
56
+ this.setState({
57
+ listItems: []
58
+ });
59
+ const resp = await fetch(`https://${this.state.environment == 0 ? "ghc-stage" : "ghc"}.theflyy.com/api/v7/flyy_app_info`, {
60
+ headers: {
61
+ "X-Key": this.state.partnerId,
62
+ "Content-Type": "application/json",
63
+ "X-App-Data": this.state.appData
64
+ }
65
+ });
66
+ const data = await resp.json();
67
+
68
+ for (var key in data.info.offers) {
69
+ if (data.info.offers[key].offer_type_code === "checkin") {
70
+ this.setState({
71
+ checkinOffer: data.info.offers[key]
72
+ });
73
+ this.setState({
74
+ mileStoneData: data.info.offers[key].milestones
75
+ });
76
+ break;
77
+ }
78
+ }
79
+
80
+ var tempData = [];
81
+ var isRewardDay = false;
82
+ var isCheckedIn = false;
83
+
84
+ for (let i = 0; i < this.state.checkinOffer.total_streak; i++) {
85
+ for (let j = 0; j < this.state.mileStoneData.length; j++) {
86
+ if (i + 1 === parseInt(this.state.mileStoneData[j].value)) {
87
+ isRewardDay = true;
88
+ }
89
+ }
90
+
91
+ if (i + 1 <= this.state.checkinOffer.streak) {
92
+ isCheckedIn = true;
93
+ }
94
+
95
+ tempData.push({
96
+ "isRewardDay": isRewardDay,
97
+ "isCheckedIn": isCheckedIn
98
+ });
99
+ isRewardDay = false;
100
+ isCheckedIn = false;
101
+ }
102
+
103
+ this.setState({
104
+ listItems: tempData
105
+ });
106
+ }
107
+
108
+ async checkInApi() {
109
+ var url = `https://${this.state.environment == 0 ? "ghc-stage" : "ghc"}.theflyy.com/api/v1/checkin?offer_id=` + this.state.checkinOffer.id.toString();
110
+ const resp = await fetch(url, {
111
+ headers: {
112
+ "X-Key": this.state.partnerId,
113
+ "Content-Type": "application/json",
114
+ "X-App-Data": this.state.appData
115
+ }
116
+ });
117
+ const data = await resp.json();
118
+
119
+ if (data.success) {
120
+ this.fetchData();
121
+ } else {
122
+ this.notifyMessage(data.message);
123
+ }
124
+ }
125
+
126
+ notifyMessage(msg) {
127
+ if (_reactNative.Platform.OS === 'android') {
128
+ _reactNative.ToastAndroid.show(msg, _reactNative.ToastAndroid.SHORT);
129
+ } else {// Toast.showWithGravity(msg, Toast.SHORT, Toast.BOTTOM);
130
+ }
131
+ }
132
+
133
+ render() {
134
+ var _this$props$style$che3, _this$props$style3, _this$props$style$fon, _this$props$style4, _this$state$checkinOf, _this$props$style$che4, _this$props$style5, _this$props$style$fon2, _this$props$style6, _this$props$style$che5, _this$props$style7;
135
+
136
+ const Divider = ({
137
+ color = "black",
138
+ index
139
+ }) => {
140
+ return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
141
+ style: {
142
+ flexDirection: 'row'
143
+ }
144
+ }, _react.default.Children.toArray(this.state.persons.map(() => {
145
+ return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
146
+ style: {
147
+ flexDirection: 'row'
148
+ }
149
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
150
+ style: {
151
+ height: 1,
152
+ width: 2,
153
+ backgroundColor: color,
154
+ borderRadius: 2
155
+ }
156
+ }), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
157
+ style: {
158
+ width: 1,
159
+ backgroundColor: "white",
160
+ borderRadius: 2
161
+ }
162
+ }));
163
+ })));
164
+ };
165
+
166
+ const getItemCount = () => this.state.listItems.length;
167
+
168
+ const getItem = (data, index) => ({
169
+ id: Math.random().toString(12).substring(0),
170
+ isRewardDay: data[index].isRewardDay,
171
+ isCheckedIn: data[index].isCheckedIn,
172
+ index: index
173
+ });
174
+
175
+ const Item = ({
176
+ title,
177
+ index
178
+ }) => {
179
+ var _this$props$style$che, _this$props$style, _this$props$style$che2, _this$props$style2;
180
+
181
+ const day = index + 1;
182
+ return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
183
+ style: {
184
+ justifyContent: "center",
185
+ alignItems: 'center',
186
+ alignContent: 'center'
187
+ }
188
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
189
+ style: {
190
+ flexDirection: 'row',
191
+ height: 35,
192
+ justifyContent: 'center',
193
+ alignItems: 'center'
194
+ }
195
+ }, title.isCheckedIn ? /*#__PURE__*/_react.default.createElement(_reactNative.View, {
196
+ style: {
197
+ height: 1,
198
+ width: 15,
199
+ alignSelf: "center",
200
+ backgroundColor: index == 0 ? "white" : "black"
201
+ }
202
+ }) : /*#__PURE__*/_react.default.createElement(Divider, {
203
+ color: index == 0 ? "white" : "black",
204
+ index: index
205
+ }), title.isRewardDay ? title.isCheckedIn ? /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
206
+ source: require('./assets/images/reward_flyy.png'),
207
+ style: {
208
+ height: 20,
209
+ width: 15
210
+ }
211
+ }) : /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
212
+ source: {
213
+ uri: this.state.checkinOffer["currency_icon_url"]
214
+ },
215
+ style: {
216
+ height: 20,
217
+ width: 20
218
+ }
219
+ }) : title.isCheckedIn ? /*#__PURE__*/_react.default.createElement(_reactNative.View, {
220
+ style: {
221
+ height: 17,
222
+ width: 17,
223
+ backgroundColor: "black",
224
+ borderRadius: 15,
225
+ justifyContent: 'center',
226
+ alignItems: 'center'
227
+ }
228
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
229
+ style: {
230
+ color: "white",
231
+ fontSize: 10
232
+ }
233
+ }, "\u2713")) : /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
234
+ source: require('./assets/images/radio.png'),
235
+ style: {
236
+ height: 20,
237
+ width: 20
238
+ }
239
+ }), index != this.state.listItems.length - 1 ? this.state.listItems[index + 1].isCheckedIn ? /*#__PURE__*/_react.default.createElement(_reactNative.View, {
240
+ style: {
241
+ height: 1,
242
+ width: 15,
243
+ alignSelf: "center",
244
+ backgroundColor: index == this.state.listItems.length - 1 ? "white" : "black"
245
+ }
246
+ }) : /*#__PURE__*/_react.default.createElement(Divider, {
247
+ color: index == this.state.listItems.length - 1 ? "white" : "black",
248
+ index: index
249
+ }) : /*#__PURE__*/_react.default.createElement(_reactNative.View, {
250
+ style: {
251
+ width: 15
252
+ }
253
+ })), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
254
+ style: {
255
+ textAlign: 'center',
256
+ color: title.isRewardDay ? (_this$props$style$che = (_this$props$style = this.props.style) === null || _this$props$style === void 0 ? void 0 : _this$props$style.checkInEarnColor) !== null && _this$props$style$che !== void 0 ? _this$props$style$che : "black" : (_this$props$style$che2 = (_this$props$style2 = this.props.style) === null || _this$props$style2 === void 0 ? void 0 : _this$props$style2.checkInDaysColor) !== null && _this$props$style$che2 !== void 0 ? _this$props$style$che2 : "black"
257
+ }
258
+ }, title.isRewardDay ? title.isCheckedIn ? "Won" : "Earn" : title.isCheckedIn ? "Day " + day : "Day " + day));
259
+ };
260
+
261
+ return /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
262
+ style: styles.main,
263
+ onPress: () => {
264
+ Flyy.openFlyyCheckinPage();
265
+ }
266
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
267
+ style: {
268
+ height: 10
269
+ }
270
+ }), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
271
+ style: {
272
+ fontSize: 20,
273
+ color: (_this$props$style$che3 = (_this$props$style3 = this.props.style) === null || _this$props$style3 === void 0 ? void 0 : _this$props$style3.checkInTitleColor) !== null && _this$props$style$che3 !== void 0 ? _this$props$style$che3 : "black",
274
+ fontFamily: (_this$props$style$fon = (_this$props$style4 = this.props.style) === null || _this$props$style4 === void 0 ? void 0 : _this$props$style4.fontFamily) !== null && _this$props$style$fon !== void 0 ? _this$props$style$fon : "Montserrat-Regular"
275
+ }
276
+ }, (_this$state$checkinOf = this.state.checkinOffer["offer_type_title"]) !== null && _this$state$checkinOf !== void 0 ? _this$state$checkinOf : "N/A"), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
277
+ style: {
278
+ height: 10
279
+ }
280
+ }), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
281
+ style: {
282
+ flexDirection: 'row',
283
+ width: 250,
284
+ justifyContent: 'center'
285
+ }
286
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
287
+ numberOfLines: 1,
288
+ style: {
289
+ fontSize: 18,
290
+ color: (_this$props$style$che4 = (_this$props$style5 = this.props.style) === null || _this$props$style5 === void 0 ? void 0 : _this$props$style5.checkInDescriptionColor) !== null && _this$props$style$che4 !== void 0 ? _this$props$style$che4 : "grey",
291
+ fontFamily: (_this$props$style$fon2 = (_this$props$style6 = this.props.style) === null || _this$props$style6 === void 0 ? void 0 : _this$props$style6.fontFamily) !== null && _this$props$style$fon2 !== void 0 ? _this$props$style$fon2 : "Montserrat-Regular",
292
+ textAlign: "center"
293
+ }
294
+ }, this.state.checkinOffer["description"] != null ? this.state.checkinOffer["description"].replace(/(<([^>]+)>)/ig, '') : "N/A")), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
295
+ style: {
296
+ height: 10
297
+ }
298
+ }), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
299
+ style: styles.listContainer
300
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.View, null, /*#__PURE__*/_react.default.createElement(_reactNative.VirtualizedList, {
301
+ data: this.state.listItems,
302
+ style: {
303
+ alignSelf: "center"
304
+ },
305
+ initialNumToRender: 4,
306
+ horizontal: true,
307
+ renderItem: ({
308
+ item,
309
+ index
310
+ }) => /*#__PURE__*/_react.default.createElement(Item, {
311
+ title: item,
312
+ index: index
313
+ }),
314
+ getItemCount: getItemCount,
315
+ getItem: getItem
316
+ }))), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
317
+ style: {
318
+ height: 10
319
+ }
320
+ }), /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
321
+ style: styles.button,
322
+ onPress: async () => {
323
+ const eventId = this.state.checkinOffer["event_id"];
324
+ const url = this.state.checkinOffer["deeplink"];
325
+
326
+ if (eventId != null) {
327
+ if (url != "") {
328
+ const supported = await _reactNative.Linking.canOpenURL(url);
329
+
330
+ if (supported) {
331
+ await _reactNative.Linking.openURL(url);
332
+ }
333
+ }
334
+ } else {
335
+ this.checkInApi();
336
+ }
337
+ }
338
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
339
+ style: {
340
+ fontSize: 20,
341
+ color: (_this$props$style$che5 = (_this$props$style7 = this.props.style) === null || _this$props$style7 === void 0 ? void 0 : _this$props$style7.checkInBtnTextColor) !== null && _this$props$style$che5 !== void 0 ? _this$props$style$che5 : "white",
342
+ paddingLeft: 10,
343
+ paddingRight: 10,
344
+ fontFamily: "Montserrat-Regular"
345
+ }
346
+ }, this.state.checkinOffer["checked_in"] ? "Checked In" : this.state.checkinOffer["button_text"] != "" ? this.state.checkinOffer["button_text"] : "Check In")));
347
+ }
348
+
349
+ }
350
+
351
+ const styles = _reactNative.StyleSheet.create({
352
+ main: {
353
+ backgroundColor: "white",
354
+ elevation: 5,
355
+ height: 210,
356
+ width: "90%",
357
+ alignItems: "center",
358
+ borderRadius: 10
359
+ },
360
+ listContainer: {
361
+ height: 60,
362
+ flexDirection: "row",
363
+ justifyContent: "center",
364
+ width: "100%",
365
+ alignItems: 'center',
366
+ alignContent: 'center',
367
+ backgroundColor: "white"
368
+ },
369
+ button: {
370
+ backgroundColor: "#f57242",
371
+ height: 35,
372
+ borderRadius: 5,
373
+ justifyContent: "center"
374
+ }
375
+ });
376
+
377
+ var _default = FlyyCheckinComponent;
378
+ exports.default = _default;
379
+ //# sourceMappingURL=flyy_checkin_view.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["flyy_checkin_view.tsx"],"names":["Flyy","NativeModules","FlyyCheckinComponent","Component","mileStoneData","checkinOffer","listItems","persons","partnerId","userId","appData","environment","componentDidMount","data","getUserData","getAppData","setState","e","console","error","fetchData","resp","fetch","state","headers","json","key","info","offers","offer_type_code","milestones","tempData","isRewardDay","isCheckedIn","i","total_streak","j","length","parseInt","value","streak","push","checkInApi","url","id","toString","success","notifyMessage","message","msg","Platform","OS","ToastAndroid","show","SHORT","render","Divider","color","index","flexDirection","React","Children","toArray","map","height","width","backgroundColor","borderRadius","getItemCount","getItem","Math","random","substring","Item","title","day","justifyContent","alignItems","alignContent","alignSelf","require","uri","fontSize","textAlign","props","style","checkInEarnColor","checkInDaysColor","styles","main","openFlyyCheckinPage","checkInTitleColor","fontFamily","checkInDescriptionColor","replace","listContainer","item","button","eventId","supported","Linking","canOpenURL","openURL","checkInBtnTextColor","paddingLeft","paddingRight","StyleSheet","create","elevation"],"mappings":";;;;;;;AACA;;AACA;;;;;;;;AACA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,0BAAjB;;AAEA,MAAMC,oBAAN,SAAmCC,gBAAnC,CAA6C;AAAA;AAAA;;AAAA,mCAEjC;AACJC,MAAAA,aAAa,EAAE,EADX;AAEJC,MAAAA,YAAY,EAAE,EAFV;AAGJC,MAAAA,SAAS,EAAE,EAHP;AAIJC,MAAAA,OAAO,EAAE,CAAC,CAAD,EAAG,CAAH,EAAK,CAAL,EAAO,CAAP,EAAS,CAAT,CAJL;AAKJC,MAAAA,SAAS,EAAE,EALP;AAMJC,MAAAA,MAAM,EAAE,EANJ;AAOJC,MAAAA,OAAO,EAAE,EAPL;AAQJC,MAAAA,WAAW,EAAE;AART,KAFiC;AAAA;;AAalB,QAAjBC,iBAAiB,GAAE;AACvB,QAAI;AACF,YAAMC,IAAI,GAAG,MAAMb,IAAI,CAACc,WAAL,EAAnB;AACA,YAAMJ,OAAO,GAAG,MAAMV,IAAI,CAACe,UAAL,EAAtB;AACA,WAAKC,QAAL,CAAc;AACFR,QAAAA,SAAS,EAAGK,IAAI,CAAC,YAAD,CADd;AAEFJ,QAAAA,MAAM,EAAGI,IAAI,CAAC,SAAD,CAFX;AAGFF,QAAAA,WAAW,EAAGE,IAAI,CAAC,aAAD,CAHhB;AAIFH,Q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heet,Image, VirtualizedList, Platform, ToastAndroid, Alert, Linking, NativeModules } from \"react-native\";\nconst { Flyy } = NativeModules;\n\nclass FlyyCheckinComponent extends Component {\n\n state = {\n mileStoneData: [],\n checkinOffer: [],\n listItems: [],\n persons: [1,2,3,4,5],\n partnerId: \"\",\n userId: \"\",\n appData: \"\",\n environment: 0\n };\n\n async componentDidMount(){\n try {\n const data = await Flyy.getUserData();\n const appData = await Flyy.getAppData();\n this.setState({ \n partnerId : data[\"partner_id\"],\n userId : data[\"user_id\"],\n environment : data[\"environment\"],\n appData: appData\n })\n } catch (e) {\n console.error(e);\n }\n\n await this.fetchData();\n }\n\n\n async fetchData(){\n this.setState({ listItems : []})\n const resp = await fetch(`https://${this.state.environment == 0 ? \"ghc-stage\" : \"ghc\"}.theflyy.com/api/v7/flyy_app_info`, {\n headers: {\n \"X-Key\": this.state.partnerId,\n \"Content-Type\": \"application/json\",\n \"X-App-Data\": this.state.appData\n }\n });\n const data = await resp.json();\n for (var key in data.info.offers) {\n if (data.info.offers[key].offer_type_code === \"checkin\") {\n this.setState({ checkinOffer : data.info.offers[key] })\n this.setState({ mileStoneData : data.info.offers[key].milestones })\n break;\n }\n }\n var tempData = [];\n var isRewardDay = false;\n var isCheckedIn = false;\n for (let i = 0; i < this.state.checkinOffer.total_streak; i++) {\n for (let j = 0; j < this.state.mileStoneData.length; j++) {\n if (i + 1 === parseInt(this.state.mileStoneData[j].value)) {\n isRewardDay = true;\n }\n }\n if (i+1 <= this.state.checkinOffer.streak) {\n isCheckedIn = true;\n }\n tempData.push({ \"isRewardDay\": isRewardDay, \"isCheckedIn\": isCheckedIn })\n isRewardDay = false;\n isCheckedIn = false;\n }\n this.setState({ listItems : tempData })\n }\n\n\n async checkInApi() {\n var url = `https://${this.state.environment == 0 ? \"ghc-stage\" : \"ghc\"}.theflyy.com/api/v1/checkin?offer_id=` + this.state.checkinOffer.id.toString();\n const resp = await fetch(url, {\n headers: {\n \"X-Key\": this.state.partnerId,\n \"Content-Type\": \"application/json\",\n \"X-App-Data\": this.state.appData\n }\n });\n const data = await resp.json();\n if (data.success) {\n this.fetchData()\n } else {\n this.notifyMessage(data.message)\n }\n }\n\n notifyMessage(msg:string) {\n if (Platform.OS === 'android') {\n ToastAndroid.show(msg, ToastAndroid.SHORT)\n } else {\n // Toast.showWithGravity(msg, Toast.SHORT, Toast.BOTTOM);\n }\n }\n\n render() {\n const Divider = ({color = \"black\",index}:{color:any,index:any}) => {\n return (\n <View style={{ flexDirection: 'row'}}>\n {React.Children.toArray(\n this.state.persons.map(() => {\n return (\n <View style={{ flexDirection: 'row' }}>\n <View style={{ height: 1, width: 2, backgroundColor: color, borderRadius: 2 }} />\n <View style={{ width: 1, backgroundColor: \"white\", borderRadius: 2 }} />\n </View>\n );\n })\n )}\n </View>\n )\n }\n const getItemCount = () => this.state.listItems.length;\n const getItem = (data:any, index:any) => ({\n id: Math.random().toString(12).substring(0),\n isRewardDay: data[index].isRewardDay,\n isCheckedIn: data[index].isCheckedIn,\n index: index\n });\n const Item = ({ title, index }: {title:any,index:any}) => {\n const day = index + 1;\n return (\n <View style = {{justifyContent: \"center\",alignItems:'center',alignContent:'center'}}>\n <View style = {{flexDirection : 'row',height: 35,justifyContent:'center',alignItems:'center'}}>\n {title.isCheckedIn? <View style={{ height: 1, width: 15, alignSelf: \"center\" , backgroundColor: index == 0 ? \"white\" : \"black\"}} />:<Divider color={index == 0 ? \"white\" : \"black\"} index={index}/>}\n {title.isRewardDay ?\n title.isCheckedIn ? <Image source={require('./assets/images/reward_flyy.png')} style={{ height: 20, width: 15 }} /> : <Image source={{ uri: this.state.checkinOffer[\"currency_icon_url\"] }} style={{ height: 20, width: 20 }} />\n : title.isCheckedIn ?\n <View style = {{height:17,width:17,backgroundColor:\"black\",borderRadius:15,justifyContent:'center',alignItems:'center'}}><Text style={{color:\"white\",fontSize:10}}>✓</Text></View>\n : <Image source={require('./assets/images/radio.png')} style={{ height: 20, width: 20 }} />}\n {index != this.state.listItems.length-1 ? this.state.listItems[index+1].isCheckedIn ? <View style={{ height: 1, width: 15, alignSelf: \"center\" , backgroundColor: index == this.state.listItems.length-1 ? \"white\" : \"black\"}} />:<Divider color={index == this.state.listItems.length - 1 ? \"white\" : \"black\"} index={index}/>: <View style = {{width:15}}/>}\n </View>\n <Text style = {{textAlign: 'center',color: title.isRewardDay ? this.props.style?.checkInEarnColor ?? \"black\" : this.props.style?.checkInDaysColor ?? \"black\"}}>{title.isRewardDay ?\n title.isCheckedIn ? \"Won\" : \"Earn\"\n : title.isCheckedIn ? \"Day \"+day : \"Day \"+day}</Text>\n </View>\n )\n }\n return (\n <TouchableOpacity style={styles.main} onPress = {()=>{\n Flyy.openFlyyCheckinPage();\n }}>\n <View style={{ height: 10 }} />\n <Text style={{ fontSize: 20, color: this.props.style?.checkInTitleColor ?? \"black\", fontFamily: this.props.style?.fontFamily ?? \"Montserrat-Regular\" }}>\n {this.state.checkinOffer[\"offer_type_title\"] ?? \"N/A\"}\n </Text>\n <View style={{ height: 10 }} />\n <View style = {{flexDirection: 'row',width:250,justifyContent: 'center'}}>\n <Text numberOfLines={1} style={{ fontSize: 18, color: this.props.style?.checkInDescriptionColor ?? \"grey\", fontFamily: this.props.style?.fontFamily ?? \"Montserrat-Regular\",textAlign: \"center\"}}>\n {this.state.checkinOffer[\"description\"] != null ? this.state.checkinOffer[\"description\"].replace(/(<([^>]+)>)/ig, '') : \"N/A\"}\n </Text>\n </View>\n <View style={{ height: 10 }} />\n <View style={styles.listContainer}>\n <View>\n <VirtualizedList\n data={this.state.listItems}\n style = {{alignSelf: \"center\"}}\n initialNumToRender={4}\n horizontal={true}\n renderItem={({ item, index }) => <Item title={item} index={index} />}\n getItemCount={getItemCount}\n getItem={getItem}\n />\n </View>\n </View>\n <View style={{ height: 10 }} />\n <TouchableOpacity\n style={styles.button}\n onPress={async () => {\n const eventId = this.state.checkinOffer[\"event_id\"];\n const url = this.state.checkinOffer[\"deeplink\"];\n if(eventId != null){\n if (url != \"\") {\n const supported = await Linking.canOpenURL(url);\n if (supported) {\n await Linking.openURL(url);\n }\n }\n }else{\n this.checkInApi();\n }\n }}>\n <Text style={{\n fontSize: 20,\n color: this.props.style?.checkInBtnTextColor ?? \"white\",\n paddingLeft: 10, \n paddingRight: 10,\n fontFamily: \"Montserrat-Regular\"\n }}>{this.state.checkinOffer[\"checked_in\"] ? \"Checked In\" : this.state.checkinOffer[\"button_text\"] != \"\" ? this.state.checkinOffer[\"button_text\"] : \"Check In\"}</Text>\n </TouchableOpacity>\n </TouchableOpacity>\n );\n }\n}\n\nconst styles = StyleSheet.create({\n main: {\n backgroundColor: \"white\",\n elevation: 5,\n height: 210,\n width: \"90%\",\n alignItems: \"center\",\n borderRadius: 10\n },\n listContainer: { height: 60,flexDirection: \"row\",justifyContent: \"center\",width:\"100%\",alignItems:'center',alignContent:'center',backgroundColor: \"white\"},\n button: { backgroundColor: \"#f57242\", height: 35, borderRadius: 5, justifyContent: \"center\" },\n});\n\nexport default FlyyCheckinComponent;"]}