Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Firebase名称:com.Firebase.core原因:配置失败。这可能是由无效的谷歌应用程序ID引起的_Firebase_Xamarin_Xamarin.ios - Fatal编程技术网

Firebase名称:com.Firebase.core原因:配置失败。这可能是由无效的谷歌应用程序ID引起的

Firebase名称:com.Firebase.core原因:配置失败。这可能是由无效的谷歌应用程序ID引起的,firebase,xamarin,xamarin.ios,Firebase,Xamarin,Xamarin.ios,调用Firebase.Core.App.Configure(),如处的“使用Firebase入门”指令集所示 结果错误如下所示。我已经看到了其他的答案,但它们似乎特别适用于cordova和GoogleServices-Info.plist被破坏或未复制到特定文件夹 错误 名称:com.firebase.core原因:配置失败。它可能是由 由GoogleService-Info.plist中的无效GOOGLE_APP_ID或 自定义选项 调用Firebase.Core.App.Configure

调用Firebase.Core.App.Configure(),如处的“使用Firebase入门”指令集所示 结果错误如下所示。我已经看到了其他的答案,但它们似乎特别适用于cordova和GoogleServices-Info.plist被破坏或未复制到特定文件夹

错误

名称:com.firebase.core原因:配置失败。它可能是由 由GoogleService-Info.plist中的无效GOOGLE_APP_ID或 自定义选项

调用Firebase.Core.App.Configure()时出错

private void RegisterForPushNotifications()
{
if(UIDevice.CurrentDevice.CheckSystemVersion(10,0))
{
//iOS 10
var authOptions=未授权选项。警报|未授权选项。徽章|未授权选项。声音;
UnuseNotificationCenter.Current.RequestAuthorization(authOptions,(已授予,错误)=>
{
控制台写入线(已授予);
});
//对于iOS 10显示通知(通过APNS发送)
UNUserNotificationCenter.Current.Delegate=此;
}
其他的
{
//iOS 9
{
var newToken=Firebase.InstanceID.InstanceID.SharedInstance.Token;
//如果要按用户发送通知,请使用此令牌
//TODO需要WS调用将此令牌存储在用户表中
系统.诊断.调试.写线(newToken);
connectFCM();
});
}

从firebase控制台下载GoogleService-Info.plist时,提供的配置中确实缺少一个GOOGLE\u APP\u ID字段。查看此处的示例后

我添加了缺少的属性,Firebase.Core.App.Configure()调用工作正常