rn-linkrunner 0.5.1 → 0.5.2
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/README.md +50 -5
- package/lib/commonjs/index.js +1 -1
- package/lib/module/index.js +1 -1
- package/package.json +1 -1
- package/src/index.ts +1 -1
package/README.md
CHANGED
|
@@ -39,19 +39,43 @@ import linkrunner from 'rn-linkrunner';
|
|
|
39
39
|
|
|
40
40
|
// Inside your react component
|
|
41
41
|
useEffect(() => {
|
|
42
|
-
|
|
42
|
+
init();
|
|
43
43
|
}, []);
|
|
44
|
+
|
|
45
|
+
const init = async () => {
|
|
46
|
+
const initData = await linkrunner.init('PROJECT_TOKEN');
|
|
47
|
+
};
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
#### Response type for `linkrunner.init`
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
{
|
|
54
|
+
ip_location_data: {
|
|
55
|
+
ip: string;
|
|
56
|
+
city: string;
|
|
57
|
+
countryLong: string;
|
|
58
|
+
countryShort: string;
|
|
59
|
+
latitude: number;
|
|
60
|
+
longitude: number;
|
|
61
|
+
region: string;
|
|
62
|
+
timeZone: string;
|
|
63
|
+
zipCode: string;
|
|
64
|
+
};
|
|
65
|
+
deeplink: string;
|
|
66
|
+
root_domain: boolean;
|
|
67
|
+
}
|
|
44
68
|
```
|
|
45
69
|
|
|
46
70
|
### Trigger
|
|
47
71
|
|
|
48
|
-
Call this function once your onboarding is completed and the navigation stack can be accessed by a
|
|
72
|
+
Call this function once your onboarding is completed and the navigation stack can be accessed by a deeplink:
|
|
49
73
|
|
|
50
74
|
```jsx
|
|
51
75
|
import linkrunner from 'rn-linkrunner';
|
|
52
76
|
|
|
53
|
-
const onTrigger = () => {
|
|
54
|
-
linkrunner.trigger({
|
|
77
|
+
const onTrigger = async () => {
|
|
78
|
+
const trigger = await linkrunner.trigger({
|
|
55
79
|
user_data: {
|
|
56
80
|
id: '1',
|
|
57
81
|
name: 'John Doe', // optional
|
|
@@ -63,7 +87,28 @@ const onTrigger = () => {
|
|
|
63
87
|
};
|
|
64
88
|
```
|
|
65
89
|
|
|
66
|
-
|
|
90
|
+
#### Response type for `linkrunner.trigger`
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
{
|
|
94
|
+
ip_location_data: {
|
|
95
|
+
ip: string;
|
|
96
|
+
city: string;
|
|
97
|
+
countryLong: string;
|
|
98
|
+
countryShort: string;
|
|
99
|
+
latitude: number;
|
|
100
|
+
longitude: number;
|
|
101
|
+
region: string;
|
|
102
|
+
timeZone: string;
|
|
103
|
+
zipCode: string;
|
|
104
|
+
};
|
|
105
|
+
deeplink: string;
|
|
106
|
+
root_domain: boolean;
|
|
107
|
+
trigger: boolean // Deeplink won't be triggered if false
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Note: Value of `trigger` will be only true for the first time the function is triggered by the user in order to prevent unnecessary redirects
|
|
67
112
|
|
|
68
113
|
### Facing issues during integration?
|
|
69
114
|
|
package/lib/commonjs/index.js
CHANGED
|
@@ -8,7 +8,7 @@ var _reactNative = require("react-native");
|
|
|
8
8
|
var _reactNativeDeviceInfo = _interopRequireWildcard(require("react-native-device-info"));
|
|
9
9
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
10
10
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
11
|
-
const package_version = '0.5.
|
|
11
|
+
const package_version = '0.5.2';
|
|
12
12
|
const app_version = _reactNativeDeviceInfo.default.getVersion();
|
|
13
13
|
const device_data = {
|
|
14
14
|
android_id: _reactNativeDeviceInfo.default.getAndroidId(),
|
package/lib/module/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Linking } from 'react-native';
|
|
2
2
|
import DeviceInfo, { getManufacturer, getSystemVersion } from 'react-native-device-info';
|
|
3
|
-
const package_version = '0.5.
|
|
3
|
+
const package_version = '0.5.2';
|
|
4
4
|
const app_version = DeviceInfo.getVersion();
|
|
5
5
|
const device_data = {
|
|
6
6
|
android_id: DeviceInfo.getAndroidId(),
|
package/package.json
CHANGED