Customizing User-Defined Setting in GoogleService-info.plist

I have the following GoogleService-info.plist file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>TRACKING_ID</key>
    <string>$(GA_tracking_id)</string>
    <key>PLIST_VERSION</key>
    <string>1</string>
    <key>BUNDLE_ID</key>
    <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
</dict>
</plist>

Part of my build settings looks like this:

enter image description here

However, when I register Google Analytics, the variable is not dereferencing:

VERBOSE: GoogleAnalytics 3.13 -[GAIBatchingDispatcher persist:] (GAIBatchingDispatcher.m:517): Saved hit: {
    parameters =     {
        "&av" = "1.0.0";
        "&dm" = "x86_64";
        "&ds" = app;
        "&sr" = 640x1136;
        "&t" = screenview;
        "&tid" = "$(GA_tracking_id)";
        "&ul" = "en-us";
        "&v" = 1;
        gaiVersion = "3.13";
    };
    timestamp = "2015-11-04 17:38:54 +0000";
}

I used this strategy with Fabric, but it was in my Info.plistfile. It also $(PRODUCT_BUNDLE_IDENTIFIER)works as expected. How to get a variable for dereference instead of printing its literal string value.

+4
source share
1 answer

You cannot use Custom Options in custom plist files, including Google Analytics.

: fooobar.com/questions/385094/... , script, plist- plist Google Analytics.

+4

Source: https://habr.com/ru/post/1614495/


All Articles