This page references our older Objective-C SDK. Check out our new Swift SDK to integrate our latest Swift-first library.
クリックの手動処理
コンテンツカードのクリックを手動で処理するには、ABKContentCardsTableViewControllerDelegate
プロトコルを実装し、ABKContentCardsTableViewController
の delegate
プロパティとしてデリゲートオブジェクトを設定します。例については、コンテンツカードのサンプルアプリを参照してください。
```objc contentCardsTableViewController.delegate = delegate;
// Methods to implement in delegate
-
(BOOL)contentCardTableViewController:(ABKContentCardsTableViewController *)viewController shouldHandleCardClick:(NSURL *)url { if ([[url.host lowercaseString] isEqualToString:@”my-domain.com”]) { // Custom handle link here NSLog(@”Manually handling Content Card click with URL %@”, url.absoluteString); return NO; } // Braze SDK にクリックアクションを処理させます return YES; }
-
(void)contentCardTableViewController:(ABKContentCardsTableViewController *)viewController didHandleCardClick:(NSURL *)url { NSLog(@”Braze SDK handled Content Card click with URL %@”, url.absoluteString); } ```
```swift contentCardsTableViewController.delegate = delegate
// Methods to implement in delegate func contentCardTableViewController(_ viewController: ABKContentCardsTableViewController!, shouldHandleCardClick url: URL!) -> Bool { if (url.host?.lowercased() == “my-domain.com”) { // Custom handle link here NSLog(“Manually handling Content Card click with URL %@”, url.absoluteString) return false } // Braze SDK にクリックアクションを処理させます return true }
func contentCardTableViewController(_ viewController:ABKContentCardsTableViewController!, didHandleCardClick url: URL!) { NSLog(“Braze SDK handled Content Card click with URL %@”, url.absoluteString) } ```
ABKContentCardsTableViewController
で handleCardClick:
メソッドをオーバーライドすると、これらのデリゲートメソッドが呼び出されない場合があります。