J'utilise le cadre de PushKit, en ajoutant le code dans didFinishLaunchingWithOptionsHandker PushKit lorsque nous recevons une notification?
let voipRegistry: PKPushRegistry = PKPushRegistry(queue: dispatch_get_main_queue())
voipRegistry.delegate = self
voipRegistry.desiredPushTypes = NSSet(object: PKPushTypeVoIP) as! Set<NSObject>
// Enregistrement du jeton
func pushRegistry(registry: PKPushRegistry!, didUpdatePushCredentials credentials: PKPushCredentials!, forType type: String!) {
}
// réception de la notification
func pushRegistry(registry: PKPushRegistry!, didReceiveIncomingPushWithPayload payload: PKPushPayload!, forType type: String!) {
let content = payload.dictionaryPayload["aps"] as? Dictionary<String,String>
let message = content!["alert"]
let notification = UILocalNotification()
notification.alertTitle = "Hifi"
notification.alertBody = message
notification.alertLaunchImage = "logo_white.png"
notification.soundName = "Glass.caf"
UIApplication.sharedApplication().presentLocalNotificationNow(notification)
}
i ont implémété comme ça mais pas reçu g notification Comment gérer la notification dans la méthode de délégation didReceiveIncomingPushWithPayload?