AppboyKit (também conhecido como o SDK Objective-C) não é mais suportado e foi substituído pelo Swift SDK. Não receberá mais novos recursos, correções de bugs, atualizações de segurança ou suporte técnico—no entanto, o envio de mensagens e a análise de dados continuarão a funcionar normalmente. Para saber mais, veja Apresentando o Novo SDK Braze Swift.
Gerenciar cliques manualmente
Você pode tratar manualmente os cliques no content card implementando o protocolo ABKContentCardsTableViewControllerDelegate e definindo seu objeto delegado como a propriedade delegate do ABKContentCardsTableViewController. Consulte o app de amostra de content cards para obter um exemplo.
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)
}
Se você substituir o método handleCardClick: em ABKContentCardsTableViewController, esses métodos delegados poderão não ser chamados.
Editar esta página no GitHub