如何在 Youtube API 上使用 etag-swift [英] How is etag used on Youtube API- swift

查看:26
本文介绍了如何在 Youtube API 上使用 etag-swift的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试在我的 Swift 应用程序中使用 youtube api 上的 etag 来查找播放列表,但我的印象是我必须将它作为参数包含在内.但是,没有用于此的参数.我还尝试缓存 etag 并将其与从不同答案收到的新 etag 进行比较,但无论播放列表本身是否更改,它总是会更改.有人能指引我朝正确的方向发展吗?

I've been trying to use the etag on the youtube api in my Swift app to find a playlist, but I was under the impression that I had to include it as a parameter. There is however no parameter for this. I also tried to cache the etag and compare it to the new one received from a different answer, but it always changes regardless of whether or not the playlist itself changed. Can somebody steer me in the right direction?

谢谢!

推荐答案

扩展 Google Tag Manager,您可以添加函数调用变量和函数调用标签.函数调用变量可让您捕获调用预注册函数所返回的值.函数调用标签让你执行预先注册的函数

To extend the functionality of Google Tag Manager, you can add Function Call variables and Function Call tags. Function Call variables let you capture the values returned by calls to pre-registered functions. Function Call tags let you execute pre-registered functions

使用函数调用添加自定义标记或自定义变量:

To add a custom tag or custom variable with a Function Call:

要创建自定义标签,请创建一个实现 TAGCustomFunction 协议的类:

@implementation MYCustomTag<TAGCustomFunction>

- (NSObject*)executeWithParameters:(NSDictionary*)parameters {
// Add custom tag implementation here.
}

@end

要创建自定义变量,请创建一个实现 TAGCustomFunction 协议的类:

@implementation MYCustomVariable<TAGCustomFunction>

- (NSObject*)executeWithParameters:(NSDictionary*)parameters {
// Return the value of the custom variable.
return @42;
}

@end

确保链接器不会在链接时间优化期间消除您的类.

Make sure the linker doesn't eliminate your class during link time optimization.

在 Google Tag Manager 的网络界面中,使用类名来设置标签和变量.

In Google Tag Manager's web interface, use the class name to set up tags and variables.

这篇关于如何在 Youtube API 上使用 etag-swift的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆