react-native-iap 15.2.0 → 15.2.1
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/src/main/java/com/margelo/nitro/iap/HybridRnIap.kt +117 -114
- package/android/src/main/java/com/margelo/nitro/iap/ProductQueryHelpers.kt +42 -0
- package/android/src/test/java/com/margelo/nitro/iap/ProductQueryHelpersTest.kt +140 -0
- package/ios/HybridRnIap.swift +33 -0
- package/lib/module/hooks/useIAP.js.map +1 -1
- package/lib/module/hooks/useWebhookEvents.js +113 -0
- package/lib/module/hooks/useWebhookEvents.js.map +1 -0
- package/lib/module/index.js +331 -131
- package/lib/module/index.js.map +1 -1
- package/lib/module/kit-api.js +161 -0
- package/lib/module/kit-api.js.map +1 -0
- package/lib/module/types.js +16 -0
- package/lib/module/types.js.map +1 -1
- package/lib/module/utils/error.js.map +1 -1
- package/lib/module/utils/errorMapping.js +6 -0
- package/lib/module/utils/errorMapping.js.map +1 -1
- package/lib/module/webhook-client.js +164 -0
- package/lib/module/webhook-client.js.map +1 -0
- package/lib/typescript/plugin/src/withIAP.d.ts +1 -1
- package/lib/typescript/src/hooks/useIAP.d.ts +162 -2
- package/lib/typescript/src/hooks/useIAP.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useWebhookEvents.d.ts +55 -0
- package/lib/typescript/src/hooks/useWebhookEvents.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +282 -129
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/kit-api.d.ts +54 -0
- package/lib/typescript/src/kit-api.d.ts.map +1 -0
- package/lib/typescript/src/specs/RnIap.nitro.d.ts +7 -0
- package/lib/typescript/src/specs/RnIap.nitro.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +304 -74
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/lib/typescript/src/utils/error.d.ts +3 -0
- package/lib/typescript/src/utils/error.d.ts.map +1 -1
- package/lib/typescript/src/utils/errorMapping.d.ts +6 -0
- package/lib/typescript/src/utils/errorMapping.d.ts.map +1 -1
- package/lib/typescript/src/webhook-client.d.ts +82 -0
- package/lib/typescript/src/webhook-client.d.ts.map +1 -0
- package/nitrogen/generated/android/NitroIap+autolinking.cmake +3 -0
- package/nitrogen/generated/android/c++/JAdvancedCommerceInfoIOS.hpp +118 -0
- package/nitrogen/generated/android/c++/JAdvancedCommerceItemDetailsIOS.hpp +62 -0
- package/nitrogen/generated/android/c++/JAdvancedCommerceItemIOS.hpp +78 -0
- package/nitrogen/generated/android/c++/JAdvancedCommerceRefundIOS.hpp +62 -0
- package/nitrogen/generated/android/c++/JHybridRnIapSpec.cpp +44 -0
- package/nitrogen/generated/android/c++/JHybridRnIapSpec.hpp +1 -0
- package/nitrogen/generated/android/c++/JPurchase.hpp +11 -0
- package/nitrogen/generated/android/c++/JPurchaseIOS.hpp +16 -1
- package/nitrogen/generated/android/c++/JRequestPurchaseResult.hpp +11 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_AdvancedCommerceInfoIOS.cpp +26 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_AdvancedCommerceInfoIOS.hpp +84 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_AdvancedCommerceItemDetailsIOS.cpp +26 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_AdvancedCommerceItemDetailsIOS.hpp +74 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_Array_AdvancedCommerceRefundIOS_.cpp +35 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_Array_AdvancedCommerceRefundIOS_.hpp +84 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/AdvancedCommerceInfoIOS.kt +59 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/AdvancedCommerceItemDetailsIOS.kt +38 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/AdvancedCommerceItemIOS.kt +44 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/AdvancedCommerceRefundIOS.kt +38 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/HybridRnIapSpec.kt +4 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/PurchaseIOS.kt +5 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/Variant_NullType_AdvancedCommerceInfoIOS.kt +53 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/Variant_NullType_AdvancedCommerceItemDetailsIOS.kt +53 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/Variant_NullType_Array_AdvancedCommerceRefundIOS_.kt +53 -0
- package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Bridge.hpp +166 -0
- package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Umbrella.hpp +12 -0
- package/nitrogen/generated/ios/c++/HybridRnIapSpecSwift.hpp +20 -0
- package/nitrogen/generated/ios/swift/AdvancedCommerceInfoIOS.swift +294 -0
- package/nitrogen/generated/ios/swift/AdvancedCommerceItemDetailsIOS.swift +61 -0
- package/nitrogen/generated/ios/swift/AdvancedCommerceItemIOS.swift +141 -0
- package/nitrogen/generated/ios/swift/AdvancedCommerceRefundIOS.swift +61 -0
- package/nitrogen/generated/ios/swift/HybridRnIapSpec.swift +1 -0
- package/nitrogen/generated/ios/swift/HybridRnIapSpec_cxx.swift +25 -0
- package/nitrogen/generated/ios/swift/PurchaseIOS.swift +39 -2
- package/nitrogen/generated/ios/swift/Variant_NullType_AdvancedCommerceInfoIOS.swift +18 -0
- package/nitrogen/generated/ios/swift/Variant_NullType_AdvancedCommerceItemDetailsIOS.swift +18 -0
- package/nitrogen/generated/ios/swift/Variant_NullType__AdvancedCommerceRefundIOS_.swift +18 -0
- package/nitrogen/generated/shared/c++/AdvancedCommerceInfoIOS.hpp +117 -0
- package/nitrogen/generated/shared/c++/AdvancedCommerceItemDetailsIOS.hpp +86 -0
- package/nitrogen/generated/shared/c++/AdvancedCommerceItemIOS.hpp +99 -0
- package/nitrogen/generated/shared/c++/AdvancedCommerceRefundIOS.hpp +86 -0
- package/nitrogen/generated/shared/c++/HybridRnIapSpec.cpp +1 -0
- package/nitrogen/generated/shared/c++/HybridRnIapSpec.hpp +1 -0
- package/nitrogen/generated/shared/c++/PurchaseIOS.hpp +9 -2
- package/openiap-versions.json +3 -3
- package/package.json +1 -1
- package/plugin/build/withIAP.d.ts +1 -1
- package/plugin/src/withIAP.ts +1 -1
- package/src/hooks/useIAP.ts +162 -2
- package/src/hooks/useWebhookEvents.ts +180 -0
- package/src/index.ts +348 -130
- package/src/kit-api.ts +225 -0
- package/src/specs/RnIap.nitro.ts +8 -0
- package/src/types.ts +314 -74
- package/src/utils/error.ts +3 -0
- package/src/utils/errorMapping.ts +12 -0
- package/src/webhook-client.ts +312 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Variant_NullType_AdvancedCommerceItemDetailsIOS.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* An Swift enum with associated values representing a Variant/Union type.
|
|
12
|
+
* JS type: `null | struct`
|
|
13
|
+
*/
|
|
14
|
+
@frozen
|
|
15
|
+
public indirect enum Variant_NullType_AdvancedCommerceItemDetailsIOS {
|
|
16
|
+
case first(NullType)
|
|
17
|
+
case second(AdvancedCommerceItemDetailsIOS)
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Variant_NullType__AdvancedCommerceRefundIOS_.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* An Swift enum with associated values representing a Variant/Union type.
|
|
12
|
+
* JS type: `null | array`
|
|
13
|
+
*/
|
|
14
|
+
@frozen
|
|
15
|
+
public indirect enum Variant_NullType__AdvancedCommerceRefundIOS_ {
|
|
16
|
+
case first(NullType)
|
|
17
|
+
case second([AdvancedCommerceRefundIOS])
|
|
18
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// AdvancedCommerceInfoIOS.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
+
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
|
|
26
|
+
#include <NitroModules/PropNameIDCache.hpp>
|
|
27
|
+
#else
|
|
28
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
// Forward declaration of `AdvancedCommerceItemIOS` to properly resolve imports.
|
|
32
|
+
namespace margelo::nitro::iap { struct AdvancedCommerceItemIOS; }
|
|
33
|
+
|
|
34
|
+
#include <NitroModules/Null.hpp>
|
|
35
|
+
#include <string>
|
|
36
|
+
#include <variant>
|
|
37
|
+
#include <optional>
|
|
38
|
+
#include "AdvancedCommerceItemIOS.hpp"
|
|
39
|
+
#include <vector>
|
|
40
|
+
|
|
41
|
+
namespace margelo::nitro::iap {
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* A struct which can be represented as a JavaScript object (AdvancedCommerceInfoIOS).
|
|
45
|
+
*/
|
|
46
|
+
struct AdvancedCommerceInfoIOS final {
|
|
47
|
+
public:
|
|
48
|
+
std::optional<std::variant<nitro::NullType, std::string>> description SWIFT_PRIVATE;
|
|
49
|
+
std::optional<std::variant<nitro::NullType, std::string>> displayName SWIFT_PRIVATE;
|
|
50
|
+
std::optional<std::variant<nitro::NullType, std::string>> estimatedTax SWIFT_PRIVATE;
|
|
51
|
+
std::vector<AdvancedCommerceItemIOS> items SWIFT_PRIVATE;
|
|
52
|
+
std::optional<std::variant<nitro::NullType, std::string>> requestReferenceId SWIFT_PRIVATE;
|
|
53
|
+
std::optional<std::variant<nitro::NullType, std::string>> taxCode SWIFT_PRIVATE;
|
|
54
|
+
std::optional<std::variant<nitro::NullType, std::string>> taxExclusivePrice SWIFT_PRIVATE;
|
|
55
|
+
std::optional<std::variant<nitro::NullType, std::string>> taxRate SWIFT_PRIVATE;
|
|
56
|
+
|
|
57
|
+
public:
|
|
58
|
+
AdvancedCommerceInfoIOS() = default;
|
|
59
|
+
explicit AdvancedCommerceInfoIOS(std::optional<std::variant<nitro::NullType, std::string>> description, std::optional<std::variant<nitro::NullType, std::string>> displayName, std::optional<std::variant<nitro::NullType, std::string>> estimatedTax, std::vector<AdvancedCommerceItemIOS> items, std::optional<std::variant<nitro::NullType, std::string>> requestReferenceId, std::optional<std::variant<nitro::NullType, std::string>> taxCode, std::optional<std::variant<nitro::NullType, std::string>> taxExclusivePrice, std::optional<std::variant<nitro::NullType, std::string>> taxRate): description(description), displayName(displayName), estimatedTax(estimatedTax), items(items), requestReferenceId(requestReferenceId), taxCode(taxCode), taxExclusivePrice(taxExclusivePrice), taxRate(taxRate) {}
|
|
60
|
+
|
|
61
|
+
public:
|
|
62
|
+
friend bool operator==(const AdvancedCommerceInfoIOS& lhs, const AdvancedCommerceInfoIOS& rhs) = default;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
} // namespace margelo::nitro::iap
|
|
66
|
+
|
|
67
|
+
namespace margelo::nitro {
|
|
68
|
+
|
|
69
|
+
// C++ AdvancedCommerceInfoIOS <> JS AdvancedCommerceInfoIOS (object)
|
|
70
|
+
template <>
|
|
71
|
+
struct JSIConverter<margelo::nitro::iap::AdvancedCommerceInfoIOS> final {
|
|
72
|
+
static inline margelo::nitro::iap::AdvancedCommerceInfoIOS fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
73
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
74
|
+
return margelo::nitro::iap::AdvancedCommerceInfoIOS(
|
|
75
|
+
JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "description"))),
|
|
76
|
+
JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "displayName"))),
|
|
77
|
+
JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "estimatedTax"))),
|
|
78
|
+
JSIConverter<std::vector<margelo::nitro::iap::AdvancedCommerceItemIOS>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "items"))),
|
|
79
|
+
JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "requestReferenceId"))),
|
|
80
|
+
JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "taxCode"))),
|
|
81
|
+
JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "taxExclusivePrice"))),
|
|
82
|
+
JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "taxRate")))
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::iap::AdvancedCommerceInfoIOS& arg) {
|
|
86
|
+
jsi::Object obj(runtime);
|
|
87
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "description"), JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::toJSI(runtime, arg.description));
|
|
88
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "displayName"), JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::toJSI(runtime, arg.displayName));
|
|
89
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "estimatedTax"), JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::toJSI(runtime, arg.estimatedTax));
|
|
90
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "items"), JSIConverter<std::vector<margelo::nitro::iap::AdvancedCommerceItemIOS>>::toJSI(runtime, arg.items));
|
|
91
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "requestReferenceId"), JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::toJSI(runtime, arg.requestReferenceId));
|
|
92
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "taxCode"), JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::toJSI(runtime, arg.taxCode));
|
|
93
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "taxExclusivePrice"), JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::toJSI(runtime, arg.taxExclusivePrice));
|
|
94
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "taxRate"), JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::toJSI(runtime, arg.taxRate));
|
|
95
|
+
return obj;
|
|
96
|
+
}
|
|
97
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
98
|
+
if (!value.isObject()) {
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
jsi::Object obj = value.getObject(runtime);
|
|
102
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
if (!JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "description")))) return false;
|
|
106
|
+
if (!JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "displayName")))) return false;
|
|
107
|
+
if (!JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "estimatedTax")))) return false;
|
|
108
|
+
if (!JSIConverter<std::vector<margelo::nitro::iap::AdvancedCommerceItemIOS>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "items")))) return false;
|
|
109
|
+
if (!JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "requestReferenceId")))) return false;
|
|
110
|
+
if (!JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "taxCode")))) return false;
|
|
111
|
+
if (!JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "taxExclusivePrice")))) return false;
|
|
112
|
+
if (!JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "taxRate")))) return false;
|
|
113
|
+
return true;
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// AdvancedCommerceItemDetailsIOS.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
+
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
|
|
26
|
+
#include <NitroModules/PropNameIDCache.hpp>
|
|
27
|
+
#else
|
|
28
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
#include <NitroModules/Null.hpp>
|
|
34
|
+
#include <string>
|
|
35
|
+
#include <variant>
|
|
36
|
+
#include <optional>
|
|
37
|
+
|
|
38
|
+
namespace margelo::nitro::iap {
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* A struct which can be represented as a JavaScript object (AdvancedCommerceItemDetailsIOS).
|
|
42
|
+
*/
|
|
43
|
+
struct AdvancedCommerceItemDetailsIOS final {
|
|
44
|
+
public:
|
|
45
|
+
std::optional<std::variant<nitro::NullType, std::string>> jsonRepresentation SWIFT_PRIVATE;
|
|
46
|
+
|
|
47
|
+
public:
|
|
48
|
+
AdvancedCommerceItemDetailsIOS() = default;
|
|
49
|
+
explicit AdvancedCommerceItemDetailsIOS(std::optional<std::variant<nitro::NullType, std::string>> jsonRepresentation): jsonRepresentation(jsonRepresentation) {}
|
|
50
|
+
|
|
51
|
+
public:
|
|
52
|
+
friend bool operator==(const AdvancedCommerceItemDetailsIOS& lhs, const AdvancedCommerceItemDetailsIOS& rhs) = default;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
} // namespace margelo::nitro::iap
|
|
56
|
+
|
|
57
|
+
namespace margelo::nitro {
|
|
58
|
+
|
|
59
|
+
// C++ AdvancedCommerceItemDetailsIOS <> JS AdvancedCommerceItemDetailsIOS (object)
|
|
60
|
+
template <>
|
|
61
|
+
struct JSIConverter<margelo::nitro::iap::AdvancedCommerceItemDetailsIOS> final {
|
|
62
|
+
static inline margelo::nitro::iap::AdvancedCommerceItemDetailsIOS fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
63
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
64
|
+
return margelo::nitro::iap::AdvancedCommerceItemDetailsIOS(
|
|
65
|
+
JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "jsonRepresentation")))
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::iap::AdvancedCommerceItemDetailsIOS& arg) {
|
|
69
|
+
jsi::Object obj(runtime);
|
|
70
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "jsonRepresentation"), JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::toJSI(runtime, arg.jsonRepresentation));
|
|
71
|
+
return obj;
|
|
72
|
+
}
|
|
73
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
74
|
+
if (!value.isObject()) {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
jsi::Object obj = value.getObject(runtime);
|
|
78
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
if (!JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "jsonRepresentation")))) return false;
|
|
82
|
+
return true;
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// AdvancedCommerceItemIOS.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
+
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
|
|
26
|
+
#include <NitroModules/PropNameIDCache.hpp>
|
|
27
|
+
#else
|
|
28
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
// Forward declaration of `AdvancedCommerceItemDetailsIOS` to properly resolve imports.
|
|
32
|
+
namespace margelo::nitro::iap { struct AdvancedCommerceItemDetailsIOS; }
|
|
33
|
+
// Forward declaration of `AdvancedCommerceRefundIOS` to properly resolve imports.
|
|
34
|
+
namespace margelo::nitro::iap { struct AdvancedCommerceRefundIOS; }
|
|
35
|
+
|
|
36
|
+
#include <NitroModules/Null.hpp>
|
|
37
|
+
#include "AdvancedCommerceItemDetailsIOS.hpp"
|
|
38
|
+
#include <variant>
|
|
39
|
+
#include <optional>
|
|
40
|
+
#include "AdvancedCommerceRefundIOS.hpp"
|
|
41
|
+
#include <vector>
|
|
42
|
+
|
|
43
|
+
namespace margelo::nitro::iap {
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* A struct which can be represented as a JavaScript object (AdvancedCommerceItemIOS).
|
|
47
|
+
*/
|
|
48
|
+
struct AdvancedCommerceItemIOS final {
|
|
49
|
+
public:
|
|
50
|
+
std::optional<std::variant<nitro::NullType, AdvancedCommerceItemDetailsIOS>> details SWIFT_PRIVATE;
|
|
51
|
+
std::optional<std::variant<nitro::NullType, std::vector<AdvancedCommerceRefundIOS>>> refunds SWIFT_PRIVATE;
|
|
52
|
+
std::optional<std::variant<nitro::NullType, double>> revocationDate SWIFT_PRIVATE;
|
|
53
|
+
|
|
54
|
+
public:
|
|
55
|
+
AdvancedCommerceItemIOS() = default;
|
|
56
|
+
explicit AdvancedCommerceItemIOS(std::optional<std::variant<nitro::NullType, AdvancedCommerceItemDetailsIOS>> details, std::optional<std::variant<nitro::NullType, std::vector<AdvancedCommerceRefundIOS>>> refunds, std::optional<std::variant<nitro::NullType, double>> revocationDate): details(details), refunds(refunds), revocationDate(revocationDate) {}
|
|
57
|
+
|
|
58
|
+
public:
|
|
59
|
+
friend bool operator==(const AdvancedCommerceItemIOS& lhs, const AdvancedCommerceItemIOS& rhs) = default;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
} // namespace margelo::nitro::iap
|
|
63
|
+
|
|
64
|
+
namespace margelo::nitro {
|
|
65
|
+
|
|
66
|
+
// C++ AdvancedCommerceItemIOS <> JS AdvancedCommerceItemIOS (object)
|
|
67
|
+
template <>
|
|
68
|
+
struct JSIConverter<margelo::nitro::iap::AdvancedCommerceItemIOS> final {
|
|
69
|
+
static inline margelo::nitro::iap::AdvancedCommerceItemIOS fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
70
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
71
|
+
return margelo::nitro::iap::AdvancedCommerceItemIOS(
|
|
72
|
+
JSIConverter<std::optional<std::variant<nitro::NullType, margelo::nitro::iap::AdvancedCommerceItemDetailsIOS>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "details"))),
|
|
73
|
+
JSIConverter<std::optional<std::variant<nitro::NullType, std::vector<margelo::nitro::iap::AdvancedCommerceRefundIOS>>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "refunds"))),
|
|
74
|
+
JSIConverter<std::optional<std::variant<nitro::NullType, double>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "revocationDate")))
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::iap::AdvancedCommerceItemIOS& arg) {
|
|
78
|
+
jsi::Object obj(runtime);
|
|
79
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "details"), JSIConverter<std::optional<std::variant<nitro::NullType, margelo::nitro::iap::AdvancedCommerceItemDetailsIOS>>>::toJSI(runtime, arg.details));
|
|
80
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "refunds"), JSIConverter<std::optional<std::variant<nitro::NullType, std::vector<margelo::nitro::iap::AdvancedCommerceRefundIOS>>>>::toJSI(runtime, arg.refunds));
|
|
81
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "revocationDate"), JSIConverter<std::optional<std::variant<nitro::NullType, double>>>::toJSI(runtime, arg.revocationDate));
|
|
82
|
+
return obj;
|
|
83
|
+
}
|
|
84
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
85
|
+
if (!value.isObject()) {
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
jsi::Object obj = value.getObject(runtime);
|
|
89
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
if (!JSIConverter<std::optional<std::variant<nitro::NullType, margelo::nitro::iap::AdvancedCommerceItemDetailsIOS>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "details")))) return false;
|
|
93
|
+
if (!JSIConverter<std::optional<std::variant<nitro::NullType, std::vector<margelo::nitro::iap::AdvancedCommerceRefundIOS>>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "refunds")))) return false;
|
|
94
|
+
if (!JSIConverter<std::optional<std::variant<nitro::NullType, double>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "revocationDate")))) return false;
|
|
95
|
+
return true;
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// AdvancedCommerceRefundIOS.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
+
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
|
|
26
|
+
#include <NitroModules/PropNameIDCache.hpp>
|
|
27
|
+
#else
|
|
28
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
#include <NitroModules/Null.hpp>
|
|
34
|
+
#include <string>
|
|
35
|
+
#include <variant>
|
|
36
|
+
#include <optional>
|
|
37
|
+
|
|
38
|
+
namespace margelo::nitro::iap {
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* A struct which can be represented as a JavaScript object (AdvancedCommerceRefundIOS).
|
|
42
|
+
*/
|
|
43
|
+
struct AdvancedCommerceRefundIOS final {
|
|
44
|
+
public:
|
|
45
|
+
std::optional<std::variant<nitro::NullType, std::string>> jsonRepresentation SWIFT_PRIVATE;
|
|
46
|
+
|
|
47
|
+
public:
|
|
48
|
+
AdvancedCommerceRefundIOS() = default;
|
|
49
|
+
explicit AdvancedCommerceRefundIOS(std::optional<std::variant<nitro::NullType, std::string>> jsonRepresentation): jsonRepresentation(jsonRepresentation) {}
|
|
50
|
+
|
|
51
|
+
public:
|
|
52
|
+
friend bool operator==(const AdvancedCommerceRefundIOS& lhs, const AdvancedCommerceRefundIOS& rhs) = default;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
} // namespace margelo::nitro::iap
|
|
56
|
+
|
|
57
|
+
namespace margelo::nitro {
|
|
58
|
+
|
|
59
|
+
// C++ AdvancedCommerceRefundIOS <> JS AdvancedCommerceRefundIOS (object)
|
|
60
|
+
template <>
|
|
61
|
+
struct JSIConverter<margelo::nitro::iap::AdvancedCommerceRefundIOS> final {
|
|
62
|
+
static inline margelo::nitro::iap::AdvancedCommerceRefundIOS fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
63
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
64
|
+
return margelo::nitro::iap::AdvancedCommerceRefundIOS(
|
|
65
|
+
JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "jsonRepresentation")))
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::iap::AdvancedCommerceRefundIOS& arg) {
|
|
69
|
+
jsi::Object obj(runtime);
|
|
70
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "jsonRepresentation"), JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::toJSI(runtime, arg.jsonRepresentation));
|
|
71
|
+
return obj;
|
|
72
|
+
}
|
|
73
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
74
|
+
if (!value.isObject()) {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
jsi::Object obj = value.getObject(runtime);
|
|
78
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
if (!JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "jsonRepresentation")))) return false;
|
|
82
|
+
return true;
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
} // namespace margelo::nitro
|
|
@@ -40,6 +40,7 @@ namespace margelo::nitro::iap {
|
|
|
40
40
|
prototype.registerHybridMethod("currentEntitlementIOS", &HybridRnIapSpec::currentEntitlementIOS);
|
|
41
41
|
prototype.registerHybridMethod("latestTransactionIOS", &HybridRnIapSpec::latestTransactionIOS);
|
|
42
42
|
prototype.registerHybridMethod("getPendingTransactionsIOS", &HybridRnIapSpec::getPendingTransactionsIOS);
|
|
43
|
+
prototype.registerHybridMethod("getAllTransactionsIOS", &HybridRnIapSpec::getAllTransactionsIOS);
|
|
43
44
|
prototype.registerHybridMethod("syncIOS", &HybridRnIapSpec::syncIOS);
|
|
44
45
|
prototype.registerHybridMethod("showManageSubscriptionsIOS", &HybridRnIapSpec::showManageSubscriptionsIOS);
|
|
45
46
|
prototype.registerHybridMethod("deepLinkToSubscriptionsIOS", &HybridRnIapSpec::deepLinkToSubscriptionsIOS);
|
|
@@ -166,6 +166,7 @@ namespace margelo::nitro::iap {
|
|
|
166
166
|
virtual std::shared_ptr<Promise<std::variant<nitro::NullType, NitroPurchase>>> currentEntitlementIOS(const std::string& sku) = 0;
|
|
167
167
|
virtual std::shared_ptr<Promise<std::variant<nitro::NullType, NitroPurchase>>> latestTransactionIOS(const std::string& sku) = 0;
|
|
168
168
|
virtual std::shared_ptr<Promise<std::vector<NitroPurchase>>> getPendingTransactionsIOS() = 0;
|
|
169
|
+
virtual std::shared_ptr<Promise<std::vector<NitroPurchase>>> getAllTransactionsIOS() = 0;
|
|
169
170
|
virtual std::shared_ptr<Promise<bool>> syncIOS() = 0;
|
|
170
171
|
virtual std::shared_ptr<Promise<std::vector<NitroPurchase>>> showManageSubscriptionsIOS() = 0;
|
|
171
172
|
virtual std::shared_ptr<Promise<bool>> deepLinkToSubscriptionsIOS() = 0;
|
|
@@ -28,6 +28,8 @@
|
|
|
28
28
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
29
|
#endif
|
|
30
30
|
|
|
31
|
+
// Forward declaration of `AdvancedCommerceInfoIOS` to properly resolve imports.
|
|
32
|
+
namespace margelo::nitro::iap { struct AdvancedCommerceInfoIOS; }
|
|
31
33
|
// Forward declaration of `PurchaseOfferIOS` to properly resolve imports.
|
|
32
34
|
namespace margelo::nitro::iap { struct PurchaseOfferIOS; }
|
|
33
35
|
// Forward declaration of `IapPlatform` to properly resolve imports.
|
|
@@ -40,9 +42,10 @@ namespace margelo::nitro::iap { struct RenewalInfoIOS; }
|
|
|
40
42
|
namespace margelo::nitro::iap { enum class IapStore; }
|
|
41
43
|
|
|
42
44
|
#include <NitroModules/Null.hpp>
|
|
43
|
-
#include
|
|
45
|
+
#include "AdvancedCommerceInfoIOS.hpp"
|
|
44
46
|
#include <variant>
|
|
45
47
|
#include <optional>
|
|
48
|
+
#include <string>
|
|
46
49
|
#include <vector>
|
|
47
50
|
#include "PurchaseOfferIOS.hpp"
|
|
48
51
|
#include "IapPlatform.hpp"
|
|
@@ -57,6 +60,7 @@ namespace margelo::nitro::iap {
|
|
|
57
60
|
*/
|
|
58
61
|
struct PurchaseIOS final {
|
|
59
62
|
public:
|
|
63
|
+
std::optional<std::variant<nitro::NullType, AdvancedCommerceInfoIOS>> advancedCommerceInfoIOS SWIFT_PRIVATE;
|
|
60
64
|
std::optional<std::variant<nitro::NullType, std::string>> appAccountToken SWIFT_PRIVATE;
|
|
61
65
|
std::optional<std::variant<nitro::NullType, std::string>> appBundleIdIOS SWIFT_PRIVATE;
|
|
62
66
|
std::optional<std::variant<nitro::NullType, std::string>> countryCodeIOS SWIFT_PRIVATE;
|
|
@@ -94,7 +98,7 @@ namespace margelo::nitro::iap {
|
|
|
94
98
|
|
|
95
99
|
public:
|
|
96
100
|
PurchaseIOS() = default;
|
|
97
|
-
explicit PurchaseIOS(std::optional<std::variant<nitro::NullType, std::string>> appAccountToken, std::optional<std::variant<nitro::NullType, std::string>> appBundleIdIOS, std::optional<std::variant<nitro::NullType, std::string>> countryCodeIOS, std::optional<std::variant<nitro::NullType, std::string>> currencyCodeIOS, std::optional<std::variant<nitro::NullType, std::string>> currencySymbolIOS, std::optional<std::variant<nitro::NullType, std::string>> currentPlanId, std::optional<std::variant<nitro::NullType, std::string>> environmentIOS, std::optional<std::variant<nitro::NullType, double>> expirationDateIOS, std::string id, std::optional<std::variant<nitro::NullType, std::vector<std::string>>> ids, bool isAutoRenewing, std::optional<std::variant<nitro::NullType, bool>> isUpgradedIOS, std::optional<std::variant<nitro::NullType, PurchaseOfferIOS>> offerIOS, std::optional<std::variant<nitro::NullType, double>> originalTransactionDateIOS, std::optional<std::variant<nitro::NullType, std::string>> originalTransactionIdentifierIOS, std::optional<std::variant<nitro::NullType, std::string>> ownershipTypeIOS, IapPlatform platform, std::string productId, PurchaseState purchaseState, std::optional<std::variant<nitro::NullType, std::string>> purchaseToken, double quantity, std::optional<std::variant<nitro::NullType, double>> quantityIOS, std::optional<std::variant<nitro::NullType, std::string>> reasonIOS, std::optional<std::variant<nitro::NullType, std::string>> reasonStringRepresentationIOS, std::optional<std::variant<nitro::NullType, RenewalInfoIOS>> renewalInfoIOS, std::optional<std::variant<nitro::NullType, double>> revocationDateIOS, std::optional<std::variant<nitro::NullType, std::string>> revocationReasonIOS, IapStore store, std::optional<std::variant<nitro::NullType, std::string>> storefrontCountryCodeIOS, std::optional<std::variant<nitro::NullType, std::string>> subscriptionGroupIdIOS, double transactionDate, std::string transactionId, std::optional<std::variant<nitro::NullType, std::string>> transactionReasonIOS, std::optional<std::variant<nitro::NullType, std::string>> webOrderLineItemIdIOS): appAccountToken(appAccountToken), appBundleIdIOS(appBundleIdIOS), countryCodeIOS(countryCodeIOS), currencyCodeIOS(currencyCodeIOS), currencySymbolIOS(currencySymbolIOS), currentPlanId(currentPlanId), environmentIOS(environmentIOS), expirationDateIOS(expirationDateIOS), id(id), ids(ids), isAutoRenewing(isAutoRenewing), isUpgradedIOS(isUpgradedIOS), offerIOS(offerIOS), originalTransactionDateIOS(originalTransactionDateIOS), originalTransactionIdentifierIOS(originalTransactionIdentifierIOS), ownershipTypeIOS(ownershipTypeIOS), platform(platform), productId(productId), purchaseState(purchaseState), purchaseToken(purchaseToken), quantity(quantity), quantityIOS(quantityIOS), reasonIOS(reasonIOS), reasonStringRepresentationIOS(reasonStringRepresentationIOS), renewalInfoIOS(renewalInfoIOS), revocationDateIOS(revocationDateIOS), revocationReasonIOS(revocationReasonIOS), store(store), storefrontCountryCodeIOS(storefrontCountryCodeIOS), subscriptionGroupIdIOS(subscriptionGroupIdIOS), transactionDate(transactionDate), transactionId(transactionId), transactionReasonIOS(transactionReasonIOS), webOrderLineItemIdIOS(webOrderLineItemIdIOS) {}
|
|
101
|
+
explicit PurchaseIOS(std::optional<std::variant<nitro::NullType, AdvancedCommerceInfoIOS>> advancedCommerceInfoIOS, std::optional<std::variant<nitro::NullType, std::string>> appAccountToken, std::optional<std::variant<nitro::NullType, std::string>> appBundleIdIOS, std::optional<std::variant<nitro::NullType, std::string>> countryCodeIOS, std::optional<std::variant<nitro::NullType, std::string>> currencyCodeIOS, std::optional<std::variant<nitro::NullType, std::string>> currencySymbolIOS, std::optional<std::variant<nitro::NullType, std::string>> currentPlanId, std::optional<std::variant<nitro::NullType, std::string>> environmentIOS, std::optional<std::variant<nitro::NullType, double>> expirationDateIOS, std::string id, std::optional<std::variant<nitro::NullType, std::vector<std::string>>> ids, bool isAutoRenewing, std::optional<std::variant<nitro::NullType, bool>> isUpgradedIOS, std::optional<std::variant<nitro::NullType, PurchaseOfferIOS>> offerIOS, std::optional<std::variant<nitro::NullType, double>> originalTransactionDateIOS, std::optional<std::variant<nitro::NullType, std::string>> originalTransactionIdentifierIOS, std::optional<std::variant<nitro::NullType, std::string>> ownershipTypeIOS, IapPlatform platform, std::string productId, PurchaseState purchaseState, std::optional<std::variant<nitro::NullType, std::string>> purchaseToken, double quantity, std::optional<std::variant<nitro::NullType, double>> quantityIOS, std::optional<std::variant<nitro::NullType, std::string>> reasonIOS, std::optional<std::variant<nitro::NullType, std::string>> reasonStringRepresentationIOS, std::optional<std::variant<nitro::NullType, RenewalInfoIOS>> renewalInfoIOS, std::optional<std::variant<nitro::NullType, double>> revocationDateIOS, std::optional<std::variant<nitro::NullType, std::string>> revocationReasonIOS, IapStore store, std::optional<std::variant<nitro::NullType, std::string>> storefrontCountryCodeIOS, std::optional<std::variant<nitro::NullType, std::string>> subscriptionGroupIdIOS, double transactionDate, std::string transactionId, std::optional<std::variant<nitro::NullType, std::string>> transactionReasonIOS, std::optional<std::variant<nitro::NullType, std::string>> webOrderLineItemIdIOS): advancedCommerceInfoIOS(advancedCommerceInfoIOS), appAccountToken(appAccountToken), appBundleIdIOS(appBundleIdIOS), countryCodeIOS(countryCodeIOS), currencyCodeIOS(currencyCodeIOS), currencySymbolIOS(currencySymbolIOS), currentPlanId(currentPlanId), environmentIOS(environmentIOS), expirationDateIOS(expirationDateIOS), id(id), ids(ids), isAutoRenewing(isAutoRenewing), isUpgradedIOS(isUpgradedIOS), offerIOS(offerIOS), originalTransactionDateIOS(originalTransactionDateIOS), originalTransactionIdentifierIOS(originalTransactionIdentifierIOS), ownershipTypeIOS(ownershipTypeIOS), platform(platform), productId(productId), purchaseState(purchaseState), purchaseToken(purchaseToken), quantity(quantity), quantityIOS(quantityIOS), reasonIOS(reasonIOS), reasonStringRepresentationIOS(reasonStringRepresentationIOS), renewalInfoIOS(renewalInfoIOS), revocationDateIOS(revocationDateIOS), revocationReasonIOS(revocationReasonIOS), store(store), storefrontCountryCodeIOS(storefrontCountryCodeIOS), subscriptionGroupIdIOS(subscriptionGroupIdIOS), transactionDate(transactionDate), transactionId(transactionId), transactionReasonIOS(transactionReasonIOS), webOrderLineItemIdIOS(webOrderLineItemIdIOS) {}
|
|
98
102
|
|
|
99
103
|
public:
|
|
100
104
|
friend bool operator==(const PurchaseIOS& lhs, const PurchaseIOS& rhs) = default;
|
|
@@ -110,6 +114,7 @@ namespace margelo::nitro {
|
|
|
110
114
|
static inline margelo::nitro::iap::PurchaseIOS fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
111
115
|
jsi::Object obj = arg.asObject(runtime);
|
|
112
116
|
return margelo::nitro::iap::PurchaseIOS(
|
|
117
|
+
JSIConverter<std::optional<std::variant<nitro::NullType, margelo::nitro::iap::AdvancedCommerceInfoIOS>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "advancedCommerceInfoIOS"))),
|
|
113
118
|
JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "appAccountToken"))),
|
|
114
119
|
JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "appBundleIdIOS"))),
|
|
115
120
|
JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "countryCodeIOS"))),
|
|
@@ -148,6 +153,7 @@ namespace margelo::nitro {
|
|
|
148
153
|
}
|
|
149
154
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::iap::PurchaseIOS& arg) {
|
|
150
155
|
jsi::Object obj(runtime);
|
|
156
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "advancedCommerceInfoIOS"), JSIConverter<std::optional<std::variant<nitro::NullType, margelo::nitro::iap::AdvancedCommerceInfoIOS>>>::toJSI(runtime, arg.advancedCommerceInfoIOS));
|
|
151
157
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "appAccountToken"), JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::toJSI(runtime, arg.appAccountToken));
|
|
152
158
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "appBundleIdIOS"), JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::toJSI(runtime, arg.appBundleIdIOS));
|
|
153
159
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "countryCodeIOS"), JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::toJSI(runtime, arg.countryCodeIOS));
|
|
@@ -192,6 +198,7 @@ namespace margelo::nitro {
|
|
|
192
198
|
if (!nitro::isPlainObject(runtime, obj)) {
|
|
193
199
|
return false;
|
|
194
200
|
}
|
|
201
|
+
if (!JSIConverter<std::optional<std::variant<nitro::NullType, margelo::nitro::iap::AdvancedCommerceInfoIOS>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "advancedCommerceInfoIOS")))) return false;
|
|
195
202
|
if (!JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "appAccountToken")))) return false;
|
|
196
203
|
if (!JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "appBundleIdIOS")))) return false;
|
|
197
204
|
if (!JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "countryCodeIOS")))) return false;
|
package/openiap-versions.json
CHANGED
package/package.json
CHANGED
|
@@ -34,7 +34,7 @@ type IapPluginProps = {
|
|
|
34
34
|
/**
|
|
35
35
|
* IAPKit API key for purchase verification.
|
|
36
36
|
* This key will be added to AndroidManifest.xml (as meta-data) and Info.plist.
|
|
37
|
-
* Get your API key from https://
|
|
37
|
+
* Get your API key from https://kit.openiap.dev
|
|
38
38
|
*/
|
|
39
39
|
iapkitApiKey?: string;
|
|
40
40
|
};
|
package/plugin/src/withIAP.ts
CHANGED
|
@@ -363,7 +363,7 @@ type IapPluginProps = {
|
|
|
363
363
|
/**
|
|
364
364
|
* IAPKit API key for purchase verification.
|
|
365
365
|
* This key will be added to AndroidManifest.xml (as meta-data) and Info.plist.
|
|
366
|
-
* Get your API key from https://
|
|
366
|
+
* Get your API key from https://kit.openiap.dev
|
|
367
367
|
*/
|
|
368
368
|
iapkitApiKey?: string;
|
|
369
369
|
};
|