应用无法使用 Xamarin iOS Facebook SDK 启动
App won't start with Xamarin iOS Facebook SDK
我不知道出了什么问题。我只想集成 Facebook iOS SDK from Xamarin 并调用 'ActivateApp' 事件,这样我就可以看到有多少用户使用我的广告从 Facebook 应用程序打开了该应用程序。
我创建了一个空白的 Xamarin.Forms 应用程序,从组件商店添加了组件并修改了我的 AppDelegate class:
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
Settings.AppID = "<myFacebookId>";
global::Xamarin.Forms.Forms.Init();
LoadApplication(new App());
return base.FinishedLaunching(app, options);
}
我知道我还需要更新 Info.plist 文件并做一些更多的事情。但这里的特殊之处在于,通过上述步骤,应用程序无法在我的设备上启动(配置:调试 | iPhone,链接器已禁用,sdk 版本 9.2,部署目标 7.1)但在我的模拟器上它运行良好。
在设备上,闪屏只显示半秒钟,然后就崩溃了,没有任何反馈。
下次我的大脑会爆炸。任何帮助表示赞赏。谢谢
感谢 Xamarin 的支持,我的问题有了解决方案。
来自支持的回答:
It looks like the issue you are hitting is related to App Transport
Security, so you’ll need to whitelist a couple things by editing your
plist to fix the crash on device. You can read more about how to do
this in the Facebook developer guide, “Preparing Your Apps for iOS
9”:
Basically, what you’ll do is this:
- Double-click info.plist and go to Source tab
- Add Custom Property “LSApplicationQueriesSchemes”, type “Array”
- Add Strings with the following values: fbapi, fb-messenger-api, fbauth2, fbshareextension
有点尴尬……正如我在问题中给你写的那样,我知道还有更多事情要做(比如编辑 plist 文件)。但不幸的是,我显然在我的 plist 文件中输入了错误的值。
我不知道出了什么问题。我只想集成 Facebook iOS SDK from Xamarin 并调用 'ActivateApp' 事件,这样我就可以看到有多少用户使用我的广告从 Facebook 应用程序打开了该应用程序。
我创建了一个空白的 Xamarin.Forms 应用程序,从组件商店添加了组件并修改了我的 AppDelegate class:
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
Settings.AppID = "<myFacebookId>";
global::Xamarin.Forms.Forms.Init();
LoadApplication(new App());
return base.FinishedLaunching(app, options);
}
我知道我还需要更新 Info.plist 文件并做一些更多的事情。但这里的特殊之处在于,通过上述步骤,应用程序无法在我的设备上启动(配置:调试 | iPhone,链接器已禁用,sdk 版本 9.2,部署目标 7.1)但在我的模拟器上它运行良好。
在设备上,闪屏只显示半秒钟,然后就崩溃了,没有任何反馈。
下次我的大脑会爆炸。任何帮助表示赞赏。谢谢
感谢 Xamarin 的支持,我的问题有了解决方案。
来自支持的回答:
It looks like the issue you are hitting is related to App Transport Security, so you’ll need to whitelist a couple things by editing your plist to fix the crash on device. You can read more about how to do this in the Facebook developer guide, “Preparing Your Apps for iOS 9”:
Basically, what you’ll do is this:
- Double-click info.plist and go to Source tab
- Add Custom Property “LSApplicationQueriesSchemes”, type “Array”
- Add Strings with the following values: fbapi, fb-messenger-api, fbauth2, fbshareextension
有点尴尬……正如我在问题中给你写的那样,我知道还有更多事情要做(比如编辑 plist 文件)。但不幸的是,我显然在我的 plist 文件中输入了错误的值。