AppboyKit (también conocido como SDK Objective-C) ya no recibe soporte y ha sido sustituido por Swift SDK. Ya no recibirá nuevas características, correcciones de errores, actualizaciones de seguridad ni soporte técnico; sin embargo, la mensajería y los análisis seguirán funcionando con normalidad. Para obtener más información, consulta Presentación del nuevo SDK Swift de Braze.
Gestionar los clics manualmente
Puedes gestionar manualmente los clics de la tarjeta de contenido implementando el protocolo ABKContentCardsTableViewControllerDelegate y configurando tu objeto delegado como la propiedad delegate de ABKContentCardsTableViewController. Consulta la aplicación de muestra Tarjetas de contenido para ver un ejemplo.
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 sobrescribes el método handleCardClick: en ABKContentCardsTableViewController, es posible que no se llame a estos métodos delegados.
Editar esta página en GitHub