@pnlight/sdk-react-native 0.1.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 +44 -0
- package/PNLight.xcframework/ios-arm64/PNLight.framework/Headers/PNLight-Swift.h +341 -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 +625 -0
- package/PNLight.xcframework/ios-arm64/PNLight.framework/Modules/PNLight.swiftmodule/arm64-apple-ios.private.swiftinterface +39 -0
- 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 +39 -0
- package/PNLight.xcframework/ios-arm64/PNLight.framework/Modules/module.modulemap +4 -0
- package/PNLight.xcframework/ios-arm64/PNLight.framework/PNLight +0 -0
- package/PNLight.xcframework/ios-arm64_x86_64-simulator/PNLight.framework/Headers/PNLight-Swift.h +678 -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 +625 -0
- package/PNLight.xcframework/ios-arm64_x86_64-simulator/PNLight.framework/Modules/PNLight.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +39 -0
- 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 +39 -0
- package/PNLight.xcframework/ios-arm64_x86_64-simulator/PNLight.framework/Modules/PNLight.swiftmodule/x86_64-apple-ios-simulator.abi.json +625 -0
- package/PNLight.xcframework/ios-arm64_x86_64-simulator/PNLight.framework/Modules/PNLight.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +39 -0
- 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 +39 -0
- package/PNLight.xcframework/ios-arm64_x86_64-simulator/PNLight.framework/Modules/module.modulemap +4 -0
- package/PNLight.xcframework/ios-arm64_x86_64-simulator/PNLight.framework/PNLight +0 -0
- package/PNLightSDK.podspec +20 -0
- package/index.d.ts +3 -0
- package/index.js +14 -0
- package/ios/PNLightSDK.m +10 -0
- package/ios/PNLightSDK.swift +19 -0
- package/package.json +28 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// swift-interface-format-version: 1.0
|
|
2
|
+
// swift-compiler-version: Apple Swift version 6.0.3 effective-5.10 (swiftlang-6.0.3.1.10 clang-1600.0.30.1)
|
|
3
|
+
// swift-module-flags: -target x86_64-apple-ios13.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -enable-bare-slash-regex -module-name PNLight
|
|
4
|
+
// swift-module-flags-ignorable: -no-verify-emitted-module-interface
|
|
5
|
+
import AdSupport
|
|
6
|
+
import AppTrackingTransparency
|
|
7
|
+
import CoreMotion
|
|
8
|
+
import Foundation
|
|
9
|
+
import Security
|
|
10
|
+
import StoreKit
|
|
11
|
+
import Swift
|
|
12
|
+
import UIKit
|
|
13
|
+
import _Concurrency
|
|
14
|
+
import _StringProcessing
|
|
15
|
+
import _SwiftConcurrencyShims
|
|
16
|
+
import os
|
|
17
|
+
extension PNLight.PNLightSDK {
|
|
18
|
+
final public func logEvent(_ eventName: Swift.String, eventArgs: [Swift.String : Any]? = nil) async
|
|
19
|
+
}
|
|
20
|
+
extension PNLight.PNLightSDK {
|
|
21
|
+
final public func getIdfa() -> Swift.String?
|
|
22
|
+
}
|
|
23
|
+
extension PNLight.PNLightSDK {
|
|
24
|
+
final public func onPurchased() async
|
|
25
|
+
}
|
|
26
|
+
extension PNLight.PNLightSDK {
|
|
27
|
+
final public func validatePurchase() async -> Swift.Bool
|
|
28
|
+
}
|
|
29
|
+
extension PNLight.PNLightSDK {
|
|
30
|
+
final public func getOrCreateUserId() -> (id: Swift.String, isNew: Swift.Bool)
|
|
31
|
+
}
|
|
32
|
+
@objc @_inheritsConvenienceInitializers @_hasMissingDesignatedInitializers final public class PNLightSDK : ObjectiveC.NSObject {
|
|
33
|
+
public static let shared: PNLight.PNLightSDK
|
|
34
|
+
final public func initialize(apiKey: Swift.String) async
|
|
35
|
+
@objc deinit
|
|
36
|
+
}
|
|
37
|
+
extension PNLight.PNLightSDK : StoreKit.SKPaymentTransactionObserver {
|
|
38
|
+
@objc final public func paymentQueue(_ queue: StoreKit.SKPaymentQueue, updatedTransactions transactions: [StoreKit.SKPaymentTransaction])
|
|
39
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// swift-interface-format-version: 1.0
|
|
2
|
+
// swift-compiler-version: Apple Swift version 6.0.3 effective-5.10 (swiftlang-6.0.3.1.10 clang-1600.0.30.1)
|
|
3
|
+
// swift-module-flags: -target x86_64-apple-ios13.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -enable-bare-slash-regex -module-name PNLight
|
|
4
|
+
// swift-module-flags-ignorable: -no-verify-emitted-module-interface
|
|
5
|
+
import AdSupport
|
|
6
|
+
import AppTrackingTransparency
|
|
7
|
+
import CoreMotion
|
|
8
|
+
import Foundation
|
|
9
|
+
import Security
|
|
10
|
+
import StoreKit
|
|
11
|
+
import Swift
|
|
12
|
+
import UIKit
|
|
13
|
+
import _Concurrency
|
|
14
|
+
import _StringProcessing
|
|
15
|
+
import _SwiftConcurrencyShims
|
|
16
|
+
import os
|
|
17
|
+
extension PNLight.PNLightSDK {
|
|
18
|
+
final public func logEvent(_ eventName: Swift.String, eventArgs: [Swift.String : Any]? = nil) async
|
|
19
|
+
}
|
|
20
|
+
extension PNLight.PNLightSDK {
|
|
21
|
+
final public func getIdfa() -> Swift.String?
|
|
22
|
+
}
|
|
23
|
+
extension PNLight.PNLightSDK {
|
|
24
|
+
final public func onPurchased() async
|
|
25
|
+
}
|
|
26
|
+
extension PNLight.PNLightSDK {
|
|
27
|
+
final public func validatePurchase() async -> Swift.Bool
|
|
28
|
+
}
|
|
29
|
+
extension PNLight.PNLightSDK {
|
|
30
|
+
final public func getOrCreateUserId() -> (id: Swift.String, isNew: Swift.Bool)
|
|
31
|
+
}
|
|
32
|
+
@objc @_inheritsConvenienceInitializers @_hasMissingDesignatedInitializers final public class PNLightSDK : ObjectiveC.NSObject {
|
|
33
|
+
public static let shared: PNLight.PNLightSDK
|
|
34
|
+
final public func initialize(apiKey: Swift.String) async
|
|
35
|
+
@objc deinit
|
|
36
|
+
}
|
|
37
|
+
extension PNLight.PNLightSDK : StoreKit.SKPaymentTransactionObserver {
|
|
38
|
+
@objc final public func paymentQueue(_ queue: StoreKit.SKPaymentQueue, updatedTransactions transactions: [StoreKit.SKPaymentTransaction])
|
|
39
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Pod::Spec.new do |s|
|
|
2
|
+
s.name = 'PNLightSDK-ReactNative'
|
|
3
|
+
s.version = '0.1.0'
|
|
4
|
+
s.summary = 'React Native wrapper for PNLight iOS SDK'
|
|
5
|
+
s.description = 'Provides RN bridge to PNLight.xcframework'
|
|
6
|
+
s.homepage = 'https://pnlight.app'
|
|
7
|
+
s.license = { :type => 'MIT', :text => 'See LICENSE' }
|
|
8
|
+
s.author = { 'PNLight' => 'support@example.com' }
|
|
9
|
+
s.source = { :git => 'https://github.com/your-org/pnlight-sdk.git', :tag => s.version.to_s }
|
|
10
|
+
s.platform = :ios, '13.0'
|
|
11
|
+
s.swift_versions = ['5.7', '5.8', '5.9']
|
|
12
|
+
|
|
13
|
+
s.source_files = 'ios/**/*.{h,m,mm,swift}'
|
|
14
|
+
s.dependency 'React-Core'
|
|
15
|
+
s.vendored_frameworks = 'PNLight.xcframework'
|
|
16
|
+
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
package/index.d.ts
ADDED
package/index.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const { NativeModules } = require("react-native");
|
|
3
|
+
|
|
4
|
+
const { PNLightSDK } = NativeModules;
|
|
5
|
+
|
|
6
|
+
module.exports = {
|
|
7
|
+
initialize(apiKey) {
|
|
8
|
+
return PNLightSDK.initialize(apiKey);
|
|
9
|
+
},
|
|
10
|
+
async validatePurchase() {
|
|
11
|
+
return await PNLightSDK.validatePurchase();
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
|
package/ios/PNLightSDK.m
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#import <React/RCTBridgeModule.h>
|
|
2
|
+
@import PNLight;
|
|
3
|
+
|
|
4
|
+
@interface RCT_EXTERN_MODULE(PNLightSDK, NSObject)
|
|
5
|
+
RCT_EXTERN_METHOD(initialize:(NSString *)apiKey)
|
|
6
|
+
RCT_EXTERN_METHOD(validatePurchase:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject)
|
|
7
|
+
@end
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
import React
|
|
3
|
+
import PNLight
|
|
4
|
+
|
|
5
|
+
@objc(PNLightSDK)
|
|
6
|
+
class PNLightRNModule: NSObject {
|
|
7
|
+
@objc func initialize(_ apiKey: String) {
|
|
8
|
+
PNLightSDK.initialize(apiKey: apiKey)
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@objc func validatePurchase(_ resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) {
|
|
12
|
+
Task {
|
|
13
|
+
let result = await PNLightSDK.validatePurchase()
|
|
14
|
+
resolve(result)
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
|
package/package.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pnlight/sdk-react-native",
|
|
3
|
+
"version": "0.1.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.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
|
+
}
|