0

我試圖發送POST與郵差火力點,但我有一個錯誤:郵差 - 火力地堡通知IOS

<HTML> 
    <HEAD> 
     <TITLE>Unauthorized</TITLE> 
    </HEAD> 
    <BODY BGCOLOR="#FFFFFF" TEXT="#000000"> 
     <H1>Unauthorized</H1> 
     <H2>Error 401</H2> 
    </BODY> 
</HTML> 

這裏是我的身體和頭部。 對於授權,我不確定,我把我的ios Firebase項目的api服務器密鑰。 我想發送它並在我的設備上顯示通知。

謝謝你的幫助。

HEADER

BODY

當我啓動和Xcode的應用程序,我不fecth APNS但最後:連接到FCM。

<FIRAnalytics/INFO> Firebase Analytics v.3200000 started 
2016-08-25 07:58:06.690 HelloCordova[2426:] <FIRAnalytics/INFO> To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled 
2016-08-25 07:58:06.741 HelloCordova[2426:671139] Firebase Crash Reporting: Successfully enabled 
2016-08-25 07:58:06.754: <FIRInstanceID/WARNING> FIRInstanceID AppDelegate proxy enabled, will swizzle app delegate remote notification handlers. To disable add "FirebaseAppDelegateProxyEnabled" to your Info.plist and set it to NO 
2016-08-25 07:58:06.755: <FIRInstanceID/WARNING> Failed to fetch APNS token Error Domain=com.firebase.iid Code=1001 "(null)" 
2016-08-25 07:58:06.764: <FIRMessaging/INFO> FIRMessaging library version 1.1.0 
2016-08-25 07:58:06.776: <FIRMessaging/WARNING> FIRMessaging AppDelegate proxy enabled, will swizzle app delegate remote notification receiver handlers. Add "FirebaseAppDelegateProxyEnabled" to your Info.plist and set it to NO 
2016-08-25 07:58:06.780 HelloCordova[2426:] <FIRAnalytics/INFO> Successfully created Firebase Analytics App Delegate Proxy automatically. To disable the proxy, set the flag FirebaseAppDelegateProxyEnabled to NO in the Info.plist 
2016-08-25 07:58:07.361: <FIRInstanceID/WARNING> APNS Environment in profile: development 
2016-08-25 07:58:07.574 HelloCordova[2426:671139] Resetting plugins due to page load. 
2016-08-25 07:58:07.796 HelloCordova[2426:] <FIRAnalytics/INFO> Firebase Analytics enabled 
2016-08-25 07:58:07.819 HelloCordova[2426:671139] Connected to FCM. 
2016-08-25 07:58:08.316 HelloCordova[2426:671139] Finished load of: file:///var/containers/Bundle/Application/1DE45D4B-AFB3-4F6D-83D7-71D1A6FE8F44/HelloCordova.app/www/index.html#/connected 
2016-08-25 07:58:10.094 HelloCordova[2426:671139] THREAD WARNING: ['GoogleMaps'] took '472.765137' ms. Plugin should use a background thread. 
2016-08-25 07:58:33.836 HelloCordova[2426:671139] Received memory warning. 
+0

,你可以看到,它沒有給我FCM連接的標誌 – DionysoSong

回答

5

PostmanAuthorization代碼,您需要把格式像key=YOUR_SERVER_KEY

獲取Server Key:轉到Firebase控制檯中的項目設置。 單擊Cloud Messaging並複製該頁面中提到的Server Key

+0

好吧,這是我做的:/也許網址 是錯的 ? – DionysoSong

+0

此外,我測試了這個鏈接,這是好的https://cordova-plugin-fcm.appspot.com/ – DionysoSong

0

使用該行的任何代碼中的何處打印設備令牌

enter image description here

print("Token \(FIRInstanceID.instanceID().token()!)") 

漱口發送推送通知下面的圖像通過郵差

enter image description here