react-native-nami-sdk 3.3.0-3 → 3.3.0-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.
@@ -24,11 +24,12 @@ class NamiPaywallManagerBridgeModule internal constructor(
24
24
  private var latestPaywallActivity: Activity? = null
25
25
 
26
26
  @ReactMethod
27
- fun buySkuComplete(dict: ReadableMap, storeType: String) {
27
+ fun buySkuComplete(dict: ReadableMap) {
28
28
  val product = dict.getMap("product")
29
29
  val productId = product?.getString("id")
30
30
  val skuRefId = product?.getString("skuId")
31
31
  val typeString = product?.getString("type")
32
+ val storeType = dict.getString("storeType") ?: "GooglePlay"
32
33
  var purchaseSuccess: NamiPurchaseSuccess? = null
33
34
 
34
35
  if (productId != null && skuRefId != null) {
@@ -17,6 +17,7 @@ export interface Spec extends TurboModule {
17
17
  marketplace?: string;
18
18
  price?: string;
19
19
  currencyCode?: string;
20
+ storeType?: string;
20
21
  }): void;
21
22
  buySkuCompleteApple(purchase: {
22
23
  product: {
@@ -123,6 +123,7 @@ export type NamiPurchaseDetails = {
123
123
  currencyCode?: string;
124
124
  userId?: string;
125
125
  marketplace?: string;
126
+ storeType?: string;
126
127
  };
127
128
  export type NamiPurchaseSuccessApple = {
128
129
  product: NamiSKU;
@@ -2,4 +2,4 @@
2
2
  * Auto-generated file. Do not edit manually.
3
3
  * React Native Nami SDK version.
4
4
  */
5
- export declare const NAMI_REACT_NATIVE_VERSION = "3.3.0-3";
5
+ export declare const NAMI_REACT_NATIVE_VERSION = "3.3.0-6";
package/ios/Nami.swift CHANGED
@@ -8,9 +8,9 @@ import Foundation
8
8
  import NamiApple
9
9
  import React
10
10
 
11
- #if RCT_NEW_ARCH_ENABLED
12
- extension RNNami: RCTTurboModule {}
13
- #endif
11
+ // #if RCT_NEW_ARCH_ENABLED
12
+ // extension RNNami: RCTTurboModule {}
13
+ // #endif
14
14
 
15
15
  @objc(RNNami)
16
16
  class RNNami: NSObject {
@@ -10,9 +10,9 @@ import NamiApple
10
10
  import os
11
11
  import React
12
12
 
13
- #if RCT_NEW_ARCH_ENABLED
14
- extension RNNamiCampaignManager: RCTTurboModule {}
15
- #endif
13
+ // #if RCT_NEW_ARCH_ENABLED
14
+ // extension RNNamiCampaignManager: RCTTurboModule {}
15
+ // #endif
16
16
 
17
17
  @objc(RNNamiCampaignManager)
18
18
  class RNNamiCampaignManager: RCTEventEmitter {
@@ -9,9 +9,9 @@ import Foundation
9
9
  import NamiApple
10
10
  import React
11
11
 
12
- #if RCT_NEW_ARCH_ENABLED
13
- extension RNNamiCustomerManager: RCTTurboModule {}
14
- #endif
12
+ // #if RCT_NEW_ARCH_ENABLED
13
+ // extension RNNamiCustomerManager: RCTTurboModule {}
14
+ // #endif
15
15
 
16
16
  @objc(RNNamiCustomerManager)
17
17
  class RNNamiCustomerManager: RCTEventEmitter {
@@ -9,9 +9,9 @@ import Foundation
9
9
  import NamiApple
10
10
  import React
11
11
 
12
- #if RCT_NEW_ARCH_ENABLED
13
- extension RNNamiEntitlementManager: RCTTurboModule {}
14
- #endif
12
+ // #if RCT_NEW_ARCH_ENABLED
13
+ // extension RNNamiEntitlementManager: RCTTurboModule {}
14
+ // #endif
15
15
 
16
16
  @objc(RNNamiEntitlementManager)
17
17
  class RNNamiEntitlementManager: RCTEventEmitter {
@@ -9,9 +9,9 @@ import Foundation
9
9
  import NamiApple
10
10
  import React
11
11
 
12
- #if RCT_NEW_ARCH_ENABLED
13
- extension RNNamiFlowManager: RCTTurboModule {}
14
- #endif
12
+ // #if RCT_NEW_ARCH_ENABLED
13
+ // extension RNNamiFlowManager: RCTTurboModule {}
14
+ // #endif
15
15
 
16
16
  @objc(RNNamiFlowManager)
17
17
  class RNNamiFlowManager: RCTEventEmitter {
@@ -9,9 +9,9 @@ import Foundation
9
9
  import NamiApple
10
10
  import React
11
11
 
12
- #if RCT_NEW_ARCH_ENABLED
13
- extension RNNamiPaywallManager: RCTTurboModule {}
14
- #endif
12
+ // #if RCT_NEW_ARCH_ENABLED
13
+ // extension RNNamiPaywallManager: RCTTurboModule {}
14
+ // #endif
15
15
 
16
16
  @objc(RNNamiPaywallManager)
17
17
  class RNNamiPaywallManager: RCTEventEmitter {
@@ -48,6 +48,10 @@ class RNNamiPaywallManager: RCTEventEmitter {
48
48
  let namiSku = NamiSKU(namiId: namiId, storeId: storeId, skuType: namiSkuType)
49
49
  let priceString = dict["price"] as? String ?? "0"
50
50
 
51
+ if let store = dict["storeType"] as? String, store != "Apple" {
52
+ print("RNNamiPaywallManager - buySkuComplete called with the wrong store type \(dict)")
53
+ }
54
+
51
55
  do {
52
56
  if let transactionID = dict["transactionID"] as? String,
53
57
  let originalTransactionID = dict["originalTransactionID"] as? String,
@@ -9,9 +9,9 @@ import Foundation
9
9
  import NamiApple
10
10
  import React
11
11
 
12
- #if RCT_NEW_ARCH_ENABLED
13
- extension RNNamiPurchaseManager: RCTTurboModule {}
14
- #endif
12
+ // #if RCT_NEW_ARCH_ENABLED
13
+ // extension RNNamiPurchaseManager: RCTTurboModule {}
14
+ // #endif
15
15
 
16
16
  @objc(RNNamiPurchaseManager)
17
17
  class RNNamiPurchaseManager: RCTEventEmitter {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-nami-sdk",
3
- "version": "3.3.0-3",
3
+ "version": "3.3.0-6",
4
4
  "description": "React Native Module for Nami - Easy subscriptions & in-app purchases, with powerful built-in paywalls and A/B testing.",
5
5
  "main": "index.ts",
6
6
  "types": "dist/index.d.ts",
@@ -31,4 +31,10 @@ Pod::Spec.new do |s|
31
31
 
32
32
  install_modules_dependencies(s)
33
33
 
34
+ if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
35
+ s.pod_target_xcconfig = {
36
+ 'USE_HEADERMAP' => 'YES',
37
+ }
38
+ end
39
+
34
40
  end
@@ -20,6 +20,7 @@ export interface Spec extends TurboModule {
20
20
  marketplace?: string;
21
21
  price?: string;
22
22
  currencyCode?: string;
23
+ storeType?: string;
23
24
  }): void;
24
25
 
25
26
  // Backward compatibility methods
@@ -35,15 +35,15 @@ export const NamiPaywallManager = {
35
35
 
36
36
  // Compatibility shims
37
37
  buySkuCompleteApple: (purchase: NamiPurchaseSuccessApple): void => {
38
- RNNamiPaywallManager.buySkuCompleteApple(purchase);
38
+ RNNamiPaywallManager.buySkuComplete(purchase);
39
39
  },
40
40
 
41
41
  buySkuCompleteAmazon: (purchase: NamiPurchaseSuccessAmazon): void => {
42
- RNNamiPaywallManager.buySkuCompleteAmazon(purchase);
42
+ RNNamiPaywallManager.buySkuComplete(purchase);
43
43
  },
44
44
 
45
45
  buySkuCompleteGooglePlay: (purchase: NamiPurchaseSuccessGooglePlay): void => {
46
- RNNamiPaywallManager.buySkuCompleteGooglePlay(purchase);
46
+ RNNamiPaywallManager.buySkuComplete(purchase);
47
47
  },
48
48
 
49
49
  registerBuySkuHandler: (callback: (sku: NamiSKU) => void): (() => void) => {
package/src/types.ts CHANGED
@@ -255,6 +255,7 @@ export type NamiPurchaseDetails = {
255
255
  currencyCode?: string;
256
256
  userId?: string;
257
257
  marketplace?: string;
258
+ storeType?: string; // 'Apple', 'GooglePlay', 'Amazon'
258
259
  };
259
260
 
260
261
  export type NamiPurchaseSuccessApple = {
package/src/version.ts CHANGED
@@ -2,4 +2,4 @@
2
2
  * Auto-generated file. Do not edit manually.
3
3
  * React Native Nami SDK version.
4
4
  */
5
- export const NAMI_REACT_NATIVE_VERSION = '3.3.0-3';
5
+ export const NAMI_REACT_NATIVE_VERSION = '3.3.0-6';