Para habilitar las notificaciones push en su aplicación iOS, agregue el siguiente código (o una variante de él) dentro de la función de su aplicación AppDelegate. Los ejemplos de código siguientes utilizan Swift 3.1. Por favor, modifíquelos a sus necesidades si está usando C#.
// Somehow determine the user email. If you have user accounts, it may be better to move
// this outside of the `application` func of `AppDelegate` in order to determine the user email.
// In this ejemplo, the address is hardcoded for ease of use.
let userEmail = “you@dominio.com”
OneSignal.initWithLaunchOptions(launchOptions, appId: “YOUR-ONE-SIGNAL-APP-ID”)
OneSignal.syncHashedEmail(userEmail);
OneSignal.idsAvailable({(_ userId, _ pushToken) in
let pushId = userId != nil ? userId : “”
let pushEnabled = pushToken != nil ? true : false
let userData = UserData(email: userEmail, push_id: pushId!, enabled: pushEnabled)
self.pushUserDataToMautic(userData, “https://dev.mautic.com/notification/appcallback”)
});
Para facilitar su uso, he creado la siguiente estructura y función para enviar datos de usuario a TecnoMatic. Cree esta estructura en su aplicación, e impórtela cuando sea apropiado.