Last active
June 14, 2017 08:18
-
-
Save HalitGumus/6e7709088d013b0852b45c753b890085 to your computer and use it in GitHub Desktop.
AppDelegate.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
import UserNotifications | |
var deviceTokenID = "" | |
var deviceInfo = "" | |
var vakaNotifications = 0 | |
var IdT = "" | |
@uiapplicationmain | |
class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterDelegate { | |
var window: UIWindow? | |
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { | |
// Override point for customization after application | |
UIApplication.shared.registerForRemoteNotifications() | |
let center = UNUserNotificationCenter.current() | |
center.delegate = self | |
center.requestAuthorization(options: [.alert, .sound, .badge]) { | |
(granted, error) in | |
if granted { | |
} | |
} | |
return true | |
} | |
func userNotificationCenter(_ center: UNUserNotificationCenter, | |
willPresent: UNNotification, | |
withCompletionHandler: @escaping (UNNotificationPresentationOptions)->()) { | |
print("willPresent") | |
withCompletionHandler([.alert, .sound, .badge]) | |
} | |
func userNotificationCenter(_ center: UNUserNotificationCenter, | |
didReceive: UNNotificationResponse, | |
withCompletionHandler: @escaping ()->()) { | |
print("didReceive") | |
withCompletionHandler() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
{'aps' : {'alert' : { 'title' : 'Bildirim','subtitle' : 'AA', 'body' : 'Message' , 'IdT' : 'a'},'badge':1,'sound':'default', 'mutable-content' : 1 },'content-available':1, 'my-attachment' : 'http://***.png'}