@oscilar/react-native-oscilar-module 3.0.2 → 3.0.4
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/OscilarModule.podspec +1 -1
- package/android/build.gradle +2 -2
- package/android/src/main/java/com/oscilarmodule/OscilarModuleModule.kt +31 -3
- package/ios/OscilarModule.mm +1 -1
- package/ios/OscilarModule.swift +12 -10
- package/lib/commonjs/index.js +10 -5
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/index.js +9 -5
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts +7 -3
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts +7 -3
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/index.tsx +16 -5
package/OscilarModule.podspec
CHANGED
package/android/build.gradle
CHANGED
|
@@ -98,8 +98,8 @@ def kotlin_version = getExtOrDefault("kotlinVersion")
|
|
|
98
98
|
dependencies {
|
|
99
99
|
implementation "com.facebook.react:react-android"
|
|
100
100
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
101
|
-
debugImplementation "com.oscilar:osclib:3.1.
|
|
102
|
-
releaseImplementation "com.oscilar:osclib:3.1.
|
|
101
|
+
debugImplementation "com.oscilar:osclib:3.1.3"
|
|
102
|
+
releaseImplementation "com.oscilar:osclib:3.1.3"
|
|
103
103
|
implementation "com.google.code.gson:gson:2.10.1"
|
|
104
104
|
implementation "com.squareup.retrofit2:retrofit:2.9.0"
|
|
105
105
|
implementation "com.squareup.retrofit2:converter-gson:2.9.0"
|
|
@@ -4,9 +4,11 @@ import com.facebook.react.bridge.ReactApplicationContext
|
|
|
4
4
|
import com.facebook.react.bridge.ReactContextBaseJavaModule
|
|
5
5
|
import com.facebook.react.bridge.ReactMethod
|
|
6
6
|
import com.facebook.react.bridge.Promise
|
|
7
|
+
import com.facebook.react.bridge.Arguments
|
|
7
8
|
import android.util.Log
|
|
8
9
|
import com.osc.and.OscApi
|
|
9
10
|
import com.osc.and.OscApiInterface
|
|
11
|
+
import com.osc.and.OscEnv
|
|
10
12
|
|
|
11
13
|
class OscilarModuleModule(reactContext: ReactApplicationContext) :
|
|
12
14
|
ReactContextBaseJavaModule(reactContext) {
|
|
@@ -18,15 +20,26 @@ class OscilarModuleModule(reactContext: ReactApplicationContext) :
|
|
|
18
20
|
private lateinit var oscApiInt: OscApiInterface
|
|
19
21
|
|
|
20
22
|
@ReactMethod
|
|
21
|
-
fun initOscilar(
|
|
23
|
+
fun initOscilar(
|
|
24
|
+
clientKey: String,
|
|
25
|
+
environment: Int?,
|
|
26
|
+
promise: Promise
|
|
27
|
+
) {
|
|
22
28
|
try {
|
|
23
|
-
val
|
|
24
|
-
|
|
29
|
+
val app = reactApplicationContext.applicationContext as android.app.Application
|
|
30
|
+
val env = when (environment) {
|
|
31
|
+
OscEnv.Dev.ordinal -> OscEnv.Dev
|
|
32
|
+
OscEnv.Sandbox.ordinal -> OscEnv.Sandbox
|
|
33
|
+
OscEnv.Prod.ordinal -> OscEnv.Prod
|
|
34
|
+
else -> OscEnv.Sandbox // Or any sensible default
|
|
35
|
+
}
|
|
36
|
+
oscApiInt = OscApi.getInstance(app, clientKey, env)
|
|
25
37
|
promise.resolve(null)
|
|
26
38
|
} catch (e: Exception) {
|
|
27
39
|
promise.reject("INIT_ERROR", e)
|
|
28
40
|
}
|
|
29
41
|
}
|
|
42
|
+
|
|
30
43
|
|
|
31
44
|
// New method to get transaction ID
|
|
32
45
|
@ReactMethod
|
|
@@ -43,4 +56,19 @@ class OscilarModuleModule(reactContext: ReactApplicationContext) :
|
|
|
43
56
|
companion object {
|
|
44
57
|
const val NAME = "OscilarModule"
|
|
45
58
|
}
|
|
59
|
+
|
|
60
|
+
@ReactMethod
|
|
61
|
+
fun getIntegrationHealthInfo(promise: Promise) {
|
|
62
|
+
try {
|
|
63
|
+
val healthInfo = oscApiInt.getIntegrationHealthInfo(reactApplicationContext)
|
|
64
|
+
val writableMap = Arguments.createMap()
|
|
65
|
+
for ((key, value) in healthInfo) {
|
|
66
|
+
writableMap.putString(key, value)
|
|
67
|
+
}
|
|
68
|
+
Log.d("OscilarModule", "Integration Health Info: $healthInfo")
|
|
69
|
+
promise.resolve(writableMap)
|
|
70
|
+
} catch (e: Exception) {
|
|
71
|
+
promise.reject("ERROR_GETTING_HEALTH_INFO", e)
|
|
72
|
+
}
|
|
73
|
+
}
|
|
46
74
|
}
|
package/ios/OscilarModule.mm
CHANGED
|
@@ -12,7 +12,7 @@ RCT_EXTERN_METHOD(startWithClientKeyAndServerURL:(NSString*)clientKey
|
|
|
12
12
|
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
13
13
|
|
|
14
14
|
RCT_EXTERN_METHOD(startWithClientKeyAndEnvironment:(NSString*)clientKey
|
|
15
|
-
|
|
15
|
+
environment:(int)environment
|
|
16
16
|
withResolver:(RCTPromiseResolveBlock)resolve
|
|
17
17
|
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
18
18
|
|
package/ios/OscilarModule.swift
CHANGED
|
@@ -3,9 +3,10 @@ import OscilarSDK
|
|
|
3
3
|
@objc(OscilarModule)
|
|
4
4
|
class OscilarModule: NSObject {
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
case
|
|
8
|
-
case
|
|
6
|
+
enum OSCEnvironment: Int {
|
|
7
|
+
case dev = 0
|
|
8
|
+
case sandbox = 1
|
|
9
|
+
case production = 2
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
@objc(startWithClientKey:withResolver:withRejecter:)
|
|
@@ -47,16 +48,17 @@ class OscilarModule: NSObject {
|
|
|
47
48
|
@objc(startWithClientKeyAndEnvironment:environment:withResolver:withRejecter:)
|
|
48
49
|
func start(
|
|
49
50
|
clientKey: String,
|
|
50
|
-
environment:
|
|
51
|
-
resolve: @escaping RCTPromiseResolveBlock,
|
|
51
|
+
environment: Int,
|
|
52
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
52
53
|
reject: @escaping RCTPromiseRejectBlock
|
|
53
|
-
|
|
54
|
+
) -> Void {
|
|
54
55
|
Task {
|
|
55
56
|
do {
|
|
56
|
-
let sdkEnv: Oscilar.Environment
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
let sdkEnv: Oscilar.Environment = switch OSCEnvironment(rawValue: environment) {
|
|
58
|
+
case .some(.production):
|
|
59
|
+
.production
|
|
60
|
+
default:
|
|
61
|
+
.sandbox
|
|
60
62
|
}
|
|
61
63
|
try await Oscilar.shared.start(
|
|
62
64
|
clientKey: clientKey,
|
package/lib/commonjs/index.js
CHANGED
|
@@ -8,6 +8,7 @@ exports.generateTransactionID = generateTransactionID;
|
|
|
8
8
|
exports.generateTransactionIDWithFlowType = generateTransactionIDWithFlowType;
|
|
9
9
|
exports.generateTransactionIDWithFlowTypeAndUserInfo = generateTransactionIDWithFlowTypeAndUserInfo;
|
|
10
10
|
exports.generateTransactionIDWithUserInfo = generateTransactionIDWithUserInfo;
|
|
11
|
+
exports.getIntegrationHealthInfo = getIntegrationHealthInfo;
|
|
11
12
|
exports.initOscilar = initOscilar;
|
|
12
13
|
exports.startWithClientKey = startWithClientKey;
|
|
13
14
|
exports.startWithClientKeyAndEnvironment = startWithClientKeyAndEnvironment;
|
|
@@ -23,15 +24,16 @@ const OscilarModule = _reactNative.NativeModules.OscilarModule ? _reactNative.Na
|
|
|
23
24
|
}
|
|
24
25
|
});
|
|
25
26
|
let OSCEnvironment = exports.OSCEnvironment = /*#__PURE__*/function (OSCEnvironment) {
|
|
26
|
-
OSCEnvironment[OSCEnvironment["
|
|
27
|
-
OSCEnvironment[OSCEnvironment["
|
|
27
|
+
OSCEnvironment[OSCEnvironment["DEV"] = 0] = "DEV";
|
|
28
|
+
OSCEnvironment[OSCEnvironment["SANDBOX"] = 1] = "SANDBOX";
|
|
29
|
+
OSCEnvironment[OSCEnvironment["PRODUCTION"] = 2] = "PRODUCTION";
|
|
28
30
|
return OSCEnvironment;
|
|
29
31
|
}({});
|
|
30
|
-
function initOscilar(clientKey) {
|
|
32
|
+
function initOscilar(clientKey, environment = OSCEnvironment.SANDBOX) {
|
|
31
33
|
if (_reactNative.Platform.OS === 'android') {
|
|
32
|
-
return OscilarModule.initOscilar(clientKey);
|
|
34
|
+
return OscilarModule.initOscilar(clientKey, environment);
|
|
33
35
|
} else {
|
|
34
|
-
return OscilarModule.
|
|
36
|
+
return OscilarModule.startWithClientKeyAndEnvironment(clientKey, environment);
|
|
35
37
|
}
|
|
36
38
|
}
|
|
37
39
|
function startWithClientKey(clientKey) {
|
|
@@ -55,4 +57,7 @@ function generateTransactionIDWithUserInfo(usernameHash, userEmailHash, custom)
|
|
|
55
57
|
function generateTransactionIDWithFlowTypeAndUserInfo(flowType, usernameHash, userEmailHash, custom) {
|
|
56
58
|
return OscilarModule.generateTransactionIDWithFlowTypeAndUserInfo(flowType, usernameHash, userEmailHash, custom);
|
|
57
59
|
}
|
|
60
|
+
function getIntegrationHealthInfo() {
|
|
61
|
+
return OscilarModule.getIntegrationHealthInfo();
|
|
62
|
+
}
|
|
58
63
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","LINKING_ERROR","Platform","select","ios","default","OscilarModule","NativeModules","Proxy","get","Error","OSCEnvironment","exports","initOscilar","clientKey","
|
|
1
|
+
{"version":3,"names":["_reactNative","require","LINKING_ERROR","Platform","select","ios","default","OscilarModule","NativeModules","Proxy","get","Error","OSCEnvironment","exports","initOscilar","clientKey","environment","SANDBOX","OS","startWithClientKeyAndEnvironment","startWithClientKey","startWithClientKeyAndServerURL","serverURL","generateTransactionID","generateTransactionIDWithFlowType","flowType","generateTransactionIDWithUserInfo","usernameHash","userEmailHash","custom","generateTransactionIDWithFlowTypeAndUserInfo","getIntegrationHealthInfo"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;;;;;;AAAA,IAAAA,Y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;EACvD,OAAOhB,aAAa,CAACgB,qBAAqB,CAAC,CAAC;AAC9C;AAEO,SAASC,iCAAiCA,CAC/CC,QAAgB,EACC;EACjB,OAAOlB,aAAa,CAACiB,iCAAiC,CAACC,QAAQ,CAAC;AAClE;AAEO,SAASC,iCAAiCA,CAC/CC,YAAoB,EACpBC,aAAqB,EACrBC,MAAc,EACG;EACjB,OAAOtB,aAAa,CAACmB,iCAAiC,CACpDC,YAAY,EACZC,aAAa,EACbC,MACF,CAAC;AACH;AAEO,SAASC,4CAA4CA,CAC1DL,QAAgB,EAChBE,YAAoB,EACpBC,aAAqB,EACrBC,MAAc,EACG;EACjB,OAAOtB,aAAa,CAACuB,4CAA4C,CAC/DL,QAAQ,EACRE,YAAY,EACZC,aAAa,EACbC,MACF,CAAC;AACH;AAEO,SAASE,wBAAwBA,CAAA,EAAuC;EAC7E,OAAOxB,aAAa,CAACwB,wBAAwB,CAAC,CAAC;AACjD","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
|
@@ -11,15 +11,16 @@ const OscilarModule = NativeModules.OscilarModule ? NativeModules.OscilarModule
|
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
13
|
export let OSCEnvironment = /*#__PURE__*/function (OSCEnvironment) {
|
|
14
|
-
OSCEnvironment[OSCEnvironment["
|
|
15
|
-
OSCEnvironment[OSCEnvironment["
|
|
14
|
+
OSCEnvironment[OSCEnvironment["DEV"] = 0] = "DEV";
|
|
15
|
+
OSCEnvironment[OSCEnvironment["SANDBOX"] = 1] = "SANDBOX";
|
|
16
|
+
OSCEnvironment[OSCEnvironment["PRODUCTION"] = 2] = "PRODUCTION";
|
|
16
17
|
return OSCEnvironment;
|
|
17
18
|
}({});
|
|
18
|
-
export function initOscilar(clientKey) {
|
|
19
|
+
export function initOscilar(clientKey, environment = OSCEnvironment.SANDBOX) {
|
|
19
20
|
if (Platform.OS === 'android') {
|
|
20
|
-
return OscilarModule.initOscilar(clientKey);
|
|
21
|
+
return OscilarModule.initOscilar(clientKey, environment);
|
|
21
22
|
} else {
|
|
22
|
-
return OscilarModule.
|
|
23
|
+
return OscilarModule.startWithClientKeyAndEnvironment(clientKey, environment);
|
|
23
24
|
}
|
|
24
25
|
}
|
|
25
26
|
export function startWithClientKey(clientKey) {
|
|
@@ -43,4 +44,7 @@ export function generateTransactionIDWithUserInfo(usernameHash, userEmailHash, c
|
|
|
43
44
|
export function generateTransactionIDWithFlowTypeAndUserInfo(flowType, usernameHash, userEmailHash, custom) {
|
|
44
45
|
return OscilarModule.generateTransactionIDWithFlowTypeAndUserInfo(flowType, usernameHash, userEmailHash, custom);
|
|
45
46
|
}
|
|
47
|
+
export function getIntegrationHealthInfo() {
|
|
48
|
+
return OscilarModule.getIntegrationHealthInfo();
|
|
49
|
+
}
|
|
46
50
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeModules","Platform","LINKING_ERROR","select","ios","default","OscilarModule","Proxy","get","Error","OSCEnvironment","initOscilar","clientKey","
|
|
1
|
+
{"version":3,"names":["NativeModules","Platform","LINKING_ERROR","select","ios","default","OscilarModule","Proxy","get","Error","OSCEnvironment","initOscilar","clientKey","environment","SANDBOX","OS","startWithClientKeyAndEnvironment","startWithClientKey","startWithClientKeyAndServerURL","serverURL","generateTransactionID","generateTransactionIDWithFlowType","flowType","generateTransactionIDWithUserInfo","usernameHash","userEmailHash","custom","generateTransactionIDWithFlowTypeAndUserInfo","getIntegrationHealthInfo"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AAEtD,MAAMC,aAAa,GACjB,+FAA+F,GAC/FD,QAAQ,CAACE,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;AAEjC,MAAMC,aAAa,GAAGN,aAAa,CAACM,aAAa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C,MAAc,EACG;EACjB,OAAOpB,aAAa,CAACiB,iCAAiC,CACpDC,YAAY,EACZC,aAAa,EACbC,MACF,CAAC;AACH;AAEA,OAAO,SAASC,4CAA4CA,CAC1DL,QAAgB,EAChBE,YAAoB,EACpBC,aAAqB,EACrBC,MAAc,EACG;EACjB,OAAOpB,aAAa,CAACqB,4CAA4C,CAC/DL,QAAQ,EACRE,YAAY,EACZC,aAAa,EACbC,MACF,CAAC;AACH;AAEA,OAAO,SAASE,wBAAwBA,CAAA,EAAuC;EAC7E,OAAOtB,aAAa,CAACsB,wBAAwB,CAAC,CAAC;AACjD","ignoreList":[]}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export declare enum OSCEnvironment {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
DEV = 0,
|
|
3
|
+
SANDBOX = 1,
|
|
4
|
+
PRODUCTION = 2
|
|
4
5
|
}
|
|
5
|
-
export declare function initOscilar(clientKey: string): Promise<void>;
|
|
6
|
+
export declare function initOscilar(clientKey: string, environment?: OSCEnvironment): Promise<void>;
|
|
6
7
|
export declare function startWithClientKey(clientKey: string): Promise<void>;
|
|
7
8
|
export declare function startWithClientKeyAndServerURL(clientKey: string, serverURL: string): Promise<void>;
|
|
8
9
|
export declare function startWithClientKeyAndEnvironment(clientKey: string, environment: OSCEnvironment): Promise<void>;
|
|
@@ -10,4 +11,7 @@ export declare function generateTransactionID(): Promise<string>;
|
|
|
10
11
|
export declare function generateTransactionIDWithFlowType(flowType: string): Promise<string>;
|
|
11
12
|
export declare function generateTransactionIDWithUserInfo(usernameHash: string, userEmailHash: string, custom: object): Promise<string>;
|
|
12
13
|
export declare function generateTransactionIDWithFlowTypeAndUserInfo(flowType: string, usernameHash: string, userEmailHash: string, custom: object): Promise<string>;
|
|
14
|
+
export declare function getIntegrationHealthInfo(): Promise<{
|
|
15
|
+
[key: string]: string;
|
|
16
|
+
}>;
|
|
13
17
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AAmBA,oBAAY,cAAc;IACxB,OAAO,IAAI;IACX,UAAU,IAAI;CACf;AAED,wBAAgB,WAAW,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AAmBA,oBAAY,cAAc;IACxB,GAAG,IAAI;IACP,OAAO,IAAI;IACX,UAAU,IAAI;CACf;AAED,wBAAgB,WAAW,CACzB,SAAS,EAAE,MAAM,EACjB,WAAW,GAAE,cAAuC,GACnD,OAAO,CAAC,IAAI,CAAC,CASf;AAED,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEnE;AAED,wBAAgB,8BAA8B,CAC5C,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,IAAI,CAAC,CAEf;AAED,wBAAgB,gCAAgC,CAC9C,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,cAAc,GAC1B,OAAO,CAAC,IAAI,CAAC,CAEf;AAED,wBAAgB,qBAAqB,IAAI,OAAO,CAAC,MAAM,CAAC,CAEvD;AAED,wBAAgB,iCAAiC,CAC/C,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,CAAC,CAEjB;AAED,wBAAgB,iCAAiC,CAC/C,YAAY,EAAE,MAAM,EACpB,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,CAAC,CAMjB;AAED,wBAAgB,4CAA4C,CAC1D,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,EACpB,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,CAAC,CAOjB;AAED,wBAAgB,wBAAwB,IAAI,OAAO,CAAC;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,CAAC,CAE7E"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export declare enum OSCEnvironment {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
DEV = 0,
|
|
3
|
+
SANDBOX = 1,
|
|
4
|
+
PRODUCTION = 2
|
|
4
5
|
}
|
|
5
|
-
export declare function initOscilar(clientKey: string): Promise<void>;
|
|
6
|
+
export declare function initOscilar(clientKey: string, environment?: OSCEnvironment): Promise<void>;
|
|
6
7
|
export declare function startWithClientKey(clientKey: string): Promise<void>;
|
|
7
8
|
export declare function startWithClientKeyAndServerURL(clientKey: string, serverURL: string): Promise<void>;
|
|
8
9
|
export declare function startWithClientKeyAndEnvironment(clientKey: string, environment: OSCEnvironment): Promise<void>;
|
|
@@ -10,4 +11,7 @@ export declare function generateTransactionID(): Promise<string>;
|
|
|
10
11
|
export declare function generateTransactionIDWithFlowType(flowType: string): Promise<string>;
|
|
11
12
|
export declare function generateTransactionIDWithUserInfo(usernameHash: string, userEmailHash: string, custom: object): Promise<string>;
|
|
12
13
|
export declare function generateTransactionIDWithFlowTypeAndUserInfo(flowType: string, usernameHash: string, userEmailHash: string, custom: object): Promise<string>;
|
|
14
|
+
export declare function getIntegrationHealthInfo(): Promise<{
|
|
15
|
+
[key: string]: string;
|
|
16
|
+
}>;
|
|
13
17
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AAmBA,oBAAY,cAAc;IACxB,OAAO,IAAI;IACX,UAAU,IAAI;CACf;AAED,wBAAgB,WAAW,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AAmBA,oBAAY,cAAc;IACxB,GAAG,IAAI;IACP,OAAO,IAAI;IACX,UAAU,IAAI;CACf;AAED,wBAAgB,WAAW,CACzB,SAAS,EAAE,MAAM,EACjB,WAAW,GAAE,cAAuC,GACnD,OAAO,CAAC,IAAI,CAAC,CASf;AAED,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEnE;AAED,wBAAgB,8BAA8B,CAC5C,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,IAAI,CAAC,CAEf;AAED,wBAAgB,gCAAgC,CAC9C,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,cAAc,GAC1B,OAAO,CAAC,IAAI,CAAC,CAEf;AAED,wBAAgB,qBAAqB,IAAI,OAAO,CAAC,MAAM,CAAC,CAEvD;AAED,wBAAgB,iCAAiC,CAC/C,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,CAAC,CAEjB;AAED,wBAAgB,iCAAiC,CAC/C,YAAY,EAAE,MAAM,EACpB,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,CAAC,CAMjB;AAED,wBAAgB,4CAA4C,CAC1D,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,EACpB,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,CAAC,CAOjB;AAED,wBAAgB,wBAAwB,IAAI,OAAO,CAAC;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,CAAC,CAE7E"}
|
package/package.json
CHANGED
package/src/index.tsx
CHANGED
|
@@ -18,15 +18,22 @@ const OscilarModule = NativeModules.OscilarModule
|
|
|
18
18
|
);
|
|
19
19
|
|
|
20
20
|
export enum OSCEnvironment {
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
DEV = 0,
|
|
22
|
+
SANDBOX = 1,
|
|
23
|
+
PRODUCTION = 2,
|
|
23
24
|
}
|
|
24
25
|
|
|
25
|
-
export function initOscilar(
|
|
26
|
+
export function initOscilar(
|
|
27
|
+
clientKey: string,
|
|
28
|
+
environment: OSCEnvironment = OSCEnvironment.SANDBOX
|
|
29
|
+
): Promise<void> {
|
|
26
30
|
if (Platform.OS === 'android') {
|
|
27
|
-
return OscilarModule.initOscilar(clientKey);
|
|
31
|
+
return OscilarModule.initOscilar(clientKey, environment);
|
|
28
32
|
} else {
|
|
29
|
-
return OscilarModule.
|
|
33
|
+
return OscilarModule.startWithClientKeyAndEnvironment(
|
|
34
|
+
clientKey,
|
|
35
|
+
environment
|
|
36
|
+
);
|
|
30
37
|
}
|
|
31
38
|
}
|
|
32
39
|
|
|
@@ -83,3 +90,7 @@ export function generateTransactionIDWithFlowTypeAndUserInfo(
|
|
|
83
90
|
custom
|
|
84
91
|
);
|
|
85
92
|
}
|
|
93
|
+
|
|
94
|
+
export function getIntegrationHealthInfo(): Promise<{ [key: string]: string }> {
|
|
95
|
+
return OscilarModule.getIntegrationHealthInfo();
|
|
96
|
+
}
|