@shware/analytics 2.3.0 → 2.3.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/dist/native/fbsdk.cjs +37 -0
- package/dist/native/fbsdk.cjs.map +1 -0
- package/dist/native/fbsdk.d.cts +6 -0
- package/dist/native/fbsdk.d.ts +6 -0
- package/dist/native/fbsdk.mjs +12 -0
- package/dist/native/fbsdk.mjs.map +1 -0
- package/dist/native/firebase.cjs +42 -0
- package/dist/native/firebase.cjs.map +1 -0
- package/dist/native/firebase.d.cts +6 -0
- package/dist/native/firebase.d.ts +6 -0
- package/dist/native/firebase.mjs +17 -0
- package/dist/native/firebase.mjs.map +1 -0
- package/dist/native/index.cjs +1 -1
- package/dist/native/index.cjs.map +1 -1
- package/dist/native/index.mjs +1 -1
- package/dist/native/index.mjs.map +1 -1
- package/package.json +21 -3
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/native/fbsdk.ts
|
|
21
|
+
var fbsdk_exports = {};
|
|
22
|
+
__export(fbsdk_exports, {
|
|
23
|
+
sendFBEvent: () => sendFBEvent
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(fbsdk_exports);
|
|
26
|
+
var import_react_native_fbsdk_next = require("react-native-fbsdk-next");
|
|
27
|
+
var import_fbq = require("../track/fbq.cjs");
|
|
28
|
+
async function sendFBEvent(name, properties) {
|
|
29
|
+
const { logEvent } = import_react_native_fbsdk_next.AppEventsLogger;
|
|
30
|
+
const [_, fbEventName, fbEventProperties] = (0, import_fbq.mapFBEvent)(name, properties);
|
|
31
|
+
logEvent(fbEventName, fbEventProperties);
|
|
32
|
+
}
|
|
33
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
34
|
+
0 && (module.exports = {
|
|
35
|
+
sendFBEvent
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=fbsdk.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/native/fbsdk.ts"],"sourcesContent":["import { AppEventsLogger, Params } from 'react-native-fbsdk-next';\nimport { mapFBEvent } from '../track/fbq';\nimport type { EventName, TrackName, TrackProperties } from '../track/types';\n\nexport async function sendFBEvent<T extends EventName>(\n name: TrackName<T>,\n properties?: TrackProperties<T>\n) {\n const { logEvent } = AppEventsLogger;\n const [_, fbEventName, fbEventProperties] = mapFBEvent(name, properties);\n logEvent(fbEventName, fbEventProperties as Params);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qCAAwC;AACxC,iBAA2B;AAG3B,eAAsB,YACpB,MACA,YACA;AACA,QAAM,EAAE,SAAS,IAAI;AACrB,QAAM,CAAC,GAAG,aAAa,iBAAiB,QAAI,uBAAW,MAAM,UAAU;AACvE,WAAS,aAAa,iBAA2B;AACnD;","names":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// src/native/fbsdk.ts
|
|
2
|
+
import { AppEventsLogger } from "react-native-fbsdk-next";
|
|
3
|
+
import { mapFBEvent } from "../track/fbq.mjs";
|
|
4
|
+
async function sendFBEvent(name, properties) {
|
|
5
|
+
const { logEvent } = AppEventsLogger;
|
|
6
|
+
const [_, fbEventName, fbEventProperties] = mapFBEvent(name, properties);
|
|
7
|
+
logEvent(fbEventName, fbEventProperties);
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
sendFBEvent
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=fbsdk.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/native/fbsdk.ts"],"sourcesContent":["import { AppEventsLogger, Params } from 'react-native-fbsdk-next';\nimport { mapFBEvent } from '../track/fbq';\nimport type { EventName, TrackName, TrackProperties } from '../track/types';\n\nexport async function sendFBEvent<T extends EventName>(\n name: TrackName<T>,\n properties?: TrackProperties<T>\n) {\n const { logEvent } = AppEventsLogger;\n const [_, fbEventName, fbEventProperties] = mapFBEvent(name, properties);\n logEvent(fbEventName, fbEventProperties as Params);\n}\n"],"mappings":";AAAA,SAAS,uBAA+B;AACxC,SAAS,kBAAkB;AAG3B,eAAsB,YACpB,MACA,YACA;AACA,QAAM,EAAE,SAAS,IAAI;AACrB,QAAM,CAAC,GAAG,aAAa,iBAAiB,IAAI,WAAW,MAAM,UAAU;AACvE,WAAS,aAAa,iBAA2B;AACnD;","names":[]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/native/firebase.ts
|
|
21
|
+
var firebase_exports = {};
|
|
22
|
+
__export(firebase_exports, {
|
|
23
|
+
sendFirebaseEvent: () => sendFirebaseEvent
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(firebase_exports);
|
|
26
|
+
var import_analytics = require("@react-native-firebase/analytics");
|
|
27
|
+
var analytics = (0, import_analytics.getAnalytics)();
|
|
28
|
+
async function sendFirebaseEvent(name, properties) {
|
|
29
|
+
if (name === "screen_view") {
|
|
30
|
+
await (0, import_analytics.logEvent)(analytics, "screen_view", {
|
|
31
|
+
firebase_screen: properties == null ? void 0 : properties.screen_name,
|
|
32
|
+
firebase_screen_class: properties == null ? void 0 : properties.screen_class
|
|
33
|
+
});
|
|
34
|
+
} else {
|
|
35
|
+
await (0, import_analytics.logEvent)(analytics, name, properties);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
39
|
+
0 && (module.exports = {
|
|
40
|
+
sendFirebaseEvent
|
|
41
|
+
});
|
|
42
|
+
//# sourceMappingURL=firebase.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/native/firebase.ts"],"sourcesContent":["import { logEvent, getAnalytics } from '@react-native-firebase/analytics';\nimport type { StandardEvents } from '../track/gtag';\nimport type { EventName, TrackName, TrackProperties } from '../track/types';\n\nconst analytics = getAnalytics();\n\nexport async function sendFirebaseEvent<T extends EventName>(\n name: TrackName<T>,\n properties?: TrackProperties<T>\n) {\n if (name === 'screen_view') {\n await logEvent(analytics, 'screen_view', {\n firebase_screen: (properties as StandardEvents['screen_view'])?.screen_name,\n firebase_screen_class: (properties as StandardEvents['screen_view'])?.screen_class,\n });\n } else {\n await logEvent(analytics, name, properties);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAuC;AAIvC,IAAM,gBAAY,+BAAa;AAE/B,eAAsB,kBACpB,MACA,YACA;AACA,MAAI,SAAS,eAAe;AAC1B,cAAM,2BAAS,WAAW,eAAe;AAAA,MACvC,iBAAkB,yCAA8C;AAAA,MAChE,uBAAwB,yCAA8C;AAAA,IACxE,CAAC;AAAA,EACH,OAAO;AACL,cAAM,2BAAS,WAAW,MAAM,UAAU;AAAA,EAC5C;AACF;","names":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// src/native/firebase.ts
|
|
2
|
+
import { logEvent, getAnalytics } from "@react-native-firebase/analytics";
|
|
3
|
+
var analytics = getAnalytics();
|
|
4
|
+
async function sendFirebaseEvent(name, properties) {
|
|
5
|
+
if (name === "screen_view") {
|
|
6
|
+
await logEvent(analytics, "screen_view", {
|
|
7
|
+
firebase_screen: properties == null ? void 0 : properties.screen_name,
|
|
8
|
+
firebase_screen_class: properties == null ? void 0 : properties.screen_class
|
|
9
|
+
});
|
|
10
|
+
} else {
|
|
11
|
+
await logEvent(analytics, name, properties);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
sendFirebaseEvent
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=firebase.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/native/firebase.ts"],"sourcesContent":["import { logEvent, getAnalytics } from '@react-native-firebase/analytics';\nimport type { StandardEvents } from '../track/gtag';\nimport type { EventName, TrackName, TrackProperties } from '../track/types';\n\nconst analytics = getAnalytics();\n\nexport async function sendFirebaseEvent<T extends EventName>(\n name: TrackName<T>,\n properties?: TrackProperties<T>\n) {\n if (name === 'screen_view') {\n await logEvent(analytics, 'screen_view', {\n firebase_screen: (properties as StandardEvents['screen_view'])?.screen_name,\n firebase_screen_class: (properties as StandardEvents['screen_view'])?.screen_class,\n });\n } else {\n await logEvent(analytics, name, properties);\n }\n}\n"],"mappings":";AAAA,SAAS,UAAU,oBAAoB;AAIvC,IAAM,YAAY,aAAa;AAE/B,eAAsB,kBACpB,MACA,YACA;AACA,MAAI,SAAS,eAAe;AAC1B,UAAM,SAAS,WAAW,eAAe;AAAA,MACvC,iBAAkB,yCAA8C;AAAA,MAChE,uBAAwB,yCAA8C;AAAA,IACxE,CAAC;AAAA,EACH,OAAO;AACL,UAAM,SAAS,WAAW,MAAM,UAAU;AAAA,EAC5C;AACF;","names":[]}
|
package/dist/native/index.cjs
CHANGED
|
@@ -83,7 +83,7 @@ async function getTags(release) {
|
|
|
83
83
|
const screen = import_react_native.Dimensions.get("screen");
|
|
84
84
|
const height = Math.floor(screen.height);
|
|
85
85
|
const width = Math.floor(screen.width);
|
|
86
|
-
const params = new import_react_native_url_polyfill.URLSearchParams(await (0, import_expo_application.getInstallReferrerAsync)());
|
|
86
|
+
const params = import_react_native.Platform.OS === "android" ? new import_react_native_url_polyfill.URLSearchParams(await (0, import_expo_application.getInstallReferrerAsync)()) : new import_react_native_url_polyfill.URLSearchParams();
|
|
87
87
|
return {
|
|
88
88
|
os: `${import_expo_device.osName} ${import_expo_device.osVersion}`,
|
|
89
89
|
os_name: import_expo_device.osName ?? void 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/native/index.ts"],"sourcesContent":["import AsyncStorage from '@react-native-async-storage/async-storage';\nimport { getIosIdForVendorAsync, getAndroidId, getInstallReferrerAsync } from 'expo-application';\nimport { randomUUID } from 'expo-crypto';\nimport {\n osName,\n osVersion,\n modelName,\n deviceType,\n DeviceType,\n manufacturer,\n modelId,\n} from 'expo-device';\nimport { getCalendars, getLocales } from 'expo-localization';\nimport { getAdvertisingId } from 'expo-tracking-transparency';\nimport { Platform, PixelRatio, Dimensions } from 'react-native';\nimport { URLSearchParams } from 'react-native-url-polyfill';\nimport type { Storage } from '../setup/index';\nimport type { TrackTags } from '../track/types';\n\nexport const storage: Storage = {\n getItem: (key) => AsyncStorage.getItem(key),\n setItem: (key, value) => AsyncStorage.setItem(key, value),\n};\n\nexport async function getDeviceId(): Promise<string> {\n let deviceId: string | null = null;\n if (Platform.OS === 'ios') {\n deviceId = await getIosIdForVendorAsync();\n } else if (Platform.OS === 'android') {\n deviceId = getAndroidId();\n }\n if (!deviceId) {\n deviceId = await AsyncStorage.getItem('device_id');\n if (!deviceId) {\n deviceId = randomUUID();\n await AsyncStorage.setItem('device_id', deviceId);\n }\n }\n return deviceId;\n}\n\nexport function getDeviceType(): string | undefined {\n switch (deviceType) {\n case DeviceType.PHONE:\n return 'mobile';\n case DeviceType.TABLET:\n return 'tablet';\n case DeviceType.DESKTOP:\n return 'desktop';\n case DeviceType.TV:\n return 'smarttv';\n default:\n return undefined;\n }\n}\n\nexport async function getTags(release: string): Promise<TrackTags> {\n const screen = Dimensions.get('screen');\n const height = Math.floor(screen.height);\n const width = Math.floor(screen.width);\n const params
|
|
1
|
+
{"version":3,"sources":["../../src/native/index.ts"],"sourcesContent":["import AsyncStorage from '@react-native-async-storage/async-storage';\nimport { getIosIdForVendorAsync, getAndroidId, getInstallReferrerAsync } from 'expo-application';\nimport { randomUUID } from 'expo-crypto';\nimport {\n osName,\n osVersion,\n modelName,\n deviceType,\n DeviceType,\n manufacturer,\n modelId,\n} from 'expo-device';\nimport { getCalendars, getLocales } from 'expo-localization';\nimport { getAdvertisingId } from 'expo-tracking-transparency';\nimport { Platform, PixelRatio, Dimensions } from 'react-native';\nimport { URLSearchParams } from 'react-native-url-polyfill';\nimport type { Storage } from '../setup/index';\nimport type { TrackTags } from '../track/types';\n\nexport const storage: Storage = {\n getItem: (key) => AsyncStorage.getItem(key),\n setItem: (key, value) => AsyncStorage.setItem(key, value),\n};\n\nexport async function getDeviceId(): Promise<string> {\n let deviceId: string | null = null;\n if (Platform.OS === 'ios') {\n deviceId = await getIosIdForVendorAsync();\n } else if (Platform.OS === 'android') {\n deviceId = getAndroidId();\n }\n if (!deviceId) {\n deviceId = await AsyncStorage.getItem('device_id');\n if (!deviceId) {\n deviceId = randomUUID();\n await AsyncStorage.setItem('device_id', deviceId);\n }\n }\n return deviceId;\n}\n\nexport function getDeviceType(): string | undefined {\n switch (deviceType) {\n case DeviceType.PHONE:\n return 'mobile';\n case DeviceType.TABLET:\n return 'tablet';\n case DeviceType.DESKTOP:\n return 'desktop';\n case DeviceType.TV:\n return 'smarttv';\n default:\n return undefined;\n }\n}\n\nexport async function getTags(release: string): Promise<TrackTags> {\n const screen = Dimensions.get('screen');\n const height = Math.floor(screen.height);\n const width = Math.floor(screen.width);\n const params =\n Platform.OS === 'android'\n ? new URLSearchParams(await getInstallReferrerAsync())\n : new URLSearchParams();\n\n return {\n os: `${osName} ${osVersion}`,\n os_name: osName ?? undefined,\n os_version: osVersion ?? undefined,\n platform: Platform.OS,\n device: modelName ?? undefined,\n device_id: await getDeviceId(),\n device_type: getDeviceType(),\n device_vendor: manufacturer ?? undefined,\n device_model_id: modelId ?? undefined,\n device_pixel_ratio: `${PixelRatio.get()}`,\n screen_width: height,\n screen_height: width,\n screen_resolution: `${height}x${width}`,\n release: release,\n language: getLocales()?.[0]?.languageTag ?? 'en',\n time_zone: getCalendars()?.[0]?.timeZone ?? 'UTC',\n environment: __DEV__ ? 'development' : 'production',\n source: 'app',\n // ads\n advertising_id: getAdvertisingId() ?? undefined,\n // utm params\n utm_source: params.get('utm_source') ?? undefined,\n utm_medium: params.get('utm_medium') ?? undefined,\n utm_campaign: params.get('utm_campaign') ?? undefined,\n utm_term: params.get('utm_term') ?? undefined,\n utm_content: params.get('utm_content') ?? undefined,\n utm_id: params.get('utm_id') ?? undefined,\n utm_source_platform: params.get('utm_source_platform') ?? undefined,\n utm_creative_format: params.get('utm_creative_format') ?? undefined,\n utm_marketing_tactic: params.get('utm_marketing_tactic') ?? undefined,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAAyB;AACzB,8BAA8E;AAC9E,yBAA2B;AAC3B,yBAQO;AACP,+BAAyC;AACzC,wCAAiC;AACjC,0BAAiD;AACjD,uCAAgC;AAIzB,IAAM,UAAmB;AAAA,EAC9B,SAAS,CAAC,QAAQ,qBAAAA,QAAa,QAAQ,GAAG;AAAA,EAC1C,SAAS,CAAC,KAAK,UAAU,qBAAAA,QAAa,QAAQ,KAAK,KAAK;AAC1D;AAEA,eAAsB,cAA+B;AACnD,MAAI,WAA0B;AAC9B,MAAI,6BAAS,OAAO,OAAO;AACzB,eAAW,UAAM,gDAAuB;AAAA,EAC1C,WAAW,6BAAS,OAAO,WAAW;AACpC,mBAAW,sCAAa;AAAA,EAC1B;AACA,MAAI,CAAC,UAAU;AACb,eAAW,MAAM,qBAAAA,QAAa,QAAQ,WAAW;AACjD,QAAI,CAAC,UAAU;AACb,qBAAW,+BAAW;AACtB,YAAM,qBAAAA,QAAa,QAAQ,aAAa,QAAQ;AAAA,IAClD;AAAA,EACF;AACA,SAAO;AACT;AAEO,SAAS,gBAAoC;AAClD,UAAQ,+BAAY;AAAA,IAClB,KAAK,8BAAW;AACd,aAAO;AAAA,IACT,KAAK,8BAAW;AACd,aAAO;AAAA,IACT,KAAK,8BAAW;AACd,aAAO;AAAA,IACT,KAAK,8BAAW;AACd,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EACX;AACF;AAEA,eAAsB,QAAQ,SAAqC;AAxDnE;AAyDE,QAAM,SAAS,+BAAW,IAAI,QAAQ;AACtC,QAAM,SAAS,KAAK,MAAM,OAAO,MAAM;AACvC,QAAM,QAAQ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async function getTags(release) {
|
|
|
54
54
|
const screen = Dimensions.get("screen");
|
|
55
55
|
const height = Math.floor(screen.height);
|
|
56
56
|
const width = Math.floor(screen.width);
|
|
57
|
-
const params = new URLSearchParams(await getInstallReferrerAsync());
|
|
57
|
+
const params = Platform.OS === "android" ? new URLSearchParams(await getInstallReferrerAsync()) : new URLSearchParams();
|
|
58
58
|
return {
|
|
59
59
|
os: `${osName} ${osVersion}`,
|
|
60
60
|
os_name: osName ?? void 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/native/index.ts"],"sourcesContent":["import AsyncStorage from '@react-native-async-storage/async-storage';\nimport { getIosIdForVendorAsync, getAndroidId, getInstallReferrerAsync } from 'expo-application';\nimport { randomUUID } from 'expo-crypto';\nimport {\n osName,\n osVersion,\n modelName,\n deviceType,\n DeviceType,\n manufacturer,\n modelId,\n} from 'expo-device';\nimport { getCalendars, getLocales } from 'expo-localization';\nimport { getAdvertisingId } from 'expo-tracking-transparency';\nimport { Platform, PixelRatio, Dimensions } from 'react-native';\nimport { URLSearchParams } from 'react-native-url-polyfill';\nimport type { Storage } from '../setup/index';\nimport type { TrackTags } from '../track/types';\n\nexport const storage: Storage = {\n getItem: (key) => AsyncStorage.getItem(key),\n setItem: (key, value) => AsyncStorage.setItem(key, value),\n};\n\nexport async function getDeviceId(): Promise<string> {\n let deviceId: string | null = null;\n if (Platform.OS === 'ios') {\n deviceId = await getIosIdForVendorAsync();\n } else if (Platform.OS === 'android') {\n deviceId = getAndroidId();\n }\n if (!deviceId) {\n deviceId = await AsyncStorage.getItem('device_id');\n if (!deviceId) {\n deviceId = randomUUID();\n await AsyncStorage.setItem('device_id', deviceId);\n }\n }\n return deviceId;\n}\n\nexport function getDeviceType(): string | undefined {\n switch (deviceType) {\n case DeviceType.PHONE:\n return 'mobile';\n case DeviceType.TABLET:\n return 'tablet';\n case DeviceType.DESKTOP:\n return 'desktop';\n case DeviceType.TV:\n return 'smarttv';\n default:\n return undefined;\n }\n}\n\nexport async function getTags(release: string): Promise<TrackTags> {\n const screen = Dimensions.get('screen');\n const height = Math.floor(screen.height);\n const width = Math.floor(screen.width);\n const params
|
|
1
|
+
{"version":3,"sources":["../../src/native/index.ts"],"sourcesContent":["import AsyncStorage from '@react-native-async-storage/async-storage';\nimport { getIosIdForVendorAsync, getAndroidId, getInstallReferrerAsync } from 'expo-application';\nimport { randomUUID } from 'expo-crypto';\nimport {\n osName,\n osVersion,\n modelName,\n deviceType,\n DeviceType,\n manufacturer,\n modelId,\n} from 'expo-device';\nimport { getCalendars, getLocales } from 'expo-localization';\nimport { getAdvertisingId } from 'expo-tracking-transparency';\nimport { Platform, PixelRatio, Dimensions } from 'react-native';\nimport { URLSearchParams } from 'react-native-url-polyfill';\nimport type { Storage } from '../setup/index';\nimport type { TrackTags } from '../track/types';\n\nexport const storage: Storage = {\n getItem: (key) => AsyncStorage.getItem(key),\n setItem: (key, value) => AsyncStorage.setItem(key, value),\n};\n\nexport async function getDeviceId(): Promise<string> {\n let deviceId: string | null = null;\n if (Platform.OS === 'ios') {\n deviceId = await getIosIdForVendorAsync();\n } else if (Platform.OS === 'android') {\n deviceId = getAndroidId();\n }\n if (!deviceId) {\n deviceId = await AsyncStorage.getItem('device_id');\n if (!deviceId) {\n deviceId = randomUUID();\n await AsyncStorage.setItem('device_id', deviceId);\n }\n }\n return deviceId;\n}\n\nexport function getDeviceType(): string | undefined {\n switch (deviceType) {\n case DeviceType.PHONE:\n return 'mobile';\n case DeviceType.TABLET:\n return 'tablet';\n case DeviceType.DESKTOP:\n return 'desktop';\n case DeviceType.TV:\n return 'smarttv';\n default:\n return undefined;\n }\n}\n\nexport async function getTags(release: string): Promise<TrackTags> {\n const screen = Dimensions.get('screen');\n const height = Math.floor(screen.height);\n const width = Math.floor(screen.width);\n const params =\n Platform.OS === 'android'\n ? new URLSearchParams(await getInstallReferrerAsync())\n : new URLSearchParams();\n\n return {\n os: `${osName} ${osVersion}`,\n os_name: osName ?? undefined,\n os_version: osVersion ?? undefined,\n platform: Platform.OS,\n device: modelName ?? undefined,\n device_id: await getDeviceId(),\n device_type: getDeviceType(),\n device_vendor: manufacturer ?? undefined,\n device_model_id: modelId ?? undefined,\n device_pixel_ratio: `${PixelRatio.get()}`,\n screen_width: height,\n screen_height: width,\n screen_resolution: `${height}x${width}`,\n release: release,\n language: getLocales()?.[0]?.languageTag ?? 'en',\n time_zone: getCalendars()?.[0]?.timeZone ?? 'UTC',\n environment: __DEV__ ? 'development' : 'production',\n source: 'app',\n // ads\n advertising_id: getAdvertisingId() ?? undefined,\n // utm params\n utm_source: params.get('utm_source') ?? undefined,\n utm_medium: params.get('utm_medium') ?? undefined,\n utm_campaign: params.get('utm_campaign') ?? undefined,\n utm_term: params.get('utm_term') ?? undefined,\n utm_content: params.get('utm_content') ?? undefined,\n utm_id: params.get('utm_id') ?? undefined,\n utm_source_platform: params.get('utm_source_platform') ?? undefined,\n utm_creative_format: params.get('utm_creative_format') ?? undefined,\n utm_marketing_tactic: params.get('utm_marketing_tactic') ?? undefined,\n };\n}\n"],"mappings":";AAAA,OAAO,kBAAkB;AACzB,SAAS,wBAAwB,cAAc,+BAA+B;AAC9E,SAAS,kBAAkB;AAC3B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,cAAc,kBAAkB;AACzC,SAAS,wBAAwB;AACjC,SAAS,UAAU,YAAY,kBAAkB;AACjD,SAAS,uBAAuB;AAIzB,IAAM,UAAmB;AAAA,EAC9B,SAAS,CAAC,QAAQ,aAAa,QAAQ,GAAG;AAAA,EAC1C,SAAS,CAAC,KAAK,UAAU,aAAa,QAAQ,KAAK,KAAK;AAC1D;AAEA,eAAsB,cAA+B;AACnD,MAAI,WAA0B;AAC9B,MAAI,SAAS,OAAO,OAAO;AACzB,eAAW,MAAM,uBAAuB;AAAA,EAC1C,WAAW,SAAS,OAAO,WAAW;AACpC,eAAW,aAAa;A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A;AAAA,IAER,gBAAgB,iBAAiB,KAAK;AAAA;AAAA,IAEtC,YAAY,OAAO,IAAI,YAAY,KAAK;AAAA,IACxC,YAAY,OAAO,IAAI,YAAY,KAAK;AAAA,IACxC,cAAc,OAAO,IAAI,cAAc,KAAK;AAAA,IAC5C,UAAU,OAAO,IAAI,UAAU,KAAK;AAAA,IACpC,aAAa,OAAO,IAAI,aAAa,KAAK;AAAA,IAC1C,QAAQ,OAAO,IAAI,QAAQ,KAAK;AAAA,IAChC,qBAAqB,OAAO,IAAI,qBAAqB,KAAK;AAAA,IAC1D,qBAAqB,OAAO,IAAI,qBAAqB,KAAK;AAAA,IAC1D,sBAAsB,OAAO,IAAI,sBAAsB,KAAK;AAAA,EAC9D;AACF;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shware/analytics",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -18,6 +18,16 @@
|
|
|
18
18
|
"import": "./dist/native/index.mjs",
|
|
19
19
|
"require": "./dist/native/index.cjs"
|
|
20
20
|
},
|
|
21
|
+
"./native/fbsdk": {
|
|
22
|
+
"types": "./dist/native/fbsdk/index.d.ts",
|
|
23
|
+
"import": "./dist/native/fbsdk/index.mjs",
|
|
24
|
+
"require": "./dist/native/fbsdk/index.cjs"
|
|
25
|
+
},
|
|
26
|
+
"./native/firebase": {
|
|
27
|
+
"types": "./dist/native/firebase/index.d.ts",
|
|
28
|
+
"import": "./dist/native/firebase/index.mjs",
|
|
29
|
+
"require": "./dist/native/firebase/index.cjs"
|
|
30
|
+
},
|
|
21
31
|
"./web": {
|
|
22
32
|
"types": "./dist/web/index.d.ts",
|
|
23
33
|
"import": "./dist/web/index.mjs",
|
|
@@ -61,11 +71,12 @@
|
|
|
61
71
|
"@types/node": "^24.3.3",
|
|
62
72
|
"@types/react": "^19.1.13",
|
|
63
73
|
"typescript": "^5.9.2",
|
|
64
|
-
"@repo/
|
|
65
|
-
"@repo/
|
|
74
|
+
"@repo/typescript-config": "0.0.0",
|
|
75
|
+
"@repo/eslint-config": "0.0.4"
|
|
66
76
|
},
|
|
67
77
|
"peerDependencies": {
|
|
68
78
|
"@react-native-async-storage/async-storage": "^2.2.0",
|
|
79
|
+
"@react-native-firebase/analytics": "^23.3.1",
|
|
69
80
|
"expo-application": "7.0.7",
|
|
70
81
|
"expo-crypto": "^15.0.7",
|
|
71
82
|
"expo-device": "^8.0.7",
|
|
@@ -75,6 +86,7 @@
|
|
|
75
86
|
"next": "^15",
|
|
76
87
|
"react": "^19",
|
|
77
88
|
"react-native": "^0.81.4",
|
|
89
|
+
"react-native-fbsdk-next": "^13.4.1",
|
|
78
90
|
"react-native-url-polyfill": "^2.0.0",
|
|
79
91
|
"react-router": "^7"
|
|
80
92
|
},
|
|
@@ -82,6 +94,9 @@
|
|
|
82
94
|
"@react-native-async-storage/async-storage": {
|
|
83
95
|
"optional": true
|
|
84
96
|
},
|
|
97
|
+
"@react-native-firebase/analytics": {
|
|
98
|
+
"optional": true
|
|
99
|
+
},
|
|
85
100
|
"expo-application": {
|
|
86
101
|
"optional": true
|
|
87
102
|
},
|
|
@@ -109,6 +124,9 @@
|
|
|
109
124
|
"react-native": {
|
|
110
125
|
"optional": true
|
|
111
126
|
},
|
|
127
|
+
"react-native-fbsdk-next": {
|
|
128
|
+
"optional": true
|
|
129
|
+
},
|
|
112
130
|
"react-native-url-polyfill": {
|
|
113
131
|
"optional": true
|
|
114
132
|
},
|