Swift 敏捷的当屏幕不在后台时,在接收远程通知时创建横幅
下面是我收到通知时的代码。我知道我可以使用PFPush创建警报,但我觉得这不是一个好方法。有没有办法创建横幅而不是警报Swift 敏捷的当屏幕不在后台时,在接收远程通知时创建横幅,swift,background,notifications,banner,Swift,Background,Notifications,Banner,下面是我收到通知时的代码。我知道我可以使用PFPush创建警报,但我觉得这不是一个好方法。有没有办法创建横幅而不是警报 func application(application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject], fetchCompletionHandler completionHandler: (UIBackgroundFetchResult) -> Void)
func application(application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject], fetchCompletionHandler completionHandler: (UIBackgroundFetchResult) -> Void) {
NSNotificationCenter.defaultCenter().postNotificationName("getMessage", object: nil)
if application.applicationState == UIApplicationState.Active {
//PFPush.handlePush(userInfo)
}
completionHandler(UIBackgroundFetchResult.NewData)
}