@virex-tech/paywallo-sdk 2.2.4 → 2.2.6

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.
@@ -0,0 +1,8 @@
1
+ #import <React/RCTBridgeModule.h>
2
+
3
+ @interface RCT_EXTERN_MODULE(PaywalloEnv, NSObject)
4
+
5
+ RCT_EXTERN_METHOD(detect:(RCTPromiseResolveBlock)resolve
6
+ rejecter:(RCTPromiseRejectBlock)reject)
7
+
8
+ @end
@@ -0,0 +1,28 @@
1
+ import Foundation
2
+
3
+ @objc(PaywalloEnv)
4
+ class PaywalloEnv: NSObject {
5
+
6
+ @objc static func requiresMainQueueSetup() -> Bool { return false }
7
+
8
+ // MARK: - Detect Environment
9
+
10
+ @objc
11
+ func detect(
12
+ _ resolve: @escaping RCTPromiseResolveBlock,
13
+ rejecter reject: @escaping RCTPromiseRejectBlock
14
+ ) {
15
+ // Primary signal: presence of embedded.mobileprovision (absent in App Store builds)
16
+ let hasMobileProvision = Bundle.main.url(forResource: "embedded", withExtension: "mobileprovision") != nil
17
+
18
+ // Secondary signal: sandbox receipt URL (present in TestFlight/Simulator)
19
+ let receiptURL = Bundle.main.appStoreReceiptURL
20
+ let hasSandboxReceipt = receiptURL?.lastPathComponent == "sandboxReceipt"
21
+
22
+ if hasMobileProvision || hasSandboxReceipt {
23
+ resolve("sandbox")
24
+ } else {
25
+ resolve("production")
26
+ }
27
+ }
28
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@virex-tech/paywallo-sdk",
3
- "version": "2.2.4",
3
+ "version": "2.2.6",
4
4
  "description": "SDK React Native para integração com Paywallo - Paywalls, Subscriptions e Analytics",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -91,6 +91,7 @@
91
91
  "eslint-plugin-simple-import-sort": "^12.0.0",
92
92
  "eslint-plugin-unused-imports": "^4.0.0",
93
93
  "prettier": "^3.0.0",
94
+ "react-native": "^0.81.4",
94
95
  "tsup": "^8.0.0",
95
96
  "typescript": "^5.0.0",
96
97
  "typescript-eslint": "^8.0.0",