iOS 代碼管理工具進階設定

如要擴充 Google 代碼管理工具的功能,您可以新增函式呼叫變數和函式呼叫代碼。函式呼叫變數可讓您擷取對預先註冊函式呼叫傳回的值。函式呼叫代碼可讓您執行預先註冊的函式 (例如在 Google 代碼管理工具中代碼範本目前不支援其他評估和再行銷工具時,用來觸發命中)。

如要建立自訂標記,請建立實作 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

使用 TAGCustomFunction 設定類別後,請使用代碼管理工具的網頁介面,根據您建立的類別名稱設定代碼或變數。