Hallo Ich mache eine iPhone-App, wo ich Push-Benachrichtigungen über Google Firebase senden. Ich verwende Swift und Xcode für die Programmierung. Wenn ich die App öffne, werde ich aufgefordert, Push-Benachrichtigungen zuzulassen, erhalte jedoch keine, wenn ich sie von der Firebase-Konsole aus sende. Ich habe mich gefragt, ob du mir helfen kannst. Ich benutze Ad-hoc-Export, um eine .isa auf das iPhone meines Freundes zu übertragen und so zu testen. Ich folgte genau dem Firebase-Tutorial - fügte die .plist, den Kakao-Pod hinzu und ich habe ein Zertifikat in die Projekteinstellungen hochgeladen. Ich habe ein bezahltes Apple Entwicklerkonto.iOS-Push-Benachrichtigung über Firebase funktioniert nicht
import UIKit
import CoreData
import Firebase
import FirebaseMessaging
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
FIRApp.configure()
let notificationTypes: UIUserNotificationType = [UIUserNotificationType.Alert,UIUserNotificationType.Badge,UIUserNotificationType.Sound]
let notificationSettings = UIUserNotificationSettings(forTypes:notificationTypes, categories:nil)
application.registerForRemoteNotifications()
application.registerUserNotificationSettings(notificationSettings)
return true
}
func applicationWillResignActive(application: UIApplication) {
}
func applicationDidEnterBackground(application: UIApplication) {
}
func applicationWillEnterForeground(application: UIApplication) {
}
func applicationDidBecomeActive(application: UIApplication) {
}
func applicationWillTerminate(application: UIApplication) {
}
func application(application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject],
fetchCompletionHandler completionHandler: (UIBackgroundFetchResult) -> Void) {
print("MessageID : \(userInfo["gcm_message_id"]!)")
print("%@", userInfo)
}
}
werden alle diese http://shubhank101.github.io/iOSAndroidChaosOverFlow/2016/07/Push-Notification-in-iOS-using-FCM-(Swift) – Shubhank