xamarin.forms - Xamarin Forms,Onedrive 在 iOS 上不工作,但在 Android 和 UWP 上工作
问题描述
我希望有人可以帮助我设置从 Xamarin Forms 应用程序连接到 OneDrive。我知道有很多可以找到的例子,但这些似乎已经过时了。他们都不再工作了。
因此,我尝试了适用于 UWP 和 Android 但不适用于 iOS 的 Xamarin.OneDrive。
我在 iOS 上采取的步骤:
Added 'com.microsoft.adalcache' to the keychain group in Entitlements.plist
Added the following code in appdelegate.cs
public override bool OpenUrl(UIApplication app, NSUrl url, NSDictionary options)
{
Xamarin.OneDrive.Connector.SetAuthenticationContinuationEventArgs(url);
return true;
}
Added the following to plist.info with the correct Bundlename and Appid
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string><BUNDLENAME></string>
<key>CFBundleURLSchemes</key>
<array>
<string><APPID></string>
</array>
</dict>
</array>
Under iOS Bundle Signing I selected Manual Provisioning and selected Entitlements.plist in Custom Entitlements
在模拟器或物理设备上运行应用程序会导致显示以下错误:
System.Exception: Internal Server Error
System.ArgumentNullException: Value cannot be null.
Parameter name: viewController
at Microsoft.Identity.Client.AcquireTokenInteractiveParameterBuilder.WithParentActivityOrWindow (UIKit.UIViewController viewController) [0x00003] in :0
at Xamarin.OneDrive.DependencyImplementation.GetAuthResult (Microsoft.Identity.Client.IPublicClientApplication client, Xamarin.OneDrive.Configs configs) [0x00093] in <702bbb93f52d451c89c8adacbd52d653>:0
at Xamarin.OneDrive.Token.AcquireAsync () [0x00091] in <702bbb93f52d451c89c8adacbd52d653>:0
at Xamarin.OneDrive.Token.ConnectAsync () [0x000f0] in <702bbb93f52d451c89c8adacbd52d653>:0
at Xamarin.OneDrive.ConnectorHandler.InnerConnectionHandlerAsync (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) [0x00161] in <702bbb93f52d451c89c8adacbd52d653>:0
我不知道如何继续。
有人能告诉我如何让它在 iOS 上运行吗?
提前致谢 !
解决方案
推荐阅读
- html - 当数组中只有一个元素时不会触发更改事件
- javascript - 使用制表符 (HTML) 遍历子项
- batch-file - 每次按 Enter 时执行命令,直到我按一个键批量退出
- python - 在 Keras 模型中重塑编码器解码器
- php - php base_convert 不适用于非整数?
- jquery - 我无法从 ajax 调用中输出 json
- python-3.x - 如何修复“无法分配请求的地址”。甚至我在mac上用python尝试了许多不同的端口
- python - 执行 rnn 模型时出错。如何解决?
- css - 如何在wordpress中weglot插件的下拉菜单中获得圆形边框?
- git - 如何签出所有修改过的文件?