iOS Firebase-无法获取默认令牌错误域=com.Firebase.iid代码=501

iOS Firebase-无法获取默认令牌错误域=com.Firebase.iid代码=501,ios,xcode,firebase,cocoapods,firebase-cloud-messaging,Ios,Xcode,Firebase,Cocoapods,Firebase Cloud Messaging,我正在尝试将Firebase集成到我的应用程序中。我使用的是xcode7.3和cocoapods1.0.1。我创建了一个APNS开发推送证书,并将p12文件上载到我的Firebase项目。我下载了GoogleService-Info.plist并将其添加到我的项目根目录中。然后,我按照此处的说明设置推送通知() 我正在使用以下库版本:Firebase 3.6.0、FirebaseInstanceID 1.0.8、FirebaseMessaging 1.2.0 在设备上测试时,点击“didRegi

我正在尝试将Firebase集成到我的应用程序中。我使用的是xcode7.3和cocoapods1.0.1。我创建了一个APNS开发推送证书,并将p12文件上载到我的Firebase项目。我下载了GoogleService-Info.plist并将其添加到我的项目根目录中。然后,我按照此处的说明设置推送通知()

我正在使用以下库版本:Firebase 3.6.0、FirebaseInstanceID 1.0.8、FirebaseMessaging 1.2.0

在设备上测试时,点击“didRegisterForRemoteNotificationsWithDeviceToken”,我获得了有效的设备令牌,但我无法成功检索FCM注册令牌

我已经为此挣扎了几天,但没有取得任何进展。下面是相关的代码片段和控制台日志错误

- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
NSString *devToken = [[[[deviceToken description]
                        stringByReplacingOccurrencesOfString:@"<"withString:@""]
                       stringByReplacingOccurrencesOfString:@">" withString:@""]
                      stringByReplacingOccurrencesOfString: @" " withString: @""];

NSLog(@"didRegisterForRemoteNotificationsWithDeviceToken with token: %@", devToken);

[[FIRInstanceID instanceID] setAPNSToken:deviceToken type:FIRInstanceIDAPNSTokenTypeSandbox];
}


2016-10-19 10:23:09.523: <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-10-19 10:23:09.872: <FIRInstanceID/WARNING> APNS Environment in profile: development
2016-10-19 10:23:11.761: <FIRInstanceID/WARNING> Failed to fetch default token Error Domain=com.firebase.iid Code=501 "The operation couldn’t be completed. (com.firebase.iid error 501.)"
2016-10-19 10:23:25.759: <FIRInstanceID/WARNING> Failed to fetch default token Error Domain=com.firebase.iid Code=501 "The operation couldn’t be completed. (com.firebase.iid error 501.)"
2016-10-19 10:23:54.365: <FIRInstanceID/WARNING> Failed to fetch default token Error Domain=com.firebase.iid Code=501 "The operation couldn’t be completed. (com.firebase.iid error 501.)"
2016-10-19 10:24:38.482: <FIRInstanceID/WARNING> Failed to fetch default token Error Domain=com.firebase.iid Code=501 "The operation couldn’t be completed. (com.firebase.iid error 501.)"
2016-10-19 10:25:42.257: <FIRInstanceID/WARNING> Failed to fetch default token Error Domain=com.firebase.iid Code=501 "The operation couldn’t be completed. (com.firebase.iid error 501.)"
2016-10-19 10:25:42.257: <FIRInstanceID/WARNING> Failed to retrieve the default GCM token after 5 retries
-(void)应用程序:(UIApplication*)应用程序DIDregisterforRemotionTificationswithDeviceToken:(NSData*)deviceToken{
NSString*devToken=[[[deviceToken描述]
StringByReplacingOfString:@“with String:@”]
StringByReplacingOfString:@“和字符串:@]”发生;
NSLog(@“didRegisterForRemoteNotificationsWithDeviceToken with token:%@”,devToken);
[[FIRInstanceID instanceID]setAPNSToken:deviceToken类型:FirInstanceIdInstanceInstancePentyPesandbox];
}
2016-10-19 10:23:09.523:启用FIRMessaging AppDelegate代理,将关闭应用程序代理远程通知接收器处理程序。将“FirebaseAppDelegateProxyEnabled”添加到您的Info.plist并将其设置为否
2016-10-19 10:23:09.872:APNS环境概况:发展
2016-10-19 10:23:11.761:无法获取默认令牌错误域=com.firebase.iid Code=501“操作无法完成。(com.firebase.iid错误501)”
2016-10-19 10:23:25.759:无法获取默认令牌错误域=com.firebase.iid Code=501“操作无法完成。(com.firebase.iid错误501)”
2016-10-19 10:23:54.365:无法获取默认令牌错误域=com.firebase.iid Code=501“操作无法完成。(com.firebase.iid错误501)”
2016-10-19 10:24:38.482:无法获取默认令牌错误域=com.firebase.iid Code=501“操作无法完成。(com.firebase.iid错误501)”
2016-10-19 10:25:42.257:无法获取默认令牌错误域=com.firebase.iid Code=501“操作无法完成。(com.firebase.iid错误501)”
2016-10-19 10:25:42.257:重试5次后检索默认GCM令牌失败

Firebase应用程序安装时是否可以添加代码段?