@react-native-firebase/analytics 23.8.8 → 24.1.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/CHANGELOG.md +23 -0
- package/README.md +24 -0
- package/RNFBAnalytics.podspec +2 -1
- package/android/src/reactnative/java/io/invertase/firebase/analytics/ReactNativeFirebaseAnalyticsModule.java +48 -4
- package/app.plugin.js +1 -0
- package/dist/module/modular.js +15 -3
- package/dist/module/modular.js.map +1 -1
- package/dist/module/namespaced.js +5 -4
- package/dist/module/namespaced.js.map +1 -1
- package/dist/module/structs.js +4 -3
- package/dist/module/structs.js.map +1 -1
- package/dist/module/types/analytics.js.map +1 -1
- package/dist/module/types/internal.js +4 -0
- package/dist/module/types/internal.js.map +1 -0
- package/dist/module/version.js +1 -1
- package/dist/typescript/lib/modular.d.ts +8 -3
- package/dist/typescript/lib/modular.d.ts.map +1 -1
- package/dist/typescript/lib/namespaced.d.ts +1 -0
- package/dist/typescript/lib/namespaced.d.ts.map +1 -1
- package/dist/typescript/lib/structs.d.ts +58 -2
- package/dist/typescript/lib/structs.d.ts.map +1 -1
- package/dist/typescript/lib/types/analytics.d.ts +2 -1
- package/dist/typescript/lib/types/analytics.d.ts.map +1 -1
- package/dist/typescript/lib/types/internal.d.ts +39 -0
- package/dist/typescript/lib/types/internal.d.ts.map +1 -0
- package/dist/typescript/lib/version.d.ts +1 -1
- package/ios/RNFBAnalytics/RNFBAnalyticsLogTransaction.swift +74 -0
- package/ios/RNFBAnalytics/RNFBAnalyticsModule.m +71 -3
- package/ios/RNFBAnalytics.xcodeproj/project.pbxproj +6 -0
- package/lib/modular.ts +17 -3
- package/lib/namespaced.ts +18 -7
- package/lib/structs.ts +3 -2
- package/lib/types/analytics.ts +2 -1
- package/lib/types/internal.ts +62 -0
- package/lib/version.ts +1 -1
- package/package.json +16 -5
- package/plugin/build/index.d.ts +4 -0
- package/plugin/build/index.js +16 -0
- package/plugin/build/ios/index.d.ts +2 -0
- package/plugin/build/ios/index.js +6 -0
- package/plugin/build/ios/podfile.d.ts +6 -0
- package/plugin/build/ios/podfile.js +45 -0
- package/plugin/build/pluginConfig.d.ts +10 -0
- package/plugin/build/pluginConfig.js +2 -0
- package/plugin/src/index.ts +18 -0
- package/plugin/src/ios/index.ts +6 -0
- package/plugin/src/ios/podfile.ts +72 -0
- package/plugin/src/pluginConfig.ts +11 -0
- package/plugin/tsconfig.json +9 -0
- package/plugin/tsconfig.tsbuildinfo +1 -0
- package/typedoc.json +48 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.withIosWithoutAdIdSupport = exports.withIosGoogleAppMeasurementOnDeviceConversion = void 0;
|
|
4
|
+
exports.setAnalyticsPodfileWithoutAdIdSupport = setAnalyticsPodfileWithoutAdIdSupport;
|
|
5
|
+
exports.setAnalyticsPodfileGoogleAppMeasurementOnDeviceConversion = setAnalyticsPodfileGoogleAppMeasurementOnDeviceConversion;
|
|
6
|
+
const config_plugins_1 = require("@expo/config-plugins");
|
|
7
|
+
const generateCode_1 = require("@expo/config-plugins/build/utils/generateCode");
|
|
8
|
+
const TAG = '@react-native-firebase/analytics-withoutAdIdSupport';
|
|
9
|
+
const ANCHOR = /prepare_react_native_project!/;
|
|
10
|
+
const FLAG = '$RNFirebaseAnalyticsWithoutAdIdSupport = true';
|
|
11
|
+
const TAG_ODM = '@react-native-firebase/analytics-googleAppMeasurementOnDeviceConversion';
|
|
12
|
+
const FLAG_ODM = '$RNFirebaseAnalyticsGoogleAppMeasurementOnDeviceConversion = true';
|
|
13
|
+
function setAnalyticsPodfileFlag(src, tag, flag, enabled = false) {
|
|
14
|
+
if (!enabled) {
|
|
15
|
+
return (0, generateCode_1.removeGeneratedContents)(src, tag) ?? src;
|
|
16
|
+
}
|
|
17
|
+
return (0, generateCode_1.mergeContents)({
|
|
18
|
+
src,
|
|
19
|
+
newSrc: flag,
|
|
20
|
+
tag,
|
|
21
|
+
anchor: ANCHOR,
|
|
22
|
+
offset: 1,
|
|
23
|
+
comment: '#',
|
|
24
|
+
}).contents;
|
|
25
|
+
}
|
|
26
|
+
function setAnalyticsPodfileWithoutAdIdSupport(src, enabled = false) {
|
|
27
|
+
return setAnalyticsPodfileFlag(src, TAG, FLAG, enabled);
|
|
28
|
+
}
|
|
29
|
+
function setAnalyticsPodfileGoogleAppMeasurementOnDeviceConversion(src, enabled = false) {
|
|
30
|
+
return setAnalyticsPodfileFlag(src, TAG_ODM, FLAG_ODM, enabled);
|
|
31
|
+
}
|
|
32
|
+
const withIosGoogleAppMeasurementOnDeviceConversion = (config, props) => {
|
|
33
|
+
return (0, config_plugins_1.withPodfile)(config, config => {
|
|
34
|
+
config.modResults.contents = setAnalyticsPodfileGoogleAppMeasurementOnDeviceConversion(config.modResults.contents, props?.ios?.googleAppMeasurementOnDeviceConversion === true);
|
|
35
|
+
return config;
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
exports.withIosGoogleAppMeasurementOnDeviceConversion = withIosGoogleAppMeasurementOnDeviceConversion;
|
|
39
|
+
const withIosWithoutAdIdSupport = (config, props) => {
|
|
40
|
+
return (0, config_plugins_1.withPodfile)(config, config => {
|
|
41
|
+
config.modResults.contents = setAnalyticsPodfileWithoutAdIdSupport(config.modResults.contents, props?.ios?.withoutAdIdSupport === true);
|
|
42
|
+
return config;
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
exports.withIosWithoutAdIdSupport = withIosWithoutAdIdSupport;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ConfigPlugin, withPlugins, createRunOncePlugin } from '@expo/config-plugins';
|
|
2
|
+
|
|
3
|
+
import { withIosWithoutAdIdSupport, withIosGoogleAppMeasurementOnDeviceConversion } from './ios';
|
|
4
|
+
import { PluginConfigType } from './pluginConfig';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A config plugin for configuring `@react-native-firebase/analytics`
|
|
8
|
+
*/
|
|
9
|
+
const withRnFirebaseAnalytics: ConfigPlugin<PluginConfigType> = (config, props) => {
|
|
10
|
+
return withPlugins(config, [
|
|
11
|
+
// iOS
|
|
12
|
+
[withIosWithoutAdIdSupport, props],
|
|
13
|
+
[withIosGoogleAppMeasurementOnDeviceConversion, props],
|
|
14
|
+
]);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const pak = require('../../package.json');
|
|
18
|
+
export default createRunOncePlugin(withRnFirebaseAnalytics, pak.name, pak.version);
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { ConfigPlugin, withPodfile } from '@expo/config-plugins';
|
|
2
|
+
import {
|
|
3
|
+
mergeContents,
|
|
4
|
+
removeGeneratedContents,
|
|
5
|
+
} from '@expo/config-plugins/build/utils/generateCode';
|
|
6
|
+
|
|
7
|
+
import { PluginConfigType } from '../pluginConfig';
|
|
8
|
+
|
|
9
|
+
const TAG = '@react-native-firebase/analytics-withoutAdIdSupport';
|
|
10
|
+
const ANCHOR = /prepare_react_native_project!/;
|
|
11
|
+
const FLAG = '$RNFirebaseAnalyticsWithoutAdIdSupport = true';
|
|
12
|
+
const TAG_ODM = '@react-native-firebase/analytics-googleAppMeasurementOnDeviceConversion';
|
|
13
|
+
const FLAG_ODM = '$RNFirebaseAnalyticsGoogleAppMeasurementOnDeviceConversion = true';
|
|
14
|
+
|
|
15
|
+
function setAnalyticsPodfileFlag(
|
|
16
|
+
src: string,
|
|
17
|
+
tag: string,
|
|
18
|
+
flag: string,
|
|
19
|
+
enabled: boolean = false,
|
|
20
|
+
): string {
|
|
21
|
+
if (!enabled) {
|
|
22
|
+
return removeGeneratedContents(src, tag) ?? src;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return mergeContents({
|
|
26
|
+
src,
|
|
27
|
+
newSrc: flag,
|
|
28
|
+
tag,
|
|
29
|
+
anchor: ANCHOR,
|
|
30
|
+
offset: 1,
|
|
31
|
+
comment: '#',
|
|
32
|
+
}).contents;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function setAnalyticsPodfileWithoutAdIdSupport(
|
|
36
|
+
src: string,
|
|
37
|
+
enabled: boolean = false,
|
|
38
|
+
): string {
|
|
39
|
+
return setAnalyticsPodfileFlag(src, TAG, FLAG, enabled);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function setAnalyticsPodfileGoogleAppMeasurementOnDeviceConversion(
|
|
43
|
+
src: string,
|
|
44
|
+
enabled: boolean = false,
|
|
45
|
+
): string {
|
|
46
|
+
return setAnalyticsPodfileFlag(src, TAG_ODM, FLAG_ODM, enabled);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export const withIosGoogleAppMeasurementOnDeviceConversion: ConfigPlugin<PluginConfigType> = (
|
|
50
|
+
config,
|
|
51
|
+
props,
|
|
52
|
+
) => {
|
|
53
|
+
return withPodfile(config, config => {
|
|
54
|
+
config.modResults.contents = setAnalyticsPodfileGoogleAppMeasurementOnDeviceConversion(
|
|
55
|
+
config.modResults.contents,
|
|
56
|
+
props?.ios?.googleAppMeasurementOnDeviceConversion === true,
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
return config;
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export const withIosWithoutAdIdSupport: ConfigPlugin<PluginConfigType> = (config, props) => {
|
|
64
|
+
return withPodfile(config, config => {
|
|
65
|
+
config.modResults.contents = setAnalyticsPodfileWithoutAdIdSupport(
|
|
66
|
+
config.modResults.contents,
|
|
67
|
+
props?.ios?.withoutAdIdSupport === true,
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
return config;
|
|
71
|
+
});
|
|
72
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"root":["./src/index.ts","./src/pluginConfig.ts","./src/ios/index.ts","./src/ios/podfile.ts"],"version":"5.9.3"}
|
package/typedoc.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://typedoc.org/schema.json",
|
|
3
|
+
"entryPoints": ["lib/modular.ts", "lib/types/analytics.ts"],
|
|
4
|
+
"tsconfig": "tsconfig.json",
|
|
5
|
+
"intentionallyNotExported": [
|
|
6
|
+
"_AddPaymentInfoEventParameters",
|
|
7
|
+
"_AddShippingInfoEventParameters",
|
|
8
|
+
"_AddShippingInfoParameters",
|
|
9
|
+
"_AddToCartEventParameters",
|
|
10
|
+
"_AddToWishlistEventParameters",
|
|
11
|
+
"_AnalyticsCallOptions",
|
|
12
|
+
"_AnalyticsSettings",
|
|
13
|
+
"_BeginCheckoutEventParameters",
|
|
14
|
+
"_CampaignDetailsEventParameters",
|
|
15
|
+
"_ConsentSettings",
|
|
16
|
+
"_EarnVirtualCurrencyEventParameters",
|
|
17
|
+
"_EventParams",
|
|
18
|
+
"_GenerateLeadEventParameters",
|
|
19
|
+
"_GtagConfigParams",
|
|
20
|
+
"_Item",
|
|
21
|
+
"_JoinGroupEventParameters",
|
|
22
|
+
"_LevelEndEventParameters",
|
|
23
|
+
"_LevelStartEventParameters",
|
|
24
|
+
"_LevelUpEventParameters",
|
|
25
|
+
"_LoginEventParameters",
|
|
26
|
+
"_PostScoreEventParameters",
|
|
27
|
+
"_PurchaseEventParameters",
|
|
28
|
+
"_RefundEventParameters",
|
|
29
|
+
"_RemoveFromCartEventParameters",
|
|
30
|
+
"_ScreenViewParameters",
|
|
31
|
+
"_SearchEventParameters",
|
|
32
|
+
"_SelectContentEventParameters",
|
|
33
|
+
"_SelectItemEventParameters",
|
|
34
|
+
"_SelectPromotionEventParameters",
|
|
35
|
+
"_SetCheckoutOptionEventParameters",
|
|
36
|
+
"_SettingsOptions",
|
|
37
|
+
"_ShareEventParameters",
|
|
38
|
+
"_SignUpEventParameters",
|
|
39
|
+
"_SpendVirtualCurrencyEventParameters",
|
|
40
|
+
"_Statics",
|
|
41
|
+
"_UnlockAchievementEventParameters",
|
|
42
|
+
"_ViewCartEventParameters",
|
|
43
|
+
"_ViewItemEventParameters",
|
|
44
|
+
"_ViewItemListEventParameters",
|
|
45
|
+
"_ViewPromotionEventParameters",
|
|
46
|
+
"_ViewSearchResultsParameters"
|
|
47
|
+
]
|
|
48
|
+
}
|