I ran into a problem with FCM Report 501
When I started the FCM, I did not encounter any problems. APNS also works. Below is the FCM Log:
4.9.0 - [Firebase/Crash][I-CRA000004] Successfully initialized
4.9.0 - [Firebase/Messaging][I-FCM001000] FIRMessaging Remote Notifi cations proxy enabled, will swizzle remote notification receiver handlers. If you'd prefer to manually integrate Firebase Messaging, add "FirebaseAppDelegateProxyEnabled" to your Info.plist, and set it to NO. Follow the instructions at: https://firebase.google.com/docs/cloud-messaging/ios/client#method_swizzling_in_firebase_messaging to ensure proper integration.
4.9.0 - [Firebase/Analytics][I-ACS023007] Firebase Analytics v.40009000 started
4.9.0 - [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see http://goo.gl/RfcP7r)
But when I send a message: https://user-images.githubusercontent.com/13215544/36961999-b3bd93c2-2088-11e8-8769-956c6ad8d7ba.png
https://user-images.githubusercontent.com/13215544/36962049-e3d60710-2088-11e8-93e8-f4b70343eb11.png
https://user-images.githubusercontent.com/13215544/36962538-f7787c38-208a-11e8-99ac-0dd6af82e62c.png
Can you help me?

What are the parameters of the sendMessage method call?
These are the above
messageID should be a unique string (you can just use [NSUUID UUID].uuidString). Does this fix the issue?
No, I've tried it.
Can you add the -FIRDebugEnabled argument to your app on launch and post the logs again? There should be a more complete error message printed to console after the NSError is returned.

This is a different error than last time and is a generic network error that occurs when the Firebase Messaging endpoints are unreachable. Are you using a proxy?
Firebase SDK version used : 4.9.0
Problem Description:
- I started the application, FCM initialization no problem.
- In iOS I need to wait a long time to connect socket service. Android phones do not it. We're on the same WiFi.
- More than 95% of my FCM socket service will fail to connect.
- I use the APNS delivery message, I can always receive.
- Most of the messages I send using the sendmessage API get the error "Error =" Error Domain = com.google.fcm Code = 501 ".
What network conditions are your device running on? Are you able to send data messages on Android?
The slow socket/connection failures seems like a bug.
Android has no problem sending messages, their FCM socket connection is very fast
We are using a WiFi network, but we are in China, so our network access to Google requires a VPN service.
This seems like a bug in Firebase then. I am not sure when the fix will be released.
What purpose are you using FCM data messages for?
It is used to pass some messages. When the user does not open the push, you can use this to pass the station letter.
@ZhengXueNing Please file a bug at https://firebase.google.com/support/contact/bugs-features/?hl=zh-cn with the logs around the slow socket connection on iOS and any other debugging information.
I have sent an error report. I have sent details of my side and example projects, but the engineer did not give me the reasons for this problem.
@ZhengXueNing what's the case ID for your support ticket?
I have the same problem, not working on iOS, just in Android, same Wi-fi and I'm not in China
If your error is a 501 error, please file a support ticket. It's likely a backend bug. Nothing you do on the client should result in a 501 error.