@pnlight/sdk-react-native 0.3.7 → 0.4.0
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/PNLight.xcframework/Info.plist +5 -5
- package/PNLight.xcframework/ios-arm64/PNLight.framework/Headers/PNLight-Swift.h +2 -0
- package/PNLight.xcframework/ios-arm64/PNLight.framework/Modules/PNLight.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
- package/PNLight.xcframework/ios-arm64/PNLight.framework/Modules/PNLight.swiftmodule/arm64-apple-ios.abi.json +1019 -47
- package/PNLight.xcframework/ios-arm64/PNLight.framework/Modules/PNLight.swiftmodule/arm64-apple-ios.private.swiftinterface +35 -1
- package/PNLight.xcframework/ios-arm64/PNLight.framework/Modules/PNLight.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/PNLight.xcframework/ios-arm64/PNLight.framework/Modules/PNLight.swiftmodule/arm64-apple-ios.swiftinterface +35 -1
- package/PNLight.xcframework/ios-arm64/PNLight.framework/PNLight +0 -0
- package/PNLight.xcframework/ios-arm64_x86_64-simulator/PNLight.framework/Headers/PNLight-Swift.h +4 -0
- package/PNLight.xcframework/ios-arm64_x86_64-simulator/PNLight.framework/Modules/PNLight.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo +0 -0
- package/PNLight.xcframework/ios-arm64_x86_64-simulator/PNLight.framework/Modules/PNLight.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo +0 -0
- package/PNLight.xcframework/ios-arm64_x86_64-simulator/PNLight.framework/Modules/PNLight.swiftmodule/arm64-apple-ios-simulator.abi.json +1019 -47
- package/PNLight.xcframework/ios-arm64_x86_64-simulator/PNLight.framework/Modules/PNLight.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +35 -1
- package/PNLight.xcframework/ios-arm64_x86_64-simulator/PNLight.framework/Modules/PNLight.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/PNLight.xcframework/ios-arm64_x86_64-simulator/PNLight.framework/Modules/PNLight.swiftmodule/arm64-apple-ios-simulator.swiftinterface +35 -1
- package/PNLight.xcframework/ios-arm64_x86_64-simulator/PNLight.framework/Modules/PNLight.swiftmodule/x86_64-apple-ios-simulator.abi.json +1019 -47
- package/PNLight.xcframework/ios-arm64_x86_64-simulator/PNLight.framework/Modules/PNLight.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +35 -1
- package/PNLight.xcframework/ios-arm64_x86_64-simulator/PNLight.framework/Modules/PNLight.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/PNLight.xcframework/ios-arm64_x86_64-simulator/PNLight.framework/Modules/PNLight.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +35 -1
- package/PNLight.xcframework/ios-arm64_x86_64-simulator/PNLight.framework/PNLight +0 -0
- package/PNLightSDK-ReactNative.podspec +4 -1
- package/index.d.ts +34 -1
- package/index.js +18 -2
- package/ios/PNLightSDK.m +2 -0
- package/ios/PNLightSDK.swift +43 -2
- package/ios/RemoteUiView.swift +48 -0
- package/ios/RemoteUiViewManager.m +6 -0
- package/ios/RemoteUiViewManager.swift +18 -0
- package/package.json +27 -27
|
@@ -14,6 +14,23 @@ import _Concurrency
|
|
|
14
14
|
import _StringProcessing
|
|
15
15
|
import _SwiftConcurrencyShims
|
|
16
16
|
import os
|
|
17
|
+
extension PNLight.PNLightSDK {
|
|
18
|
+
public enum AttributionProvider : Swift.String, Swift.Codable {
|
|
19
|
+
case appsFlyer
|
|
20
|
+
case adjust
|
|
21
|
+
case firebase
|
|
22
|
+
case appleAdsAttribution
|
|
23
|
+
case custom
|
|
24
|
+
case facebook
|
|
25
|
+
public init?(rawValue: Swift.String)
|
|
26
|
+
public typealias RawValue = Swift.String
|
|
27
|
+
public var rawValue: Swift.String {
|
|
28
|
+
get
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
@discardableResult
|
|
32
|
+
final public func addAttribution(provider: PNLight.PNLightSDK.AttributionProvider, data: [Swift.String : Any]? = nil, identifier: Swift.String? = nil) async -> Swift.Bool
|
|
33
|
+
}
|
|
17
34
|
extension PNLight.PNLightSDK {
|
|
18
35
|
final public func logEvent(_ eventName: Swift.String, eventArgs: [Swift.String : Any]? = nil) async
|
|
19
36
|
}
|
|
@@ -26,14 +43,31 @@ extension PNLight.PNLightSDK {
|
|
|
26
43
|
extension PNLight.PNLightSDK {
|
|
27
44
|
final public func validatePurchase(captcha: Swift.Bool = true) async -> Swift.Bool
|
|
28
45
|
}
|
|
46
|
+
public struct UIConfig {
|
|
47
|
+
public let config: Swift.String?
|
|
48
|
+
public let parameters: [Swift.String : Any]?
|
|
49
|
+
}
|
|
50
|
+
extension PNLight.PNLightSDK {
|
|
51
|
+
final public func getUIConfig(placement: Swift.String) async -> PNLight.UIConfig?
|
|
52
|
+
final public func prefetchUIConfig(placement: Swift.String)
|
|
53
|
+
final public func clearUIConfigCache()
|
|
54
|
+
}
|
|
29
55
|
extension PNLight.PNLightSDK {
|
|
30
56
|
final public func getOrCreateUserId() -> (id: Swift.String, isNew: Swift.Bool)
|
|
57
|
+
final public func resetUserId()
|
|
58
|
+
}
|
|
59
|
+
public struct PNLightConfig {
|
|
60
|
+
public var baseDomain: Swift.String?
|
|
61
|
+
public init(baseDomain: Swift.String? = nil)
|
|
31
62
|
}
|
|
32
63
|
@objc @_inheritsConvenienceInitializers @_hasMissingDesignatedInitializers final public class PNLightSDK : ObjectiveC.NSObject {
|
|
33
64
|
public static let shared: PNLight.PNLightSDK
|
|
34
|
-
final public func initialize(apiKey: Swift.String) async
|
|
65
|
+
final public func initialize(apiKey: Swift.String, config: PNLight.PNLightConfig? = nil) async
|
|
35
66
|
@objc deinit
|
|
36
67
|
}
|
|
37
68
|
extension PNLight.PNLightSDK : StoreKit.SKPaymentTransactionObserver {
|
|
38
69
|
@objc final public func paymentQueue(_ queue: StoreKit.SKPaymentQueue, updatedTransactions transactions: [StoreKit.SKPaymentTransaction])
|
|
39
70
|
}
|
|
71
|
+
extension PNLight.PNLightSDK.AttributionProvider : Swift.Equatable {}
|
|
72
|
+
extension PNLight.PNLightSDK.AttributionProvider : Swift.Hashable {}
|
|
73
|
+
extension PNLight.PNLightSDK.AttributionProvider : Swift.RawRepresentable {}
|
|
Binary file
|
|
@@ -14,6 +14,23 @@ import _Concurrency
|
|
|
14
14
|
import _StringProcessing
|
|
15
15
|
import _SwiftConcurrencyShims
|
|
16
16
|
import os
|
|
17
|
+
extension PNLight.PNLightSDK {
|
|
18
|
+
public enum AttributionProvider : Swift.String, Swift.Codable {
|
|
19
|
+
case appsFlyer
|
|
20
|
+
case adjust
|
|
21
|
+
case firebase
|
|
22
|
+
case appleAdsAttribution
|
|
23
|
+
case custom
|
|
24
|
+
case facebook
|
|
25
|
+
public init?(rawValue: Swift.String)
|
|
26
|
+
public typealias RawValue = Swift.String
|
|
27
|
+
public var rawValue: Swift.String {
|
|
28
|
+
get
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
@discardableResult
|
|
32
|
+
final public func addAttribution(provider: PNLight.PNLightSDK.AttributionProvider, data: [Swift.String : Any]? = nil, identifier: Swift.String? = nil) async -> Swift.Bool
|
|
33
|
+
}
|
|
17
34
|
extension PNLight.PNLightSDK {
|
|
18
35
|
final public func logEvent(_ eventName: Swift.String, eventArgs: [Swift.String : Any]? = nil) async
|
|
19
36
|
}
|
|
@@ -26,14 +43,31 @@ extension PNLight.PNLightSDK {
|
|
|
26
43
|
extension PNLight.PNLightSDK {
|
|
27
44
|
final public func validatePurchase(captcha: Swift.Bool = true) async -> Swift.Bool
|
|
28
45
|
}
|
|
46
|
+
public struct UIConfig {
|
|
47
|
+
public let config: Swift.String?
|
|
48
|
+
public let parameters: [Swift.String : Any]?
|
|
49
|
+
}
|
|
50
|
+
extension PNLight.PNLightSDK {
|
|
51
|
+
final public func getUIConfig(placement: Swift.String) async -> PNLight.UIConfig?
|
|
52
|
+
final public func prefetchUIConfig(placement: Swift.String)
|
|
53
|
+
final public func clearUIConfigCache()
|
|
54
|
+
}
|
|
29
55
|
extension PNLight.PNLightSDK {
|
|
30
56
|
final public func getOrCreateUserId() -> (id: Swift.String, isNew: Swift.Bool)
|
|
57
|
+
final public func resetUserId()
|
|
58
|
+
}
|
|
59
|
+
public struct PNLightConfig {
|
|
60
|
+
public var baseDomain: Swift.String?
|
|
61
|
+
public init(baseDomain: Swift.String? = nil)
|
|
31
62
|
}
|
|
32
63
|
@objc @_inheritsConvenienceInitializers @_hasMissingDesignatedInitializers final public class PNLightSDK : ObjectiveC.NSObject {
|
|
33
64
|
public static let shared: PNLight.PNLightSDK
|
|
34
|
-
final public func initialize(apiKey: Swift.String) async
|
|
65
|
+
final public func initialize(apiKey: Swift.String, config: PNLight.PNLightConfig? = nil) async
|
|
35
66
|
@objc deinit
|
|
36
67
|
}
|
|
37
68
|
extension PNLight.PNLightSDK : StoreKit.SKPaymentTransactionObserver {
|
|
38
69
|
@objc final public func paymentQueue(_ queue: StoreKit.SKPaymentQueue, updatedTransactions transactions: [StoreKit.SKPaymentTransaction])
|
|
39
70
|
}
|
|
71
|
+
extension PNLight.PNLightSDK.AttributionProvider : Swift.Equatable {}
|
|
72
|
+
extension PNLight.PNLightSDK.AttributionProvider : Swift.Hashable {}
|
|
73
|
+
extension PNLight.PNLightSDK.AttributionProvider : Swift.RawRepresentable {}
|
|
Binary file
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
# Host app Podfile must include DivKit source for RemoteUiView (DivKit):
|
|
2
|
+
# source 'https://github.com/divkit/divkit-ios.git'
|
|
1
3
|
Pod::Spec.new do |s|
|
|
2
4
|
s.name = 'PNLightSDK-ReactNative'
|
|
3
5
|
s.version = '0.3.7'
|
|
4
6
|
s.summary = 'React Native wrapper for PNLight iOS SDK'
|
|
5
|
-
s.description = 'Provides RN bridge to PNLight.xcframework'
|
|
7
|
+
s.description = 'Provides RN bridge to PNLight.xcframework. RemoteUiView uses DivKit (~> 32.32); add DivKit source to Podfile if using it.'
|
|
6
8
|
s.homepage = 'https://pnlight.app'
|
|
7
9
|
s.license = { :type => 'MIT', :text => 'See LICENSE' }
|
|
8
10
|
s.author = { 'PNLight' => 'support@example.com' }
|
|
@@ -12,6 +14,7 @@ Pod::Spec.new do |s|
|
|
|
12
14
|
|
|
13
15
|
s.source_files = 'ios/**/*.{h,m,mm,swift}'
|
|
14
16
|
s.dependency 'React-Core'
|
|
17
|
+
s.dependency 'DivKit', '~> 32.32'
|
|
15
18
|
s.vendored_frameworks = 'PNLight.xcframework'
|
|
16
19
|
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
|
|
17
20
|
end
|
package/index.d.ts
CHANGED
|
@@ -1,6 +1,39 @@
|
|
|
1
|
-
export function initialize(apiKey: string): Promise<void>;
|
|
1
|
+
export function initialize(apiKey: string, baseDomain?: string): Promise<void>;
|
|
2
2
|
export function validatePurchase(captcha?: boolean): Promise<boolean>;
|
|
3
3
|
export function logEvent(
|
|
4
4
|
eventName: string,
|
|
5
5
|
eventArgs?: Record<string, any>
|
|
6
6
|
): Promise<void>;
|
|
7
|
+
export function getUserId(): Promise<string>;
|
|
8
|
+
export function resetUserId(): Promise<void>;
|
|
9
|
+
|
|
10
|
+
export type AttributionProvider =
|
|
11
|
+
| "appsFlyer"
|
|
12
|
+
| "adjust"
|
|
13
|
+
| "firebase"
|
|
14
|
+
| "appleAdsAttribution"
|
|
15
|
+
| "custom"
|
|
16
|
+
| "facebook";
|
|
17
|
+
|
|
18
|
+
export function addAttribution(
|
|
19
|
+
provider: AttributionProvider,
|
|
20
|
+
data?: Record<string, any> | null,
|
|
21
|
+
identifier?: string | null
|
|
22
|
+
): Promise<boolean>;
|
|
23
|
+
|
|
24
|
+
export function prefetchUIConfig(placement: string): Promise<void>;
|
|
25
|
+
|
|
26
|
+
export interface UIConfig {
|
|
27
|
+
config: string | null;
|
|
28
|
+
parameters: Record<string, any> | null;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function getUIConfig(placement: string): Promise<UIConfig | null>;
|
|
32
|
+
|
|
33
|
+
export interface RemoteUiViewProps {
|
|
34
|
+
placement: string;
|
|
35
|
+
style?: import("react-native").StyleProp<import("react-native").ViewStyle>;
|
|
36
|
+
cardId?: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const RemoteUiView: (props: RemoteUiViewProps) => import("react").ReactElement | null;
|
package/index.js
CHANGED
|
@@ -4,8 +4,8 @@ const { NativeModules } = require("react-native");
|
|
|
4
4
|
const PNLightNative = NativeModules.PNLightRN || NativeModules.PNLightSDK;
|
|
5
5
|
|
|
6
6
|
module.exports = {
|
|
7
|
-
initialize(apiKey) {
|
|
8
|
-
return PNLightNative.initialize(apiKey);
|
|
7
|
+
initialize(apiKey, baseDomain = null) {
|
|
8
|
+
return PNLightNative.initialize(apiKey, baseDomain);
|
|
9
9
|
},
|
|
10
10
|
async validatePurchase(captcha = true) {
|
|
11
11
|
return await PNLightNative.validatePurchase(captcha);
|
|
@@ -13,4 +13,20 @@ module.exports = {
|
|
|
13
13
|
async logEvent(eventName, eventArgs = {}) {
|
|
14
14
|
return await PNLightNative.logEvent(eventName, eventArgs);
|
|
15
15
|
},
|
|
16
|
+
async getUserId() {
|
|
17
|
+
return await PNLightNative.getUserId();
|
|
18
|
+
},
|
|
19
|
+
async resetUserId() {
|
|
20
|
+
return await PNLightNative.resetUserId();
|
|
21
|
+
},
|
|
22
|
+
async addAttribution(provider, data = null, identifier = null) {
|
|
23
|
+
return await PNLightNative.addAttribution(provider, data, identifier);
|
|
24
|
+
},
|
|
25
|
+
async prefetchUIConfig(placement) {
|
|
26
|
+
return await PNLightNative.prefetchUIConfig(placement);
|
|
27
|
+
},
|
|
28
|
+
async getUIConfig(placement) {
|
|
29
|
+
return await PNLightNative.getUIConfig(placement);
|
|
30
|
+
},
|
|
31
|
+
RemoteUiView: require("./RemoteUiView").RemoteUiView,
|
|
16
32
|
};
|
package/ios/PNLightSDK.m
CHANGED
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
RCT_EXTERN_METHOD(initialize:(NSString *)apiKey resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject)
|
|
6
6
|
RCT_EXTERN_METHOD(validatePurchase:(BOOL)captcha resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject)
|
|
7
7
|
RCT_EXTERN_METHOD(logEvent:(NSString *)eventName eventArgs:(NSDictionary *)eventArgs resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject)
|
|
8
|
+
RCT_EXTERN_METHOD(prefetchUIConfig:(NSString *)placement resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject)
|
|
9
|
+
RCT_EXTERN_METHOD(getUIConfig:(NSString *)placement resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject)
|
|
8
10
|
@end
|
|
9
11
|
|
|
10
12
|
|
package/ios/PNLightSDK.swift
CHANGED
|
@@ -4,9 +4,10 @@ import PNLight
|
|
|
4
4
|
|
|
5
5
|
@objc(PNLightRN)
|
|
6
6
|
class PNLightRNModule: NSObject {
|
|
7
|
-
@objc func initialize(_ apiKey: String, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) {
|
|
7
|
+
@objc func initialize(_ apiKey: String, baseDomain: String? = nil, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) {
|
|
8
8
|
Task {
|
|
9
|
-
|
|
9
|
+
let config = baseDomain.map { PNLightConfig(baseDomain: $0) }
|
|
10
|
+
await PNLightSDK.shared.initialize(apiKey: apiKey, config: config)
|
|
10
11
|
resolve(nil)
|
|
11
12
|
}
|
|
12
13
|
}
|
|
@@ -24,6 +25,46 @@ class PNLightRNModule: NSObject {
|
|
|
24
25
|
resolve(nil)
|
|
25
26
|
}
|
|
26
27
|
}
|
|
28
|
+
|
|
29
|
+
@objc func getUserId(_ resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) {
|
|
30
|
+
let userId = PNLightSDK.shared.getOrCreateUserId().id
|
|
31
|
+
resolve(userId)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@objc func resetUserId(_ resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) {
|
|
35
|
+
PNLightSDK.shared.resetUserId()
|
|
36
|
+
resolve(nil)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@objc func addAttribution(_ providerString: String, data: [String: Any]?, identifier: String?, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) {
|
|
40
|
+
Task {
|
|
41
|
+
guard let provider = PNLightSDK.AttributionProvider(rawValue: providerString) else {
|
|
42
|
+
reject("INVALID_PROVIDER", "Invalid attribution provider: \(providerString)", nil)
|
|
43
|
+
return
|
|
44
|
+
}
|
|
45
|
+
let result = await PNLightSDK.shared.addAttribution(provider: provider, data: data, identifier: identifier)
|
|
46
|
+
resolve(result)
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@objc func prefetchUIConfig(_ placement: String, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) {
|
|
51
|
+
PNLightSDK.shared.prefetchUIConfig(placement: placement)
|
|
52
|
+
resolve(nil)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@objc func getUIConfig(_ placement: String, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) {
|
|
56
|
+
Task {
|
|
57
|
+
let uiConfig = await PNLightSDK.shared.getUIConfig(placement: placement)
|
|
58
|
+
if let uiConfig = uiConfig {
|
|
59
|
+
resolve([
|
|
60
|
+
"config": uiConfig.config as Any,
|
|
61
|
+
"parameters": uiConfig.parameters as Any,
|
|
62
|
+
])
|
|
63
|
+
} else {
|
|
64
|
+
resolve(nil)
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
27
68
|
}
|
|
28
69
|
|
|
29
70
|
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import UIKit
|
|
2
|
+
import DivKit
|
|
3
|
+
|
|
4
|
+
/// Native UIView that renders PNLight UI config (DivKit JSON) inside a DivView.
|
|
5
|
+
/// Shows nothing until config is set; then renders via DivKit per https://divkit.tech/docs/en/quickstart/ios
|
|
6
|
+
@objc(RemoteUiView)
|
|
7
|
+
final class RemoteUiView: UIView {
|
|
8
|
+
|
|
9
|
+
private let divView: DivView
|
|
10
|
+
private static let divKitComponents = DivKitComponents()
|
|
11
|
+
private var currentCardId: String = "pnlight_card"
|
|
12
|
+
|
|
13
|
+
override init(frame: CGRect) {
|
|
14
|
+
self.divView = DivView(divKitComponents: Self.divKitComponents)
|
|
15
|
+
super.init(frame: frame)
|
|
16
|
+
divView.translatesAutoresizingMaskIntoConstraints = false
|
|
17
|
+
addSubview(divView)
|
|
18
|
+
NSLayoutConstraint.activate([
|
|
19
|
+
divView.topAnchor.constraint(equalTo: topAnchor),
|
|
20
|
+
divView.leadingAnchor.constraint(equalTo: leadingAnchor),
|
|
21
|
+
divView.trailingAnchor.constraint(equalTo: trailingAnchor),
|
|
22
|
+
divView.bottomAnchor.constraint(equalTo: bottomAnchor),
|
|
23
|
+
])
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
required init?(coder: NSCoder) {
|
|
27
|
+
fatalError("init(coder:) has not been implemented")
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/// Renders the given DivKit JSON string. Pass nil to show blank (e.g. while loading).
|
|
31
|
+
private func applyConfig(configJson: String?, cardId: String) {
|
|
32
|
+
guard let configJson = configJson, !configJson.isEmpty,
|
|
33
|
+
let jsonData = configJson.data(using: .utf8) else {
|
|
34
|
+
return
|
|
35
|
+
}
|
|
36
|
+
divView.setSource(DivViewSource(kind: .data(jsonData), cardId: cardId))
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// MARK: - React Native view props
|
|
40
|
+
@objc func setConfig(_ value: NSString?) {
|
|
41
|
+
let json = value as String?
|
|
42
|
+
applyConfig(configJson: json, cardId: currentCardId)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@objc func setCardId(_ value: NSString?) {
|
|
46
|
+
currentCardId = (value as String?) ?? "pnlight_card"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React
|
|
2
|
+
import UIKit
|
|
3
|
+
|
|
4
|
+
@objc(RemoteUiViewManager)
|
|
5
|
+
final class RemoteUiViewManager: RCTViewManager {
|
|
6
|
+
|
|
7
|
+
override func view() -> UIView! {
|
|
8
|
+
return RemoteUiView()
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
override static func moduleName() -> String! {
|
|
12
|
+
return "RemoteUiView"
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
override static func requiresMainQueueSetup() -> Bool {
|
|
16
|
+
return true
|
|
17
|
+
}
|
|
18
|
+
}
|
package/package.json
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
2
|
+
"name": "@pnlight/sdk-react-native",
|
|
3
|
+
"version": "0.4.0",
|
|
4
|
+
"description": "React Native wrapper for PNLight iOS binary SDK",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"types": "index.d.ts",
|
|
7
|
+
"react-native": "index.js",
|
|
8
|
+
"files": [
|
|
9
|
+
"index.js",
|
|
10
|
+
"index.d.ts",
|
|
11
|
+
"ios",
|
|
12
|
+
"PNLight.xcframework",
|
|
13
|
+
"PNLightSDK-ReactNative.podspec"
|
|
14
|
+
],
|
|
15
|
+
"keywords": [
|
|
16
|
+
"pnlight",
|
|
17
|
+
"analytics",
|
|
18
|
+
"in-app-purchase",
|
|
19
|
+
"ios"
|
|
20
|
+
],
|
|
21
|
+
"author": "PNLight",
|
|
22
|
+
"license": "Commercial",
|
|
23
|
+
"scripts": {
|
|
24
|
+
"prepare": "node ./scripts/copy-xcframework.js",
|
|
25
|
+
"publish:dry": "npm pack",
|
|
26
|
+
"publish:real": "node ./scripts/publish_npm.js"
|
|
27
|
+
}
|
|
28
|
+
}
|