Unable to connect with FCM. Optional(Error Domain=com.google.fcm Code=501
2016-10-19 02:38
751 查看
Solution: open push notification and in backgroud mode open remote notification in Xcode 8
iOS 9.3
// [START connect_to_fcm]
func connectToFcm() {
//FIRMessaging.messaging().connect { (error) in
FIRMessaging.messaging().connectWithCompletion { (error) in
if (error != nil) {
print(“Unable to connect with FCM. (error)”)
} else {
print(“Connected to FCM.”)
}
}
func applicationDidBecomeActive(application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
iOS 9.3
// [START connect_to_fcm]
func connectToFcm() {
//FIRMessaging.messaging().connect { (error) in
FIRMessaging.messaging().connectWithCompletion { (error) in
if (error != nil) {
print(“Unable to connect with FCM. (error)”)
} else {
print(“Connected to FCM.”)
}
}
} // [END connect_to_fcm]
func applicationDidBecomeActive(application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
connectToFcm() //add by Kevin }
相关文章推荐
- 下载android代码过程中,提示以下错误: error: Failed connect to android.googlesource.com:443;
- 记一次错误:Error:Conflict with dependency 'com.google.code.findbugs:jsr305' in project ':app'.错误!
- 解决:Unable to connect to repository https://dl-ssl.google.com/android/eclipse/site.xml
- Error:Conflict with dependency 'com.google.code.findbugs:jsr305' in project ':app':报错解决
- Error:Conflict with dependency 'com.google.code.findbugs:jsr305'
- Android SDK Manager: Unable to connect to repository https://dl-ssl.google.com/android/eclipse/site
- Error:Conflict with dependency 'com.google.code.findbugs:jsr305'
- 内置付费 inapp purchase and Error Domain=SKErrorDomain Code=0 “Cannot connect to iTunes Store”错误
- 解决:Unable to connect to repository https://dl-ssl.google.com/android/eclipse/site.xml
- Error Domain=ASIHTTPRequestErrorDomain Code=5 "Unable to create request (bad url?)" UserInfo=0x15f86
- android studio 首次进入问题 Internal error. Please report to https://code.google.com/p/android/issues
- unable to connect ip driver error code 2 解决方法
- AndroidStudio报错:Error:Conflict with dependency 'com.google.code.findbugs:jsr305'
- 设置git代理:转:解决Unknown SSL protocol error in connection to code.google.com:443
- github|fatal:unable to access|OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com 443
- unable to connect ip driver error code 2的解决方法
- Error:Conflict with dependency 'com.google.code.findbugs:jsr305'解决
- 解决:Unable to connect to repository https://dl-ssl.google.com/android/eclipse/site.xml
- Error:Conflict with dependency 'com.google.code.findbugs:jsr305' in project
- Error:Conflict with dependency 'com.google.code.findbugs:jsr305' in project '