gpt4 book ai didi

ios - Comscore SDK 未在 Swift 项目中进行跟踪

转载 作者:搜寻专家 更新时间:2023-11-01 07:12:10 25 4
gpt4 key购买 nike

我已经通过 Cocoapods 集成了 ComScore SDK pod 'ComScore'来自 here

并添加了 #import <ComScore/ComScore.h>到我的新娘标题

在我的 AppDelegate.swift 中

        let publisherConfiguration = SCORPublisherConfiguration(builderBlock: {(_ builder: SCORPublisherConfigurationBuilder) -> Void in
builder.publisherId = "*******"
builder.publisherSecret = "*******"
builder.applicationName = "*******"
} as? (SCORPublisherConfigurationBuilder?) -> Void)
SCORAnalytics.configuration().addClient(with: publisherConfiguration)
SCORAnalytics.start()

但没有将我的数据发送到服务器。

他们在他们的 objective c 示例应用程序中注意到下面的实现(他们不直接支持 Swift ,我使用 BridgingHeader 集成)

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

SCORPublisherConfiguration *publisherConfiguration = [SCORPublisherConfiguration publisherConfigurationWithBuilderBlock:^(SCORPublisherConfigurationBuilder *builder) {
builder.publisherId = @"1000001";
builder.publisherSecret = @"9c455c81a801d3832a2cd281843dff30";
}];

[[SCORAnalytics configuration] addClientWithConfiguration:publisherConfiguration];
[SCORAnalytics start];

return YES;
}

最佳答案

正确的语法是

    let check = SCORPublisherConfiguration(builderBlock: {(_ builder : SCORPublisherConfigurationBuilder!) -> Void in
builder.publisherId = "1000001"
builder.publisherSecret = "9c455c81a801d3832a2cd281843dff30"
builder.applicationName = "karthik_Test"

} )
SCORAnalytics.configuration().addClient(with: check)
SCORAnalytics.start()

ComScore 框架 需要AdSupport 框架 不要忘记添加。

关于ios - Comscore SDK 未在 Swift 项目中进行跟踪,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44242499/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com