问题标签 [xamarin.essentials]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
0 回答
441 浏览

xamarin - Xamarin Essentials 是否有自己的生物识别实施?

我正在尝试最大程度地使用 xamarin Essentials,但我不想使用我拥有的指纹插件,xamarin Essentials 是否有不使用插件的指纹认证实现?

0 投票
1 回答
352 浏览

xamarin.forms - Xamarin Forms Essentials 首选项

根据Xamarin Essentials Preferences 上的文档。我了解当应用程序未安装时,偏好设置将被删除。

持久性

卸载应用程序将导致删除所有首选项。有一个例外,适用于以 Android 6.0(API 级别 23)或更高版本为目标并使用自动备份的应用程序。此功能默认启用并保留应用程序数据,包括共享首选项,这是首选项 API 所使用的。

我的问题是,当应用程序在 iOS 或 Andriod 上更新时,是否考虑卸载并重新安装并且偏好被删除?还是只是安装而没有任何内容被删除?

0 投票
1 回答
272 浏览

xamarin - xamarin 表单属性/首选项最大推荐字符串长度

在 properties/xamarin.essentials 首选项的文档中,他们提到不存储“大文本”。我想知道什么被认为是“大文本”。我想知道序列化为 json 的类有多大是安全/高性能的。

0 投票
4 回答
6367 浏览

xamarin - Xamarin Essentials 权限未能授予权限

我目前正在编写一个需要使用相机的 Xamarin Forms 应用程序,在下面的代码中,我使用 Xamarin Essentials Permissions 请求权限,该权限返回为“Granted”;紧接着我要求使用相机拍照,这会引发以下错误。

ex = {Plugin.Media.Abstractions.MediaPermissionException:需要相机权限。

权限代码

照片管理器代码

如前所述,GetPermission 方法返回 true,但仍然抛出错误。

我目前正在Android上运行它。我的 AndroidManifest.xml 中有这些权限。

我现在制作了一个示例项目来展示我的问题 GitHub Repo for the issue

0 投票
0 回答
55 浏览

c# - “仅链接 SDK 框架”链接器选项导致 iOS 中的编译错误

我在我的项目中使用 Xamarin.Essentials。如果我将链接器选项设置为“仅链接 SDK 框架”,则会收到以下错误。

如果链接器选项是“不链接”它编译没有错误。我可以知道如何解决错误,因为“不链接”链接器选项会大大增加应用程序的大小。

0 投票
1 回答
1265 浏览

xamarin.forms - Xamarin Plugin.Permission。请求权限时出错

我正在尝试使用Plugin.Permissions和 Xamarin.Forms授予我的 android 应用程序的权限

我正在关注提供的示例,但出现以下错误:

这是我的主要活动:

我正在从 MainPage.xaml.cs 请求单击按钮的权限:

Plugin.Permissions 和 Xamarin.Essentials 版本是最新的。我做错了什么?

提前致谢

更新 AndroidManifest.xml:

更新 2

我也有应用程序类:

Xamarin 版本:16.5

Xamarin.Android SDK:10.2

核桃:

Xamarin.Forms:4.4

Xamarin.Essentials:1.5.2

0 投票
1 回答
617 浏览

xaml - 在 Xamarin 中添加自定义字体

根据这篇文章:https ://devblogs.microsoft.com/xamarin/embedded-fonts-xamarin-forms/

添加自定义字体的新方法是将字体添加为 EmbeddedResource,然后在 App.xaml.ca 中添加以下行:

但我得到这个错误:

我的项目参考:

  • Xamarin.Essentials (1.3.1)
  • Xamarin.Forms (4.4.0.991265) - 4.5
  • 网络标准库 (2.0.3)
0 投票
3 回答
1898 浏览

xamarin.forms - 如何使用 Xamarin.Essentials Launcher 将 Android 设置应用程序启动到您的应用程序设置?

我正在使用 Xamarin.Forms 和 Xamarin.Essentials 开发适用于 Android 和 iOS 的应用程序。我希望能够在我的应用程序中提供一个按钮,将用户带到设备的“设置”应用程序,然后进入我正在处理的这个应用程序的特定设置页面。

以前,这是使用依赖服务调用特定于平台的代码来完成的。我相信使用 Xamarin.Essentials Launcher(此处为 Microsoft 文档)可以更简单地完成此操作,并且无需任何特定于平台的代码。我已经想出了如何在 iOS 上做到这一点:

但是,我无法发现如何在 Android 上执行此操作。如果有任何不清楚的地方,请告诉我。否则,感谢任何帮助......非常感谢!

0 投票
2 回答
2075 浏览

android - 不在 UI 线程上时如何请求权限?

我目前正在使用最新版本的 Xamarin.Forms (4.5.0.617) 和 Xamarin.Essentials (1.5.2)。

我有一个依赖注入服务,它负责访问电话联系人,它实际上是 Xamarin.Essentials 权限代码的包装器。我需要保证代码在 UI 线程上执行以避免异常。我已经了解了下面的代码,但是,它并没有像我预期的那样工作。在我的应用程序中,权限弹出窗口出现并为我提供了允许/拒绝选项,但是 RequestAsync 之后的所有代码都无法执行,就像从未正式返回响应一样。下次我运行该应用程序时,它会立即运行(因此推测后台的权限已正确记录)。

我不确定我尝试将代码强制到 UI 线程上的方式是否引起了问题,或者我是否错误地使用了异步代码......或者(最不可能)它是否是一个错误Xamarin.Essentials 权限代码。我目前只在 Android 上看到过这种行为,但我还没有在其他任何人上测试过。

非常感谢任何帮助:)

谢谢!

0 投票
1 回答
1428 浏览

ios - Can't make Apple Sign In work with Xamarin.Essentials

I know this might not be the best question, not much information, but I will try.

I'm trying to add Apple Sign In to Xamarin.Forms app using Xamarin.Essentials. As of now, I'm just trying to make it work on iOS 13, without going any further yet, server side is not required as I understand for this limited scope.

I looked into the sample app for Xamarin.Essentials, and came to conclusion that specifically for iOS 13 it would be enough to call

However, I got an exception "com.apple.AuthenticationServices.AuthorizationError error 1000". Couldn't fine more details.

Then I took Xamarin.Essentials sample app, changed Bundle Id to what I have in my app, and then it worked. This validated that certificates and App store were configured correctly.

I tried to get Xamarin.Essentials from GitHub and debug through the library, the exception is in AppleSignInAuthenticator.ios.cs in "PlatformAuthenticateAsync", at the line

Update: In entitlements.plist I added

Any help or advise is appreciated.