2016-07-28 8 views
2

昨日の半分と今朝の半分は、ボードとGoogle、そしてFirebase Docsを検索して解決しました。ただ明確にします。FireBase iOSメッセージングでAPNSトークンを取得できない

私は、私は、私のappDelegate方法を投稿します私のInfo.plistにNOに設定FirebaseAppDelegateProxyEnabledしているが、私は、ドキュメントに目を通してきた多くの回:

didFinishLaunchingWithOptions:

customizeAppearance() 
    FIRApp.configure() 

    tracker.appLaunch() 

    registerForPushNotifications(application) 
    notificationCenter.addObserver(self, selector: #selector(AppDelegate.tokenRefreshNotification), name: kFIRInstanceIDTokenRefreshNotification, object: nil) 

    return PersistentStoreManager.sharedInstance.managedObjectContextHasBeenInitialized() 

didReceiveRemoteNotification:

//Full message 
    print("%@", userInfo) 


    articleID = "\(userInfo["articleId"]!)" 
    notificationCenter.postNotificationName("newArticle", object: nil) 

registerForPushNotifications:

let notificationSettings = UIUserNotificationSettings(
     forTypes: [.Badge, .Sound, .Alert], categories: nil) 
    application.registerUserNotificationSettings(notificationSettings) 
    application.registerForRemoteNotifications() 

didRegisterForRemoteNotificationsWithDeviceToken:

//send the APNs token to firebase 
    FIRInstanceID.instanceID().setAPNSToken(deviceToken, type: FIRInstanceIDAPNSTokenType.Sandbox) 
    print("In did register For remote Not with token: \(FIRInstanceID.instanceID().token())") 
} 

tokenRefreshNotification:

let refreshedToken = FIRInstanceID.instanceID().token()! 
    //send token information to server 
    self.manager.sendNotificationToken(refreshedToken) 

    //double check to connect to FCM, may have failed when attempted before having a token 
    connectToFcm() 

func application(application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: NSError) { 
    print("Failed to register:", error.description) 
} 

コンソールログ:

WARNING: Firebase Analytics App Delegate Proxy is disabled. To log deep link campaigns manually, call the methods in FIRAnalytics+AppDelegate.h. 
Configuring the default app. 
<FIRAnalytics/INFO> Firebase Analytics v.3201000 started 
<FIRAnalytics/INFO> To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled 
<FIRInstanceID/WARNING> Failed to fetch APNS token Error Domain=com.firebase.iid Code=1001 "The operation couldn’t be completed. (com.firebase.iid error 1001.)" 
<FIRMessaging/INFO> FIRMessaging library version 1.1.0 
[4459:501] <FIRAnalytics/INFO> Firebase Analytics enabled 
CFNetwork SSLHandshake failed (-9806) 
2016-07-28 10:26:08.245: <FIRInstanceID/WARNING> APNS Environment in profile: development 
In did register For remote Not with token: Optional("fWmrxcdNICg:APA91bF_pVwLixBXFuRZEF0w64J7zizSQfpaYNjJhf9g95fZxDmqKD-I1gnaxufkmbNvGZZKs8ifL6ZlXY9nWBc0utgVjEBJG7tUNnA8ciOzeyW9wtfSHyq0IYIf4OepJ4qTJf8qLpIR") 
In did register For remote Not with token: Optional("fWmrxcdNICg:APA91bF_pVwLixBXFuRZEF0w64J7zizSQfpaYNjJhf9g95fZxDmqKD-I1gnaxufkmbNvGZZKs8ifL6ZlXY9nWBc0utgVjEBJG7tUNnA8ciOzeyW9wtfSHyq0IYIf4OepJ4qTJf8qLpIR") 

そして、私はiOSの8.3をターゲットにしてアップしています。開発とプロンプト通知証明書をFirebaseにアップロードしました。私が設定したブレークポイントを持っている

は、私のtokenRefreshNotificationは()と呼ばれませんどちらもありませんdidReceiveRemoteNotification()

私が間違って何が起こっているか分からない、と私はアプリストアにアプリケーションを送信すると仮定しています月曜。私は昨日ほとんどの日に通知を受け取り、その後停止しました。私はFirebaseコンソールやWebサービスサーバーからそれらを取得しません。

答えて

3

OK問題が見つかりました。他の人がこの問題にぶつかり、ソリューションを投稿したかったのです。コード署名のアイデンティティとプロビジョニングプロファイルを確認してください。私は昨日どのように変更されたのか分かりませんが、これらのコード署名設定を修正するたびにプッシュ通知が大きくなってしまいました。

関連する問題