gpt4 book ai didi

ios - 服务器需要签名 URL(Unity Ads API)

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:10:15 24 4
gpt4 key购买 nike

我想在 iOS 应用程序中获取 Unity Ads 的统计信息。 Unity 为此提供了一个 API,但是他们声明

"The statistics server always requires signed URLs and will not work if accessed without a valid signature."

什么是签名 URL,我应该如何访问服务器?正常的 NSURLRequest 不起作用,我收到错误消息:{"error":"Authentication error","re​​sponseCode":500,"status":"error"}

这是我正在使用的代码(以这种方式发出请求适用于其他 API,只是不适用于统一广告)

- (IBAction)Button:(id)sender {
// Create the request.
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"https://gameads-admin.applifier.com/stats/acquisition-api?apikey=979c4e733ccd85a1eaef74e28f9dc1742d5fa5a2b3518fe10825aa13caf18185"]];

// Create url connection and fire request
NSURLConnection *conn = [[NSURLConnection alloc] initWithRequest:request delegate:self];
}

最佳答案

您是否在请求中将您的 api key 作为 GET 参数发送?

api?apikey=APIKEY

API


https://unityads.unity3d.com/help/Documentation%20for%20Publishers/Statistics-API-for-monetisation

In order to use the Unity Ads Statistics API, you need to get the API key from the Unity Ads Admin Panel. The API key is located in the Account Settings page.

The API key needs to be placed in the authentication request to the apikey HTTP GET parameter.

For example curl -L "http://gameads-admin.applifier.com/stats/acquisition-api?apikey=APIKEY" will directly output the file to the console.


更新

如果您提供了正确的 API KEY(顺便说一下,您不应该在此处发布),那么您的设置似乎有问题。我在终端中执行了您的示例。

➜ ~ curl -L "http://gameads-admin.applifier.com/stats/acquisition-api?apikey=YOUR_API_KEY" {"error":"Authentication error","responseCode":500,"status":"error"}%

然后我运行了我们的一个游戏并得到了不同的结果

➜ ~ curl -L "http://gameads-admin.applifier.com/stats/acquisition-api?apikey=OUR_HIDDEN_API_KEY" Date,Country code,Country tier,started,views,clicks,installs,spend

关于ios - 服务器需要签名 URL(Unity Ads API),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34568778/

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