Skip to content

Commit 208b0b7

Browse files
committed
Editor code adds unnecessary permission on Android
Fixes googleanalytics#15 Call for ‘SystemInfo.deviceUniqueIdentifier’ causes Unity to add READ_PHONE_STATE permission when building for Android, though this code is never run and not included in the build. Wrapped in preprocessor directives to prevent unwanted permission.
1 parent e6ebb99 commit 208b0b7

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

googleanalyticsv3.unitypackage

60 Bytes
Binary file not shown.

source/Plugins/GoogleAnalyticsV3/GoogleAnalyticsMPV3.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ limitations under the License.
2727
other than Android and iOS.
2828
*/
2929
public class GoogleAnalyticsMPV3 {
30+
#if UNITY_ANDROID && !UNITY_EDITOR
31+
#elif UNITY_IPHONE && !UNITY_EDITOR
32+
#else
3033
private string trackingCode;
3134
private string bundleIdentifier;
3235
private string appName;
@@ -416,4 +419,5 @@ public void SetOptOut(bool optOut) {
416419
this.optOut = optOut;
417420
}
418421

422+
#endif
419423
}

0 commit comments

Comments
 (0)