gomarketme-react-native 1.0.14 → 1.0.16

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/dist/index.js CHANGED
@@ -1,27 +1,4 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
3
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
4
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -64,8 +41,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
64
41
  Object.defineProperty(exports, "__esModule", { value: true });
65
42
  var react_native_1 = require("react-native");
66
43
  var react_native_device_info_1 = __importDefault(require("react-native-device-info"));
67
- var RNLocalize = __importStar(require("react-native-localize"));
68
- var async_storage_1 = __importDefault(require("@react-native-async-storage/async-storage"));
69
44
  var react_native_iap_1 = __importDefault(require("react-native-iap"));
70
45
  var axios_1 = __importDefault(require("axios"));
71
46
  var GoMarketMe = /** @class */ (function () {
@@ -335,9 +310,9 @@ var GoMarketMe = /** @class */ (function () {
335
310
  return "GMT".concat(sign).concat(String(hours).padStart(2, '0'), ":").concat(String(minutes).padStart(2, '0')); // Return GMT format
336
311
  };
337
312
  GoMarketMe.prototype.getLanguageCode = function () {
338
- var locales = RNLocalize.getLocales();
339
- // Check if there are any locales available and return the first one or default to 'en-US'
340
- return locales.length > 0 ? locales[0].languageTag : 'en-US';
313
+ //const locales = RNLocalize.getLocales();
314
+ //return locales.length > 0 ? locales[0].languageTag : 'en-US';
315
+ return 'en-US';
341
316
  };
342
317
  GoMarketMe.prototype.fetchPurchases = function (purchaseDetailsList, apiKey) {
343
318
  return __awaiter(this, void 0, void 0, function () {
@@ -467,41 +442,29 @@ var GoMarketMe = /** @class */ (function () {
467
442
  };
468
443
  GoMarketMe.prototype.markSDKAsInitialized = function () {
469
444
  return __awaiter(this, void 0, void 0, function () {
470
- var e_6;
471
445
  return __generator(this, function (_a) {
472
- switch (_a.label) {
473
- case 0:
474
- _a.trys.push([0, 2, , 3]);
475
- return [4 /*yield*/, async_storage_1.default.setItem(this.sdkInitializedKey, 'true')];
476
- case 1:
477
- _a.sent();
478
- return [2 /*return*/, true];
479
- case 2:
480
- e_6 = _a.sent();
481
- console.error('Failed to save SDK initialization:', e_6);
482
- return [2 /*return*/, false];
483
- case 3: return [2 /*return*/];
484
- }
446
+ // try {
447
+ // await AsyncStorage.setItem(this.sdkInitializedKey, 'true');
448
+ // return true;
449
+ // } catch (e) {
450
+ // console.error('Failed to save SDK initialization:', e);
451
+ // return false;
452
+ // }
453
+ return [2 /*return*/, true];
485
454
  });
486
455
  });
487
456
  };
488
457
  GoMarketMe.prototype.isSDKInitialized = function () {
489
458
  return __awaiter(this, void 0, void 0, function () {
490
- var value, e_7;
491
459
  return __generator(this, function (_a) {
492
- switch (_a.label) {
493
- case 0:
494
- _a.trys.push([0, 2, , 3]);
495
- return [4 /*yield*/, async_storage_1.default.getItem(this.sdkInitializedKey)];
496
- case 1:
497
- value = _a.sent();
498
- return [2 /*return*/, value === 'true'];
499
- case 2:
500
- e_7 = _a.sent();
501
- console.error('Failed to load SDK initialization:', e_7);
502
- return [2 /*return*/, false];
503
- case 3: return [2 /*return*/];
504
- }
460
+ // try {
461
+ // const value = await AsyncStorage.getItem(this.sdkInitializedKey);
462
+ // return value === 'true';
463
+ // } catch (e) {
464
+ // console.error('Failed to load SDK initialization:', e);
465
+ // return false;
466
+ // }
467
+ return [2 /*return*/, false];
505
468
  });
506
469
  });
507
470
  };
package/package.json CHANGED
@@ -1,13 +1,12 @@
1
1
  {
2
2
  "name": "gomarketme-react-native",
3
- "version": "1.0.14",
3
+ "version": "1.0.16",
4
4
  "description": "Affiliate Marketing for React Native-Based iOS and Android Apps.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "scripts": {
8
8
  "build": "tsc",
9
- "prepublishOnly": "yarn build",
10
- "publish": "yarn publish",
9
+ "prepublishOnly": "npm run build",
11
10
  "test": "echo \"Error: no test specified\" && exit 1"
12
11
  },
13
12
  "homepage": "https://gomarketme.co",
@@ -19,11 +18,9 @@
19
18
  "author": "GoMarketMe",
20
19
  "license": "MIT",
21
20
  "dependencies": {
22
- "@react-native-async-storage/async-storage": "^1.15.6",
23
21
  "axios": "^1.7.7",
24
22
  "react-native-device-info": "^14.0.0",
25
- "react-native-iap": "^7.0.0",
26
- "react-native-localize": "^3.2.1"
23
+ "react-native-iap": "^7.0.0"
27
24
  },
28
25
  "devDependencies": {
29
26
  "@types/node": "^15.12.5",
package/src/index.tsx CHANGED
@@ -1,7 +1,5 @@
1
1
  import { Platform, Dimensions, PixelRatio } from 'react-native';
2
2
  import DeviceInfo from 'react-native-device-info';
3
- import * as RNLocalize from 'react-native-localize';
4
- import AsyncStorage from '@react-native-async-storage/async-storage';
5
3
  import InAppPurchase, { Purchase, Product, ProductPurchase } from 'react-native-iap';
6
4
  import axios from 'axios';
7
5
 
@@ -151,9 +149,9 @@ class GoMarketMe {
151
149
  }
152
150
 
153
151
  private getLanguageCode(): string {
154
- const locales = RNLocalize.getLocales();
155
- // Check if there are any locales available and return the first one or default to 'en-US'
156
- return locales.length > 0 ? locales[0].languageTag : 'en-US';
152
+ //const locales = RNLocalize.getLocales();
153
+ //return locales.length > 0 ? locales[0].languageTag : 'en-US';
154
+ return 'en-US';
157
155
  }
158
156
 
159
157
  private async fetchPurchases(purchaseDetailsList: Purchase[], apiKey: string): Promise<string[]> {
@@ -234,23 +232,25 @@ class GoMarketMe {
234
232
  }
235
233
 
236
234
  private async markSDKAsInitialized(): Promise<boolean> {
237
- try {
238
- await AsyncStorage.setItem(this.sdkInitializedKey, 'true');
239
- return true;
240
- } catch (e) {
241
- console.error('Failed to save SDK initialization:', e);
242
- return false;
243
- }
235
+ // try {
236
+ // await AsyncStorage.setItem(this.sdkInitializedKey, 'true');
237
+ // return true;
238
+ // } catch (e) {
239
+ // console.error('Failed to save SDK initialization:', e);
240
+ // return false;
241
+ // }
242
+ return true;
244
243
  }
245
244
 
246
245
  private async isSDKInitialized(): Promise<boolean> {
247
- try {
248
- const value = await AsyncStorage.getItem(this.sdkInitializedKey);
249
- return value === 'true';
250
- } catch (e) {
251
- console.error('Failed to load SDK initialization:', e);
252
- return false;
253
- }
246
+ // try {
247
+ // const value = await AsyncStorage.getItem(this.sdkInitializedKey);
248
+ // return value === 'true';
249
+ // } catch (e) {
250
+ // console.error('Failed to load SDK initialization:', e);
251
+ // return false;
252
+ // }
253
+ return false;
254
254
  }
255
255
  }
256
256