Questions tagged [xamarin.essentials]

A cross-platform .net library that goes with Xamarin and Xamarin Forms to provide device specific API such as GPS, Media, etc

195 questions
12
votes
2 answers

Xamarin essentials geolocation is not working, GetLocationAsync breaks out of try

So I want to get the users location and reverse geocode it to get the address plus street number. Therefore I installed the package Xamarin.Essentials which is in pre-release. I wanted to use the geolocation and geocoding API so I wrote some code,…
Sjoerd Pottuit
  • 2,307
  • 4
  • 20
  • 35
6
votes
4 answers

Xamarin.Essentials.NotImplementedInReferenceAssemblyException thrown when Unit Testing Xamarin.Forms app

I am running Unit Tests for my Xamarin.Forms application, and the Unit Tests throw Xamarin.Essentials.NotImplementedInReferenceAssemblyException: I have created a Unit Test project for the app (using NUnit 3.12.0) and have written the below code to…
Sahil Khanna
  • 4,262
  • 8
  • 47
  • 72
5
votes
2 answers

How to detect device is big or small in xamarin forms

How do you detect if a device is small or big? I dont need to detect if is a tablet or not. This concept was taken from https://devblogs.microsoft.com/xamarin/styling-for-multiple-device-resolutions/ We use the method below and load the appropriate…
developer9969
  • 4,628
  • 6
  • 40
  • 88
5
votes
2 answers

How do i request permissions when not on the UI thread?

I'm currently using the latest version of Xamarin.Forms (4.5.0.617) and Xamarin.Essentials (1.5.2). I have a dependency injected service which is responsible for getting access to phone contacts, it's effectively a wrapper around the…
Brooky
  • 138
  • 1
  • 7
4
votes
2 answers

Check if device has camera in cross platform way

I am writing a cross platform Xamarin.Forms Application where my app uses camera and requests camera permissions from the user at runtime. I am using Xamarin.Essentials nuget package to check and request permissions. But before I request camera…
zafar
  • 1,965
  • 1
  • 15
  • 14
4
votes
1 answer

Is it possible to create unit tests for functions that use Xamarin.Essentials: Geolocation API?

In my Locationer class I have function GetLocationAsync() which uses Xamarin.Essentials: Geolocation. This function works fine but I would like to create unit test for this function. I created xUnitTests project and unit test: public async Task…
Mateusz Piwowarski
  • 559
  • 1
  • 6
  • 15
3
votes
0 answers

Xamarin Essentials WebAuthenticator.AuthenticateAsync method doesn't return any result

I have added a WebAuthenticator.AuthenticateAsync method in my xamarin forms app with start up Url as "https://accounts.google.com/o/oauth2/auth" and call back url as "myapp://" I have also tried with call back url as…
3
votes
0 answers

.NET MAUI Essentials Authenticator error in UWP missing AppManifest.xml

i'm trying to implement authentication with Essentials API in a .NET MAUI project async Task OnAuthenticate(string scheme) { try { WebAuthenticatorResult r = null; if (scheme.Equals("Apple") …
3
votes
3 answers

Xamarin Forms - How to check setting of RequestIgnoreBatteryOptimizations permission on Android

(See UPDATE below) I have a Xamarin Forms app on Android which uses the Xamarin.Essentials library. The app requires to run in the background to be fed location data (not particularly relevant to the question in hand, but included for context), and…
user2209634
  • 529
  • 7
  • 27
3
votes
2 answers

WebAuthenticator -> You must subclass the WebAuthenticatorCallbackActivity and create an IntentFilter for it which matches your callbackUrl

Expected Behavior : app should open website for login Actual Behavior : error encountered You must subclass the WebAuthenticatorCallbackActivity and create an IntentFilter for it which matches your callbackUrl. Screenshots : Error Subclass
3
votes
0 answers

Is there any way to call Xamarin.Essentials.WebAuthenticator.AuthenticateAsync with Ephemeral Browser (clean new session)?

I am trying to use Xamarin.Essentials for authentication with Google or Microsoft. However, the issue is that they use a "regular" browser mode. So, for example, if I have something cached in my cookies on the mobile device, and I have signed in…
Agat
  • 4,577
  • 2
  • 34
  • 62
3
votes
4 answers

Xamarin Essentials Permissions failing to grant permission

I'm currently writing a Xamarin Forms app which requires use of the camera, in the code below I am requesting the permission using the Xamarin Essentials Permissions which comes back as "Granted"; immediately following that I am requesting use of…
3
votes
1 answer

Changing target framework on Xamarin.forms app from Android 8.1 to Android 9 (for Xamarin.Essentials)

I created a Xamarin.Forms app using the project template from Visual Studio 2019. The project created targets Android 8.1 (Oreo). Since I wish to use the SecureStorage feature of Xamarin.Essentials, I have to set the target framework to Android…
Nicke Manarin
  • 3,026
  • 4
  • 37
  • 79
3
votes
1 answer

Geolocation.GetLastKnownLocationAsync() sometimes returns null

This is on iOS 12.1.4 on an iPhone 6s. Usually Geolocation.GetLastKnownLocationAsync() works but sometimes it doesn't. It's the exact same code but if I sit here and press my "get latitude and longitude" button over and over eventually…
user875234
  • 2,399
  • 7
  • 31
  • 49
3
votes
0 answers

Xamarin Orientation Sensor Vector Angle

I'm using Xamarin.Essentials.OrientationSensor in my project and I'm having trouble interpreting the Quaternion the API gives me on new readings. Problem Description Here's a figure describing my problem: I need to determine an orientation vector v…
mefiX
  • 1,702
  • 3
  • 24
  • 39
1
2 3
12 13