@posted-sdk/react-native 1.0.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/README.md +149 -0
- package/lib/module/index.js +4 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/reportInstall.js +50 -0
- package/lib/module/reportInstall.js.map +1 -0
- package/lib/module/types.js +2 -0
- package/lib/module/types.js.map +1 -0
- package/lib/module/utils/deviceId.js +46 -0
- package/lib/module/utils/deviceId.js.map +1 -0
- package/lib/module/utils/deviceInfo.js +64 -0
- package/lib/module/utils/deviceInfo.js.map +1 -0
- package/lib/module/utils/fingerprint.js +44 -0
- package/lib/module/utils/fingerprint.js.map +1 -0
- package/lib/module/utils/installReferrer.js +19 -0
- package/lib/module/utils/installReferrer.js.map +1 -0
- package/lib/module/utils/optionalModules.js +48 -0
- package/lib/module/utils/optionalModules.js.map +1 -0
- package/lib/module/utils/storage.js +28 -0
- package/lib/module/utils/storage.js.map +1 -0
- package/lib/module/version.js +5 -0
- package/lib/module/version.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/index.d.ts +3 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/reportInstall.d.ts +3 -0
- package/lib/typescript/src/reportInstall.d.ts.map +1 -0
- package/lib/typescript/src/types.d.ts +11 -0
- package/lib/typescript/src/types.d.ts.map +1 -0
- package/lib/typescript/src/utils/deviceId.d.ts +3 -0
- package/lib/typescript/src/utils/deviceId.d.ts.map +1 -0
- package/lib/typescript/src/utils/deviceInfo.d.ts +9 -0
- package/lib/typescript/src/utils/deviceInfo.d.ts.map +1 -0
- package/lib/typescript/src/utils/fingerprint.d.ts +17 -0
- package/lib/typescript/src/utils/fingerprint.d.ts.map +1 -0
- package/lib/typescript/src/utils/installReferrer.d.ts +6 -0
- package/lib/typescript/src/utils/installReferrer.d.ts.map +1 -0
- package/lib/typescript/src/utils/optionalModules.d.ts +41 -0
- package/lib/typescript/src/utils/optionalModules.d.ts.map +1 -0
- package/lib/typescript/src/utils/storage.d.ts +7 -0
- package/lib/typescript/src/utils/storage.d.ts.map +1 -0
- package/lib/typescript/src/version.d.ts +3 -0
- package/lib/typescript/src/version.d.ts.map +1 -0
- package/package.json +153 -0
- package/src/index.ts +3 -0
- package/src/reportInstall.ts +53 -0
- package/src/types.ts +11 -0
- package/src/utils/deviceId.ts +53 -0
- package/src/utils/deviceInfo.ts +98 -0
- package/src/utils/fingerprint.ts +53 -0
- package/src/utils/installReferrer.ts +19 -0
- package/src/utils/optionalModules.ts +77 -0
- package/src/utils/storage.ts +35 -0
- package/src/version.ts +2 -0
package/README.md
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
# posted-sdk React Native
|
|
2
|
+
|
|
3
|
+
`@posted-sdk/react-native` reports app installs to posted-sdk. The backend matches each install to the ad click that led to it and reports it back to the ad network as a conversion.
|
|
4
|
+
|
|
5
|
+
The SDK has one function, `reportInstall()`. Call it on every app launch. It sends the report once per install.
|
|
6
|
+
|
|
7
|
+
- [Requirements](#requirements)
|
|
8
|
+
- [1. Install](#1-install)
|
|
9
|
+
- [2. Report the install](#2-report-the-install)
|
|
10
|
+
- [3. Verify the integration](#3-verify-the-integration)
|
|
11
|
+
- [Configuration](#configuration)
|
|
12
|
+
- [Data collected](#data-collected)
|
|
13
|
+
- [Troubleshooting](#troubleshooting)
|
|
14
|
+
- [Support](#support)
|
|
15
|
+
|
|
16
|
+
## Requirements
|
|
17
|
+
|
|
18
|
+
- React Native `>=0.72`
|
|
19
|
+
- Expo and bare React Native projects are both supported. Bare projects don't need Expo Modules.
|
|
20
|
+
|
|
21
|
+
## 1. Install
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
npm install @posted-sdk/react-native
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
The SDK reads device data through packages your app may already have. These are optional peer dependencies, so install the ones that match your project.
|
|
28
|
+
|
|
29
|
+
### Expo
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
npx expo install @react-native-async-storage/async-storage expo-device expo-application expo-constants expo-localization
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Then rebuild the native app (`npx expo run:ios` / `npx expo run:android`, or a new EAS build).
|
|
36
|
+
|
|
37
|
+
### Bare React Native
|
|
38
|
+
|
|
39
|
+
```sh
|
|
40
|
+
npm install @react-native-async-storage/async-storage react-native-device-info
|
|
41
|
+
cd ios && pod install
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Then rebuild the native app.
|
|
45
|
+
|
|
46
|
+
### What each package is for
|
|
47
|
+
|
|
48
|
+
| Package | Used for | If missing |
|
|
49
|
+
| ---------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- |
|
|
50
|
+
| `expo-device` **or** `react-native-device-info` | Device model, manufacturer, OS version | **Required.** The install isn't reported. |
|
|
51
|
+
| `@react-native-async-storage/async-storage` | Remembering that the install was reported | Required unless you pass your own `storage`. |
|
|
52
|
+
| `expo-application` **or** `react-native-device-info` | Android Play install referrer (exact click match) | Android installs are matched by fingerprint only. |
|
|
53
|
+
| `expo-constants` **or** `react-native-device-info` | User agent | User agent is sent as `unknown`. |
|
|
54
|
+
| `expo-localization` | Locale and timezone | Read from `Intl` instead. |
|
|
55
|
+
|
|
56
|
+
## 2. Report the install
|
|
57
|
+
|
|
58
|
+
Call `reportInstall()` once per launch, as early as possible: in your entry file, or in your root component.
|
|
59
|
+
|
|
60
|
+
```ts
|
|
61
|
+
// index.js (or app/_layout.tsx with Expo Router)
|
|
62
|
+
import { reportInstall } from "@posted-sdk/react-native";
|
|
63
|
+
|
|
64
|
+
reportInstall({
|
|
65
|
+
apiKey: "<YOUR_API_KEY>",
|
|
66
|
+
appID: "<YOUR_APP_ID>",
|
|
67
|
+
});
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
You don't need to `await` it. It never throws, and it doesn't block app startup.
|
|
71
|
+
|
|
72
|
+
## 3. Verify the integration
|
|
73
|
+
|
|
74
|
+
1. Run the app with a **fresh install**. Uninstalling clears the SDK's storage, so a reinstall reports again.
|
|
75
|
+
2. Watch the logs. Nothing is logged on success. On failure, you'll see a line starting with `🔗[Posted:INSTALL_ERROR]` (see [Troubleshooting](#troubleshooting)).
|
|
76
|
+
|
|
77
|
+
## Configuration
|
|
78
|
+
|
|
79
|
+
```ts
|
|
80
|
+
reportInstall(config: Config): Promise<void>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
| Field | Type | Required | Description |
|
|
84
|
+
| --------- | --------------- | -------- | -------------------------------------------------------------------------------------- |
|
|
85
|
+
| `apiKey` | `string` | Yes | Your API key from the dashboard. |
|
|
86
|
+
| `appID` | `string` | Yes | Your app ID from the dashboard. |
|
|
87
|
+
| `storage` | `PostedStorage` | No | Persistent key-value storage. Defaults to `@react-native-async-storage/async-storage`. |
|
|
88
|
+
|
|
89
|
+
### Custom storage
|
|
90
|
+
|
|
91
|
+
Pass any storage that persists across launches. Both methods may be sync or async.
|
|
92
|
+
|
|
93
|
+
```ts
|
|
94
|
+
interface PostedStorage {
|
|
95
|
+
getItem(key: string): Promise<string | null> | string | null;
|
|
96
|
+
setItem(key: string, value: string): Promise<void> | void;
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
For example, with [`react-native-mmkv`](https://github.com/mrousavy/react-native-mmkv):
|
|
101
|
+
|
|
102
|
+
```ts
|
|
103
|
+
import { MMKV } from "react-native-mmkv";
|
|
104
|
+
|
|
105
|
+
import { reportInstall } from "@posted-sdk/react-native";
|
|
106
|
+
|
|
107
|
+
const mmkv = new MMKV();
|
|
108
|
+
|
|
109
|
+
reportInstall({
|
|
110
|
+
apiKey,
|
|
111
|
+
appID,
|
|
112
|
+
storage: {
|
|
113
|
+
getItem: (key) => mmkv.getString(key) ?? null,
|
|
114
|
+
setItem: (key, value) => mmkv.set(key, value),
|
|
115
|
+
},
|
|
116
|
+
});
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
The SDK stores two keys, both prefixed with `Posted_`: the "install reported" flag and a device ID. If storage is cleared, the install is reported again.
|
|
120
|
+
|
|
121
|
+
## Data collected
|
|
122
|
+
|
|
123
|
+
The install report contains:
|
|
124
|
+
|
|
125
|
+
- Platform, device model, manufacturer and OS version
|
|
126
|
+
- Screen width, height and pixel ratio
|
|
127
|
+
- Locale(s) and timezone
|
|
128
|
+
- User agent
|
|
129
|
+
- Timestamp
|
|
130
|
+
- A random device ID generated by the SDK and kept in storage
|
|
131
|
+
- Android only: the `click_id` from the Play install referrer, when present
|
|
132
|
+
|
|
133
|
+
The SDK doesn't read the clipboard, the IDFA or the Android advertising ID, so there's no paste banner or App Tracking Transparency prompt.
|
|
134
|
+
|
|
135
|
+
## Troubleshooting
|
|
136
|
+
|
|
137
|
+
All SDK log lines start with `🔗[Posted`.
|
|
138
|
+
|
|
139
|
+
| Log message | Cause | Fix |
|
|
140
|
+
| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ---------------------------------------------------------------------- |
|
|
141
|
+
| `Failed to report install: 401` | Wrong API key, or the app ID doesn't match the key | Check both values in the dashboard. |
|
|
142
|
+
| `Failed to report install: <other status>` | Backend rejected or failed the request | Retried on the next launch. If it persists, [open an issue](#support). |
|
|
143
|
+
| `Error reporting install: ... No device info library found` | Neither `expo-device` nor `react-native-device-info` is installed | Install one of them and rebuild. |
|
|
144
|
+
| `Error reporting install: ... No storage implementation provided` | AsyncStorage isn't installed and no `storage` was passed | Install `@react-native-async-storage/async-storage` or pass `storage`. |
|
|
145
|
+
| `Error reporting install: TypeError: Network request failed` | Device is offline | Nothing to do. It's retried on the next launch. |
|
|
146
|
+
|
|
147
|
+
## Support
|
|
148
|
+
|
|
149
|
+
- Found a bug or have a question? [Open an issue](https://github.com/thepostedapp/posted-sdk-react-native/issues).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["reportInstall"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,SAASA,aAAa,QAAQ,oBAAiB","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { prepareDeviceIdForApi } from "./utils/deviceId.js";
|
|
4
|
+
import { getProbabilisticFingerprint } from "./utils/fingerprint.js";
|
|
5
|
+
import { getInstallReferrerClickId } from "./utils/installReferrer.js";
|
|
6
|
+
import { StorageKeys, resolveStorage } from "./utils/storage.js";
|
|
7
|
+
import { SDK_HEADER_VALUE } from "./version.js";
|
|
8
|
+
const INSTALL_API_URL = "https://attr.postedapp.com/api/install";
|
|
9
|
+
let inFlight = null;
|
|
10
|
+
export const reportInstall = config => {
|
|
11
|
+
inFlight ??= send(config).finally(() => {
|
|
12
|
+
inFlight = null;
|
|
13
|
+
});
|
|
14
|
+
return inFlight;
|
|
15
|
+
};
|
|
16
|
+
const send = async ({
|
|
17
|
+
apiKey,
|
|
18
|
+
appID,
|
|
19
|
+
storage: userStorage
|
|
20
|
+
}) => {
|
|
21
|
+
try {
|
|
22
|
+
const storage = resolveStorage(userStorage);
|
|
23
|
+
if (await storage.getItem(StorageKeys.INSTALL_REPORTED_FLAG_KEY)) return;
|
|
24
|
+
const [clickId, fingerprint, deviceId] = await Promise.all([getInstallReferrerClickId(), getProbabilisticFingerprint(), prepareDeviceIdForApi(storage)]);
|
|
25
|
+
const response = await fetch(INSTALL_API_URL, {
|
|
26
|
+
method: "POST",
|
|
27
|
+
headers: {
|
|
28
|
+
"Content-Type": "application/json",
|
|
29
|
+
Authorization: `Bearer ${apiKey}`,
|
|
30
|
+
"X-App-ID": appID,
|
|
31
|
+
"X-SDK": SDK_HEADER_VALUE
|
|
32
|
+
},
|
|
33
|
+
body: JSON.stringify({
|
|
34
|
+
...fingerprint,
|
|
35
|
+
device_id: deviceId,
|
|
36
|
+
...(clickId ? {
|
|
37
|
+
clickId
|
|
38
|
+
} : {})
|
|
39
|
+
})
|
|
40
|
+
});
|
|
41
|
+
if (!response.ok) {
|
|
42
|
+
console.warn(`🔗[Posted:INSTALL_ERROR] Failed to report install: ${response.status}`);
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
await storage.setItem(StorageKeys.INSTALL_REPORTED_FLAG_KEY, "true");
|
|
46
|
+
} catch (error) {
|
|
47
|
+
console.error("🔗[Posted:INSTALL_ERROR] Error reporting install:", error);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=reportInstall.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["prepareDeviceIdForApi","getProbabilisticFingerprint","getInstallReferrerClickId","StorageKeys","resolveStorage","SDK_HEADER_VALUE","INSTALL_API_URL","inFlight","reportInstall","config","send","finally","apiKey","appID","storage","userStorage","getItem","INSTALL_REPORTED_FLAG_KEY","clickId","fingerprint","deviceId","Promise","all","response","fetch","method","headers","Authorization","body","JSON","stringify","device_id","ok","console","warn","status","setItem","error"],"sourceRoot":"../../src","sources":["reportInstall.ts"],"mappings":";;AACA,SAASA,qBAAqB,QAAQ,qBAAkB;AACxD,SAASC,2BAA2B,QAAQ,wBAAqB;AACjE,SAASC,yBAAyB,QAAQ,4BAAyB;AACnE,SAASC,WAAW,EAAEC,cAAc,QAAQ,oBAAiB;AAC7D,SAASC,gBAAgB,QAAQ,cAAW;AAE5C,MAAMC,eAAe,GAAG,wCAAwC;AAEhE,IAAIC,QAA8B,GAAG,IAAI;AAEzC,OAAO,MAAMC,aAAa,GAAIC,MAAc,IAAoB;EAC9DF,QAAQ,KAAKG,IAAI,CAACD,MAAM,CAAC,CAACE,OAAO,CAAC,MAAM;IACtCJ,QAAQ,GAAG,IAAI;EACjB,CAAC,CAAC;EACF,OAAOA,QAAQ;AACjB,CAAC;AAED,MAAMG,IAAI,GAAG,MAAAA,CAAO;EAAEE,MAAM;EAAEC,KAAK;EAAEC,OAAO,EAAEC;AAAoB,CAAC,KAAK;EACtE,IAA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+
/* eslint-disable no-bitwise */
|
|
4
|
+
|
|
5
|
+
import { StorageKeys } from "./storage.js";
|
|
6
|
+
const generateUUID = () => {
|
|
7
|
+
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) {
|
|
8
|
+
const r = Math.random() * 16 | 0;
|
|
9
|
+
const v = c === "x" ? r : r & 0x3 | 0x8;
|
|
10
|
+
return v.toString(16);
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
const saveDeviceId = async (storage, id) => {
|
|
14
|
+
await storage.setItem(StorageKeys.DEVICE_ID_KEY, id);
|
|
15
|
+
};
|
|
16
|
+
const getDeviceId = async storage => {
|
|
17
|
+
return await storage.getItem(StorageKeys.DEVICE_ID_KEY);
|
|
18
|
+
};
|
|
19
|
+
let cachedDeviceId = null;
|
|
20
|
+
let pendingDeviceIdPromise = null;
|
|
21
|
+
export const prepareDeviceIdForApi = async storage => {
|
|
22
|
+
if (cachedDeviceId) {
|
|
23
|
+
return cachedDeviceId;
|
|
24
|
+
}
|
|
25
|
+
if (pendingDeviceIdPromise) {
|
|
26
|
+
return pendingDeviceIdPromise;
|
|
27
|
+
}
|
|
28
|
+
const getOrGenerate = async () => {
|
|
29
|
+
const existingId = await getDeviceId(storage);
|
|
30
|
+
if (existingId) {
|
|
31
|
+
cachedDeviceId = existingId;
|
|
32
|
+
return existingId;
|
|
33
|
+
}
|
|
34
|
+
const newId = generateUUID();
|
|
35
|
+
await saveDeviceId(storage, newId);
|
|
36
|
+
cachedDeviceId = newId;
|
|
37
|
+
return newId;
|
|
38
|
+
};
|
|
39
|
+
pendingDeviceIdPromise = getOrGenerate();
|
|
40
|
+
try {
|
|
41
|
+
return await pendingDeviceIdPromise;
|
|
42
|
+
} finally {
|
|
43
|
+
pendingDeviceIdPromise = null;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=deviceId.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["StorageKeys","generateUUID","replace","c","r","Math","random","v","toString","saveDeviceId","storage","id","setItem","DEVICE_ID_KEY","getDeviceId","getItem","cachedDeviceId","pendingDeviceIdPromise","prepareDeviceIdForApi","getOrGenerate","existingId","newId"],"sourceRoot":"../../../src","sources":["utils/deviceId.ts"],"mappings":";;AAAA;;AAEA,SAASA,WAAW,QAAQ,cAAW;AAEvC,MAAMC,YAAY,GAAGA,CAAA,KAAM;EACzB,OAAO,sCAAsC,CAACC,OAAO,CAAC,OAAO,EAAE,UAAUC,CAAC,EAAE;IAC1E,MAAMC,CAAC,GAAIC,IAAI,CAACC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAI,CAAC;IAClC,MAAMC,CAAC,GAAGJ,CAAC,KAAK,GAAG,GAAGC,CAAC,GAAIA,CAAC,GAAG,GAAG,GAAI,GAAG;IACzC,OAAOG,CAAC,CAACC,QAAQ,CAAC,EAAE,CAAC;EACvB,CAAC,CAAC;AACJ,CAAC;AAED,MAAMC,YAAY,GAAG,MAAAA,CAAOC,OAAsB,EAAEC,EAAU,KAAK;EACjE,MAAMD,OAAO,CAACE,OAAO,CAACZ,WAAW,CAACa,aAAa,EAAEF,EAAE,CAAC;AACtD,CAAC;AAED,MAAMG,WAAW,GAAG,MAAOJ,OAAsB,IAAK;EACpD,OAAO,MAAMA,OAAO,CAACK,OAAO,CAACf,WAAW,CAACa,aAAa,CAAC;AACzD,CAAC;AAED,IAAIG,cAA6B,GAAG,IAAI;AACxC,IAAIC,sBAA8C,GAAG,IAAI;AAEzD,OAAO,MAAMC,qBAAqB,GAAG,MAAOR,OAAsB,IAAK;EACrE,IAAIM,cAAc,EAAE;IAClB,OAAOA,cAAc;EACvB;EAEA,IAAIC,sBAAsB,EAAE;IAC1B,OAAOA,sBAAsB;EAC/B;EAEA,MAAME,aAAa,GAAG,MAAAA,CAAA,KAAY;IAChC,MAAMC,UAAU,GAAG,MAAMN,WAAW,CAACJ,OAAO,CAAC;IAC7C,IAAIU,UAAU,EAAE;MACdJ,cAAc,GAAGI,UAAU;MAC3B,OAAOA,UAAU;IACnB;IAEA,MAAMC,KAAK,GAAGpB,YAAY,CAAC,CAAC;IAC5B,MAAMQ,YAAY,CAACC,OAAO,EAAEW,KAAK,CAAC;IAClCL,cAAc,GAAGK,KAAK;IACtB,OAAOA,KAAK;EACd,CAAC;EAEDJ,sBAAsB,GAAGE,aAAa,CAAC,CAAC;EAExC,IAAI;IACF,OAAO,MAAMF,sBAAsB;EACrC,CAAC,SAAS;IACRA,sBAAsB,GAAG,IAAI;EAC/B;AACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { expoConstants, expoDevice, reactNativeDeviceInfo } from "./optionalModules.js";
|
|
4
|
+
const UNKNOWN = "unknown";
|
|
5
|
+
const normalizeValue = value => {
|
|
6
|
+
if (typeof value === "string" && value.trim().length > 0) {
|
|
7
|
+
return value;
|
|
8
|
+
}
|
|
9
|
+
if (typeof value === "number") {
|
|
10
|
+
return String(value);
|
|
11
|
+
}
|
|
12
|
+
return UNKNOWN;
|
|
13
|
+
};
|
|
14
|
+
const firstKnown = (...candidates) => {
|
|
15
|
+
for (const fn of candidates) {
|
|
16
|
+
const value = normalizeValue(fn());
|
|
17
|
+
if (value !== UNKNOWN) {
|
|
18
|
+
return value;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return UNKNOWN;
|
|
22
|
+
};
|
|
23
|
+
const firstKnownAsync = async (...candidates) => {
|
|
24
|
+
for (const fn of candidates) {
|
|
25
|
+
const value = normalizeValue(await fn());
|
|
26
|
+
if (value !== UNKNOWN) {
|
|
27
|
+
return value;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return UNKNOWN;
|
|
31
|
+
};
|
|
32
|
+
const getModel = () => {
|
|
33
|
+
return firstKnown(() => expoDevice?.modelName, () => reactNativeDeviceInfo?.getModel?.());
|
|
34
|
+
};
|
|
35
|
+
const getOsVersion = () => {
|
|
36
|
+
return firstKnown(() => expoDevice?.osVersion, () => reactNativeDeviceInfo?.getSystemVersion?.());
|
|
37
|
+
};
|
|
38
|
+
const getManufacturer = async () => {
|
|
39
|
+
return firstKnownAsync(() => expoDevice?.manufacturer, async () => {
|
|
40
|
+
try {
|
|
41
|
+
return await reactNativeDeviceInfo?.getManufacturer?.();
|
|
42
|
+
} catch {
|
|
43
|
+
return UNKNOWN;
|
|
44
|
+
}
|
|
45
|
+
}, () => reactNativeDeviceInfo?.getManufacturerSync?.());
|
|
46
|
+
};
|
|
47
|
+
const assertDeviceInfoLibraryAvailable = () => {
|
|
48
|
+
if (!expoDevice && !reactNativeDeviceInfo) {
|
|
49
|
+
throw new Error('[react-native-posted-sdk] No device info library found. Install either "expo-device" or "react-native-device-info".');
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
export const getDeviceInfo = async () => {
|
|
53
|
+
assertDeviceInfoLibraryAvailable();
|
|
54
|
+
const manufacturer = await getManufacturer();
|
|
55
|
+
return {
|
|
56
|
+
model: getModel(),
|
|
57
|
+
manufacturer,
|
|
58
|
+
osVersion: getOsVersion()
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
export const getUserAgent = async () => {
|
|
62
|
+
return firstKnownAsync(() => expoConstants?.getWebViewUserAgentAsync?.().catch(() => null), () => reactNativeDeviceInfo?.getUserAgent?.().catch(() => null));
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=deviceInfo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["expoConstants","expoDevice","reactNativeDeviceInfo","UNKNOWN","normalizeValue","value","trim","length","String","firstKnown","candidates","fn","firstKnownAsync","getModel","modelName","getOsVersion","osVersion","getSystemVersion","getManufacturer","manufacturer","getManufacturerSync","assertDeviceInfoLibraryAvailable","Error","getDeviceInfo","model","getUserAgent","getWebViewUserAgentAsync","catch"],"sourceRoot":"../../../src","sources":["utils/deviceInfo.ts"],"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AED,MAAMC,eAAe,GAAG,MAAAA,CAAA,KAA6B;EACnD,OAAON,eAAe,CACpB,MAAMX,UAAU,EAAEkB,YAAY,EAC9B,YAAY;IACV,IAAI;MACF,OAAO,MAAMjB,qBAAqB,EAAEgB,eAAe,GAAG,CAAC;IACzD,CAAC,CAAC,MAAM;MACN,OAAOf,OAAO;IAChB;EACF,CAAC,EACD,MAAMD,qBAAqB,EAAEkB,mBAAmB,GAAG,CACrD,CAAC;AACH,CAAC;AAED,MAAMC,gCAAgC,GAAGA,CAAA,KAAY;EACnD,IAAI,CAACpB,UAAU,IAAI,CAACC,qBAAqB,EAAE;IACzC,MAAM,IAAIoB,KAAK,CACb,qHACF,CAAC;EACH;AACF,CAAC;AAED,OAAO,MAAMC,aAAa,GAAG,MAAAA,CAAA,KAAiC;EAC5DF,gCAAgC,CAAC,CAAC;EAElC,MAAMF,YAAY,GAAG,MAAMD,eAAe,CAAC,CAAC;EAE5C,OAAO;IACLM,KAAK,EAAEX,QAAQ,CAAC,CAAC;IACjBM,YAAY;IACZH,SAAS,EAAED,YAAY,CAAC;EAC1B,CAAC;AACH,CAAC;AAED,OAAO,MAAMU,YAAY,GAAG,MAAAA,CAAA,KAA6B;EACvD,OAAOb,eAAe,CACpB,MAAMZ,aAAa,EAAE0B,wBAAwB,GAAG,CAAC,CAACC,KAAK,CAAC,MAAM,IAAI,CAAC,EACnE,MAAMzB,qBAAqB,EAAEuB,YAAY,GAAG,CAAC,CAACE,KAAK,CAAC,MAAM,IAAI,CAChE,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Dimensions, PixelRatio, Platform } from "react-native";
|
|
4
|
+
import { getDeviceInfo, getUserAgent } from "./deviceInfo.js";
|
|
5
|
+
import { expoLocalization } from "./optionalModules.js";
|
|
6
|
+
const intlOptions = () => {
|
|
7
|
+
try {
|
|
8
|
+
return Intl.DateTimeFormat().resolvedOptions();
|
|
9
|
+
} catch {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
// No clipboard read: it shows an iOS paste banner and install matching doesn't use it.
|
|
14
|
+
export const getProbabilisticFingerprint = async () => {
|
|
15
|
+
const {
|
|
16
|
+
width,
|
|
17
|
+
height
|
|
18
|
+
} = Dimensions.get("screen");
|
|
19
|
+
const localeLanguageTags = expoLocalization ? expoLocalization.getLocales().map(locale => ({
|
|
20
|
+
languageTag: locale.languageTag
|
|
21
|
+
})) : [{
|
|
22
|
+
languageTag: intlOptions()?.locale ?? "unknown"
|
|
23
|
+
}];
|
|
24
|
+
const {
|
|
25
|
+
model,
|
|
26
|
+
manufacturer,
|
|
27
|
+
osVersion: systemVersion
|
|
28
|
+
} = await getDeviceInfo();
|
|
29
|
+
const userAgent = await getUserAgent();
|
|
30
|
+
return {
|
|
31
|
+
platform: Platform.OS,
|
|
32
|
+
model,
|
|
33
|
+
manufacturer,
|
|
34
|
+
systemVersion,
|
|
35
|
+
screenWidth: width,
|
|
36
|
+
screenHeight: height,
|
|
37
|
+
scale: PixelRatio.get(),
|
|
38
|
+
locale: localeLanguageTags,
|
|
39
|
+
timezone: expoLocalization ? expoLocalization.getCalendars()[0]?.timeZone : intlOptions()?.timeZone,
|
|
40
|
+
userAgent,
|
|
41
|
+
timestamp: Date.now()
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=fingerprint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Dimensions","PixelRatio","Platform","getDeviceInfo","getUserAgent","expoLocalization","intlOptions","Intl","DateTimeFormat","resolvedOptions","getProbabilisticFingerprint","width","height","get","localeLanguageTags","getLocales","map","locale","languageTag","model","manufacturer","osVersion","systemVersion","userAgent","platform","OS","screenWidth","screenHeight","scale","timezone","getCalendars","timeZone","timestamp","Date","now"],"sourceRoot":"../../../src","sources":["utils/fingerprint.ts"],"mappings":";;AAAA,SAASA,UAA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B,QAAQ;IAC3BR,SAAS;IACTS,SAAS,EAAEC,IAAI,CAACC,GAAG,CAAC;EACtB,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { expoApplication, reactNativeDeviceInfo } from "./optionalModules.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The click id carried through the Play Store install referrer (`click_id=…`),
|
|
7
|
+
* or null — always null on iOS, where the App Store passes nothing through.
|
|
8
|
+
*/
|
|
9
|
+
export const getInstallReferrerClickId = async () => {
|
|
10
|
+
let referrer = null;
|
|
11
|
+
try {
|
|
12
|
+
referrer = (await (expoApplication?.getInstallReferrerAsync() ?? reactNativeDeviceInfo?.getInstallReferrer?.())) ?? null;
|
|
13
|
+
} catch {
|
|
14
|
+
referrer = null;
|
|
15
|
+
}
|
|
16
|
+
const match = decodeURIComponent(referrer ?? "").match(/(?:^|&)click_id=([^&]+)/);
|
|
17
|
+
return match?.[1] || null;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=installReferrer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["expoApplication","reactNativeDeviceInfo","getInstallReferrerClickId","referrer","getInstallReferrerAsync","getInstallReferrer","match","decodeURIComponent"],"sourceRoot":"../../../src","sources":["utils/installReferrer.ts"],"mappings":";;AAAA,SAASA,eAAe,EAAEC,qBAAqB,QAAQ,sBAAmB;;AAE1E;AACA;AACA;AACA;AACA,OAAO,MAAMC,yBAAyB,GAAG,MAAAA,CAAA,KAAoC;EAC3E,IAAIC,QAAuB,GAAG,IAAI;EAClC,IAAI;IACFA,QAAQ,GACN,CAAC,OAAOH,eAAe,EAAEI,uBAAuB,CAAC,CAAC,IAChDH,qBAAqB,EAAEI,kBAAkB,GAAG,CAAC,CAAC,KAAK,IAAI;EAC7D,CAAC,CAAC,MAAM;IACNF,QAAQ,GAAG,IAAI;EACjB;EAEA,MAAMG,KAAK,GAAGC,kBAAkB,CAACJ,QAAQ,IAAI,EAAE,CAAC,CAACG,KAAK,CAAC,yBAAyB,CAAC;EACjF,OAAOA,KAAK,GAAG,CAAC,CAAC,IAAI,IAAI;AAC3B,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Native packages the SDK can read device data from. All are optional peer
|
|
5
|
+
* dependencies: Expo apps use the Expo packages, bare React Native apps can use
|
|
6
|
+
* react-native-device-info instead. A missing package resolves to null.
|
|
7
|
+
*
|
|
8
|
+
* Metro needs a string literal in each require() at bundle time.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export const expoDevice = (() => {
|
|
12
|
+
try {
|
|
13
|
+
return require("expo-device");
|
|
14
|
+
} catch {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
})();
|
|
18
|
+
export const reactNativeDeviceInfo = (() => {
|
|
19
|
+
try {
|
|
20
|
+
const module = require("react-native-device-info");
|
|
21
|
+
return module.default ?? module;
|
|
22
|
+
} catch {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
})();
|
|
26
|
+
export const expoConstants = (() => {
|
|
27
|
+
try {
|
|
28
|
+
const module = require("expo-constants");
|
|
29
|
+
return module.default ?? module;
|
|
30
|
+
} catch {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
})();
|
|
34
|
+
export const expoLocalization = (() => {
|
|
35
|
+
try {
|
|
36
|
+
return require("expo-localization");
|
|
37
|
+
} catch {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
})();
|
|
41
|
+
export const expoApplication = (() => {
|
|
42
|
+
try {
|
|
43
|
+
return require("expo-application");
|
|
44
|
+
} catch {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
})();
|
|
48
|
+
//# sourceMappingURL=optionalModules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["expoDevice","require","reactNativeDeviceInfo","module","default","expoConstants","expoLocalization","expoApplication"],"sourceRoot":"../../../src","sources":["utils/optionalModules.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AA8BA,OAAO,MAAMA,UAAU,GAAG,CAAC,MAAM;EAC/B,IAAI;IACF,OAAOC,OAAO,CAAC,aAAa,CAAC;EAC/B,CAAC,CAAC,MAAM;IACN,OAAO,IAAI;EACb;AACF,CAAC,EAAE,CAAC;AAEJ,OAAO,MAAMC,qBAAqB,GAAG,CAAC,MAAM;EAC1C,IAAI;IACF,MAAMC,MAAM,GAAGF,OAAO,CAAC,0BAA0B,CAAC;IAClD,OAAQE,MAAM,CAACC,OAAO,IAAID,MAAM;EAClC,CAAC,CAAC,MAAM;IACN,OAAO,IAAI;EACb;AACF,CAAC,EAAE,CAAC;AAEJ,OAAO,MAAME,aAAa,GAAG,CAAC,MAAM;EAClC,IAAI;IACF,MAAMF,MAAM,GAAGF,OAAO,CAAC,gBAAgB,CAAC;IACxC,OAAQE,MAAM,CAACC,OAAO,IAAID,MAAM;EAClC,CAAC,CAAC,MAAM;IACN,OAAO,IAAI;EACb;AACF,CAAC,EAAE,CAAC;AAEJ,OAAO,MAAMG,gBAAgB,GAAG,CAAC,MAAM;EACrC,IAAI;IACF,OAAOL,OAAO,CAAC,mBAAmB,CAAC;EACrC,CAAC,CAAC,MAAM;IACN,OAAO,IAAI;EACb;AACF,CAAC,EAAE,CAAC;AAEJ,OAAO,MAAMM,eAAe,GAAG,CAAC,MAAM;EACpC,IAAI;IACF,OAAON,OAAO,CAAC,kBAAkB,CAAC;EACpC,CAAC,CAAC,MAAM;IACN,OAAO,IAAI;EACb;AACF,CAAC,EAAE,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// Key names are persisted on existing installs — never rename them.
|
|
4
|
+
const STORAGE_KEY_PREFIX = "Posted_";
|
|
5
|
+
const DEVICE_ID = `${STORAGE_KEY_PREFIX}deviceId`;
|
|
6
|
+
const INSTALL_REPORTED_FLAG = `${STORAGE_KEY_PREFIX}installReported`;
|
|
7
|
+
export let StorageKeys = /*#__PURE__*/function (StorageKeys) {
|
|
8
|
+
StorageKeys["DEVICE_ID_KEY"] = "Posted_deviceId";
|
|
9
|
+
StorageKeys["INSTALL_REPORTED_FLAG_KEY"] = "Posted_installReported";
|
|
10
|
+
return StorageKeys;
|
|
11
|
+
}({});
|
|
12
|
+
let DefaultAsyncStorage = null;
|
|
13
|
+
try {
|
|
14
|
+
const storageModule = require("@react-native-async-storage/async-storage");
|
|
15
|
+
DefaultAsyncStorage = storageModule.default || storageModule;
|
|
16
|
+
} catch (e) {
|
|
17
|
+
DefaultAsyncStorage = null;
|
|
18
|
+
}
|
|
19
|
+
export const resolveStorage = userStorage => {
|
|
20
|
+
if (userStorage) {
|
|
21
|
+
return userStorage;
|
|
22
|
+
}
|
|
23
|
+
if (DefaultAsyncStorage) {
|
|
24
|
+
return DefaultAsyncStorage;
|
|
25
|
+
}
|
|
26
|
+
throw new Error("🔗[Posted] No storage implementation provided.\n" + 'Please install "@react-native-async-storage/async-storage" OR pass a custom "storage" in the config');
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=storage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["STORAGE_KEY_PREFIX","DEVICE_ID","INSTALL_REPORTED_FLAG","StorageKeys","DefaultAsyncStorage","storageModule","require","default","e","resolveStorage","userStorage","Error"],"sourceRoot":"../../../src","sources":["utils/storage.ts"],"mappings":";;AAEA;AACA,MAAMA,kBAAkB,GAAG,SAAS;AACpC,MAAMC,SAAS,GAAG,GAAGD,kBAAkB,UAAU;AACjD,MAAME,qBAAqB,GAAG,GAAGF,kBAAkB,iBAAiB;AAEpE,WAAYG,WAAW,0BAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;AAKvB,IAAIC,mBAAyC,GAAG,IAAI;AAEpD,IAAI;EACF,MAAMC,aAAa,GAAGC,OAAO,CAAC,2CAA2C,CAAC;EAE1EF,mBAAmB,GAAGC,aAAa,CAACE,OAAO,IAAIF,aAAa;AAC9D,CAAC,CAAC,OAAOG,CAAC,EAAE;EACVJ,mBAAmB,GAAG,IAAI;AAC5B;AAEA,OAAO,MAAMK,cAAc,GAAIC,WAA2B,IAAoB;EAC5E,IAAIA,WAAW,EAAE;IACf,OAAOA,WAAW;EACpB;EAEA,IAAIN,mBAAmB,EAAE;IACvB,OAAOA,mBAAmB;EAC5B;EACA,MAAM,IAAIO,KAAK,CACb,kDAAkD,GAChD,qGACJ,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["version","SDK_HEADER_VALUE"],"sourceRoot":"../../src","sources":["version.ts"],"mappings":";;AAAA,OAAO,MAAMA,OAAO,GAAG,OAAO,CAAC,CAAC;AAChC,OAAO,MAAMC,gBAAgB,GAAG,gBAAgBD,OAAO,EAAE","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reportInstall.d.ts","sourceRoot":"","sources":["../../../src/reportInstall.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAWtC,eAAO,MAAM,aAAa,GAAI,QAAQ,MAAM,KAAG,OAAO,CAAC,IAAI,CAK1D,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type Config = {
|
|
2
|
+
appID: string;
|
|
3
|
+
apiKey: string;
|
|
4
|
+
/** Defaults to `@react-native-async-storage/async-storage` when installed. */
|
|
5
|
+
storage?: PostedStorage;
|
|
6
|
+
};
|
|
7
|
+
export interface PostedStorage {
|
|
8
|
+
getItem(key: string): Promise<string | null> | string | null;
|
|
9
|
+
setItem(key: string, value: string): Promise<void> | void;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,MAAM,GAAG;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,8EAA8E;IAC9E,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB,CAAC;AAEF,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,MAAM,GAAG,IAAI,CAAC;IAC7D,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CAC3D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deviceId.d.ts","sourceRoot":"","sources":["../../../../src/utils/deviceId.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAsB9C,eAAO,MAAM,qBAAqB,GAAU,SAAS,aAAa,oBA6BjE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type DeviceInfo = {
|
|
2
|
+
model: string;
|
|
3
|
+
manufacturer: string;
|
|
4
|
+
osVersion: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const getDeviceInfo: () => Promise<DeviceInfo>;
|
|
7
|
+
export declare const getUserAgent: () => Promise<string>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=deviceInfo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deviceInfo.d.ts","sourceRoot":"","sources":["../../../../src/utils/deviceInfo.ts"],"names":[],"mappings":"AAEA,KAAK,UAAU,GAAG;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AA0EF,eAAO,MAAM,aAAa,QAAa,OAAO,CAAC,UAAU,CAUxD,CAAC;AAEF,eAAO,MAAM,YAAY,QAAa,OAAO,CAAC,MAAM,CAKnD,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type ProbabilisticFingerprint = {
|
|
2
|
+
platform: string;
|
|
3
|
+
model: string;
|
|
4
|
+
manufacturer: string;
|
|
5
|
+
systemVersion: string;
|
|
6
|
+
screenWidth: number;
|
|
7
|
+
screenHeight: number;
|
|
8
|
+
scale: number;
|
|
9
|
+
locale: {
|
|
10
|
+
languageTag: string;
|
|
11
|
+
}[];
|
|
12
|
+
timezone: string | null | undefined;
|
|
13
|
+
userAgent: string;
|
|
14
|
+
timestamp: number;
|
|
15
|
+
};
|
|
16
|
+
export declare const getProbabilisticFingerprint: () => Promise<ProbabilisticFingerprint>;
|
|
17
|
+
//# sourceMappingURL=fingerprint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fingerprint.d.ts","sourceRoot":"","sources":["../../../../src/utils/fingerprint.ts"],"names":[],"mappings":"AAaA,MAAM,MAAM,wBAAwB,GAAG;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAClC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAGF,eAAO,MAAM,2BAA2B,QAAa,OAAO,CAAC,wBAAwB,CAwBpF,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The click id carried through the Play Store install referrer (`click_id=…`),
|
|
3
|
+
* or null — always null on iOS, where the App Store passes nothing through.
|
|
4
|
+
*/
|
|
5
|
+
export declare const getInstallReferrerClickId: () => Promise<string | null>;
|
|
6
|
+
//# sourceMappingURL=installReferrer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"installReferrer.d.ts","sourceRoot":"","sources":["../../../../src/utils/installReferrer.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,yBAAyB,QAAa,OAAO,CAAC,MAAM,GAAG,IAAI,CAYvE,CAAC"}
|