GAIDictionaryBuilder设置forKey:GAISessionControl错误读取:值的键表示它不符合代码。
GAIDictionaryBuilder *dictionary = [GAIDictionaryBuilder createEventWithCategory:@"UX" action:@"App started" label:nil value:nil]; [dictionary setValue:@"start" forKey:kGAISessionControl]; [[GAI sharedInstance].defaultTracker send:dictionary.build];我直接从他们的网站上关注Google的文档,并且仍然不知道错误来自哪里? https://developers.google.com/analytics/devguides/collection/ios/v3/migration#setting-data
GAIDictionaryBuilder set forKey:GAISessionControl error reads: key for value says it's not code compliant.
GAIDictionaryBuilder *dictionary = [GAIDictionaryBuilder createEventWithCategory:@"UX" action:@"App started" label:nil value:nil]; [dictionary setValue:@"start" forKey:kGAISessionControl]; [[GAI sharedInstance].defaultTracker send:dictionary.build];I am following Google's documentation directly from their site, & still have no idea where the error is coming from? https://developers.google.com/analytics/devguides/collection/ios/v3/migration#setting-data
最满意答案
Google Analytics文档存在错误(与通常一样)。 我通过将“setValue:”替换为“set:”来消除错误
来自:[字典setValue:@“start”forKey:kGAISessionControl];
to:[字典集:@“start”forKey:kGAISessionControl];
现在工作得很好。
GAIDictionaryBuilder *dictionary = [GAIDictionaryBuilder createEventWithCategory:@"UX" action:@"App started" label:nil value:nil]; [dictionary setValue:@"start" forKey:kGAISessionControl]; [[GAI sharedInstance].defaultTracker send:dictionary.build];Google Analytics documentation has an error (like usual). I got rid of the error by replacing "setValue:" with "set:"
from: [dictionary setValue:@"start" forKey:kGAISessionControl];
to: [dictionary set:@"start" forKey:kGAISessionControl];
Works perfectly now.
GAIDictionaryBuilder *dictionary = [GAIDictionaryBuilder createEventWithCategory:@"UX" action:@"App started" label:nil value:nil]; [dictionary setValue:@"start" forKey:kGAISessionControl]; [[GAI sharedInstance].defaultTracker send:dictionary.build];更多推荐
发布评论