Skip to content

Commit 892dcc1

Browse files
chore(android,ios): remove unnecessary Firebase preferences (#58)
* fix: properly set `FirebaseAutomaticScreenReportingEnabled` key References: https://outsystemsrd.atlassian.net/browse/RMET-4915 * fix: remove FirebaseAutomaticScreenReportingEnabled altogether Context: By default the preference is already true in iOS, so no need to explicitly set it. References: https://outsystemsrd.atlassian.net/browse/RMET-4915 * chore: remove unnecessary preference from Android Context: It is also true by default, so we don't need to specifically set it. * chore: remove unnecessary preferences from Android and iOS for Capacitor builds Context: These are already true by default, so no need to explicitly set them. * chore: update PR template * chore(release): raise to version 5.0.0-OS20
1 parent 14a8492 commit 892dcc1

6 files changed

Lines changed: 11 additions & 18 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
The changes documented here do not include those from the original repository.
88

9+
## 5.0.0-OS20
10+
11+
### Chores
12+
- [Android,iOS] remove unnecessary Firebase preferences (https://outsystemsrd.atlassian.net/browse/RMET-4915).
13+
914
## 5.0.0-OS19
1015

1116
### Fixes

PULL_REQUEST_TEMPLATE.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626
## Checklist
2727
<!--- Go over all the following items and put an `x` in all the boxes that apply -->
28-
- [ ] Pull request title follows the format `RNMT-XXXX <title>`
2928
- [ ] Code follows code style of this project
3029
- [ ] CHANGELOG.md file is correctly updated
3130
- [ ] Changes require an update to the documentation

build-actions/setAnalyticsConfigurations.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ variables:
1111
platforms:
1212
android:
1313
manifest:
14-
- file: AndroidManifest.xml
15-
target: manifest/application
16-
inject: |
17-
<meta-data android:name="google_analytics_automatic_screen_reporting_enabled" android:value="true"/>
1814
- file: AndroidManifest.xml
1915
target: manifest/application
2016
inject: |
@@ -23,7 +19,6 @@ platforms:
2319
plist:
2420
- replace: true
2521
entries:
26-
- FirebaseAutomaticScreenReportingEnabled: true
2722
- FIREBASE_ANALYTICS_COLLECTION_ENABLED: $ANALYTICS_COLLECTION_ENABLED
2823

2924
- replace: true

hooks/ios/iOSCopyPreferences.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ module.exports = function (context) {
1212
let infoPlistPath = path.join(projectRoot, 'platforms/ios/' + appName + '/'+ appName +'-info.plist');
1313
let obj = plist.parse(fs.readFileSync(infoPlistPath, 'utf8'));
1414

15+
16+
// set NSUserTrackingUsageDescription if EnableAppTrackingTransparencyPrompt is true
1517
let enableAppTracking = configParser.getPlatformPreference("EnableAppTrackingTransparencyPrompt", "ios");
1618
if(enableAppTracking == "true" || enableAppTracking == ""){
1719
let userTrackingDescription = configParser.getPlatformPreference("USER_TRACKING_DESCRIPTION_IOS", "ios");
@@ -20,13 +22,13 @@ module.exports = function (context) {
2022
}
2123
}
2224
else if(enableAppTracking == "false"){
23-
delete obj['NSUserTrackingUsageDescription'];
25+
delete obj['NSUserTrackingUsageDescription'];
2426
}
2527

2628
let collectionEnabled = configParser.getGlobalPreference("ANALYTICS_COLLECTION_ENABLED");
2729
if (collectionEnabled.toLowerCase() == 'false') {
2830
obj['FIREBASE_ANALYTICS_COLLECTION_ENABLED'] = false;
29-
}
31+
}
3032

3133
fs.writeFileSync(infoPlistPath, plist.build(obj));
3234
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cordova-plugin-firebase-analytics",
3-
"version": "5.0.0-OS19",
3+
"version": "5.0.0-OS20",
44
"description": "Cordova plugin for Firebase Analytics",
55
"cordova": {
66
"id": "cordova-plugin-firebase-analytics",

plugin.xml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
22
xmlns:android="http://schemas.android.com/apk/res/android"
33
id="cordova-plugin-firebase-analytics"
4-
version="5.0.0-OS19">
4+
version="5.0.0-OS20">
55

66
<name>FirebaseAnalyticsPlugin</name>
77
<description>Cordova plugin for Firebase Analytics</description>
@@ -20,7 +20,6 @@ xmlns:android="http://schemas.android.com/apk/res/android"
2020
<engine name="cordova-ios" version=">=5.1.1"/>
2121
</engines>
2222

23-
<preference name="AUTOMATIC_SCREEN_REPORTING_ENABLED" default="true" />
2423
<preference name="USER_TRACKING_DESCRIPTION_IOS" default="$(PRODUCT_NAME) needs your attention." />
2524

2625
<platform name="ios">
@@ -41,9 +40,6 @@ xmlns:android="http://schemas.android.com/apk/res/android"
4140
use a bit hacky method to set boolean value as a string:
4241
https://developer.apple.com/documentation/foundation/nsstring/1409420-boolvalue?preferredLanguage=occ
4342
-->
44-
<config-file target="*-Info.plist" parent="FirebaseAutomaticScreenReportingEnabled">
45-
<string>$AUTOMATIC_SCREEN_REPORTING_ENABLED</string>
46-
</config-file>
4743
<config-file target="*-Info.plist" parent="NSUserTrackingUsageDescription">
4844
<string>$USER_TRACKING_DESCRIPTION_IOS</string>
4945
</config-file>
@@ -95,10 +91,6 @@ xmlns:android="http://schemas.android.com/apk/res/android"
9591
<uses-permission android:name="android.permission.INTERNET" />
9692
</edit-config>
9793

98-
<edit-config target="AndroidManifest.xml" parent="/manifest/application">
99-
<meta-data android:name="google_analytics_automatic_screen_reporting_enabled" android:value="$AUTOMATIC_SCREEN_REPORTING_ENABLED" />
100-
</edit-config>
101-
10294
<framework src="build.gradle" custom="true" type="gradleReference" />
10395

10496
<source-file src="src/android/com/outsystems/firebase/analytics/FirebaseAnalyticsPlugin.java" target-dir="src/com/outsystems/plugins/firebase/analytics/" />

0 commit comments

Comments
 (0)