@tryvital/vital-core-react-native 0.2.0 → 0.2.3
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/lib/index.js +23 -0
- package/package.json +3 -3
- package/vital-core-react-native.podspec +1 -1
package/lib/index.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { NativeModules, Platform } from 'react-native';
|
|
2
|
+
const LINKING_ERROR = `The package 'vital-core-react-native' doesn't seem to be linked. Make sure: \n\n` +
|
|
3
|
+
Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
|
|
4
|
+
'- You rebuilt the app after installing the package\n' +
|
|
5
|
+
'- You are not using Expo Go\n';
|
|
6
|
+
const VitalCoreReactNative = NativeModules.VitalCoreReactNative
|
|
7
|
+
? NativeModules.VitalCoreReactNative
|
|
8
|
+
: new Proxy({}, {
|
|
9
|
+
get() {
|
|
10
|
+
throw new Error(LINKING_ERROR);
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
export class VitalCore {
|
|
14
|
+
static setUserId(userId) {
|
|
15
|
+
return VitalCoreReactNative.setUserId(userId);
|
|
16
|
+
}
|
|
17
|
+
static configure(apiKey, environment, region, enableLogs) {
|
|
18
|
+
return VitalCoreReactNative.configure(apiKey, environment, region, enableLogs);
|
|
19
|
+
}
|
|
20
|
+
static cleanUp() {
|
|
21
|
+
return VitalCoreReactNative.cleanUp();
|
|
22
|
+
}
|
|
23
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tryvital/vital-core-react-native",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "test",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
"scripts": {
|
|
28
28
|
"test": "jest",
|
|
29
29
|
"typescript": "tsc --declaration",
|
|
30
|
-
"postinstall": "npm run typescript",
|
|
31
30
|
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
32
31
|
"release": "release-it",
|
|
33
32
|
"example": "yarn --cwd example",
|
|
34
33
|
"bootstrap": "yarn example && yarn install && yarn example pods",
|
|
35
|
-
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build"
|
|
34
|
+
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build",
|
|
35
|
+
"postinstall": "npm run typescript"
|
|
36
36
|
},
|
|
37
37
|
"keywords": [
|
|
38
38
|
"react-native",
|
|
@@ -17,7 +17,7 @@ Pod::Spec.new do |s|
|
|
|
17
17
|
s.source_files = "ios/**/*.{h,m,mm,swift}"
|
|
18
18
|
|
|
19
19
|
s.dependency "React-Core"
|
|
20
|
-
s.dependency "VitalCore", "~> 0.7.
|
|
20
|
+
s.dependency "VitalCore", "~> 0.7.11"
|
|
21
21
|
|
|
22
22
|
# Don't install the dependencies when we run `pod install` in the old architecture.
|
|
23
23
|
if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
|