
AppboyKit (également connu sous le nom de SDK Objective-C) n’est plus pris en charge et a été remplacé par Swift SDK. Il ne recevra plus de nouvelles fonctionnalités, de corrections de bugs, de mises à jour de sécurité ou d’assistance technique - cependant, la messagerie et l’analyse continueront à fonctionner normalement. Pour en savoir plus, consultez Présentation du nouveau SDK Braze Swift.
Gérer les clics manuellement
Vous pouvez gérer manuellement les clics sur les cartes de contenu en implémentant le protocole ABKContentCardsTableViewControllerDelegate et en définissant votre objet délégué comme la propriété delegate du ABKContentCardsTableViewController. Reportez-vous à l’exemple d’application Content Cards pour un exemple.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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;
}
// Let the Braze SDK handle the click action
return YES;
}
- (void)contentCardTableViewController:(ABKContentCardsTableViewController *)viewController
didHandleCardClick:(NSURL *)url {
NSLog(@"Braze SDK handled Content Card click with URL %@", url.absoluteString);
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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
}
// Let the Braze SDK handle the click action
return true
}
func contentCardTableViewController(_ viewController: ABKContentCardsTableViewController!,
didHandleCardClick url: URL!) {
NSLog("Braze SDK handled Content Card click with URL %@", url.absoluteString)
}

Si vous remplacez la méthode handleCardClick: dans ABKContentCardsTableViewController, ces méthodes de délégation ne peuvent pas être employées.