googleanalytics / google-analytics-plugin-for-unity

Google Analytics plugin for the Unity game creation system
Apache License 2.0
386 stars 140 forks source link

Use of undeclared identifier 'allowIDFACollection'. #42

Open georgepiva opened 9 years ago

georgepiva commented 9 years ago

In order to support Demographics and Interests inside my iOS application I extended the current Google Analytics Plugin for Unity to support the Google Analytics Services SDK for iOS v3.10 as follows:

  1. Download Google Analytics Services SDK for iOS v3.10;
  2. Replace Assets/Plugins/iOS/GAI* files by all GoogleAnalyticsServicesiOS-3.10/GoogleAnalytics/Library files;
  3. Replace Assets/Plugins/iOS/libGoogleAnalyticsServices.a file by the GoogleAnalyticsServicesiOS-3.10/libGoogleAnalyticsServices.a one;
  4. Add the GoogleAnalyticsServicesiOS-3.10/libAdIdAccess.a file to Assets/Plugins/iOS/;
  5. Replace the next Assets/Plugins/iOS/GAIHandler.m methods implementation:
id<GAITracker> trackerWithName(char *name, char *trackingId) {
    id<GAITracker> tracker = [[GAI sharedInstance] trackerWithName: [NSString stringWithUTF8String:name]
                                                        trackingId: [NSString stringWithUTF8String:trackingId]];
    tracker.allowIDFACollection = YES;
    return tracker;
}

id<GAITracker> trackerWithTrackingId(char *trackingId) {
    id<GAITracker> tracker = [[GAI sharedInstance] trackerWithTrackingId:[NSString stringWithUTF8String:trackingId ]];
    tracker.allowIDFACollection = YES;
    return tracker;
}

void setName(char *name) {
    id tracker = [[GAI sharedInstance] defaultTracker];
    [tracker set:kGAIScreenName
           value:[NSString stringWithUTF8String:name ]];
}

Will allowIDFACollection be supported inside the next plugin release?

mhalttu commented 9 years ago

:+1:

Great job documenting the process, by the way.

hantingxie commented 9 years ago

Thank you for giving this solution. However I notice that there is currently no method called void setName(char *name) in my GAIHandler.mm, do you mean by adding this method at the same time?

BestStream commented 8 years ago

+1

brentvincent commented 7 years ago

+1, thanks, we needed this as well.

ksnegov commented 7 years ago

Still waiting