Closed Dipannita20 closed 3 years ago
Your app is wired fine. I just ran it and the "Learn More" button is displaying the popup. Keep in mind, if your user has already granted/declined the permission, it will not popup again - you will still get an AccessState from the RequestAccess showing you what the current status is
Thanks for your response, however I have tried multiple times before posting this issue. Every time I uninstalled and reinstalled the app to check, still I have no luck. Could it be some configuration issue?
I am using Visual Studio 2019 16.10.2 Microsoft Visual Studio Professional 2019 (2) Version 16.10.2 VisualStudio.16.Release/16.10.2+31410.357 Microsoft .NET Framework Version 4.8.04084
Installed Version: Professional
Azure App Service Tools v3.0.0 16.10.526.50910 Azure App Service Tools v3.0.0
C# Tools 3.10.0-4.21269.26+029847714208ebe49668667c60ea5b0a294e0fcb C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Common Azure Tools 1.10 Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.
Extensibility Message Bus 1.2.6 (master@34d6af2) Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.
IntelliCode Extension 1.0 IntelliCode Visual Studio Extension Detailed Info
Microsoft JVM Debugger 1.0 Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines
Microsoft MI-Based Debugger 1.0 Provides support for connecting Visual Studio to MI compatible debuggers
Mono Debugging for Visual Studio 16.10.15 (552afdf) Support for debugging Mono processes with Visual Studio.
NuGet Package Manager 5.10.0 NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/
ProjectServicesPackage Extension 1.0 ProjectServicesPackage Visual Studio Extension Detailed Info
Visual Basic Tools 3.10.0-4.21269.26+029847714208ebe49668667c60ea5b0a294e0fcb Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Visual F# Tools 16.10.0-beta.21262.7+1b23bbeda88ea3cb9be9af777f4c99fa8663df81 Microsoft Visual F# Tools
Visual Studio Code Debug Adapter Host Package 1.0 Interop layer for hosting Visual Studio Code debug adapters in Visual Studio
VisualStudio.DeviceLog 1.0 Information about my package
VisualStudio.Foo 1.0 Information about my package
VisualStudio.Mac 1.0 Mac Extension for Visual Studio
Xamarin 16.10.000.231 (d16-10@8111164) Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.
Xamarin Designer 16.10.0.115 (remotes/origin/c750fbf1bde3c720d077f51640fe197c6dac7cbe@c750fbf1b) Visual Studio extension to enable Xamarin Designer tools in Visual Studio.
Xamarin Templates 16.10.5 (355b57a) Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.
Xamarin.Android SDK 11.3.0.4 (d16-10/ae14caf) Xamarin.Android Reference Assemblies and MSBuild support. Mono: b4a3858 Java.Interop: xamarin/java.interop/d16-10@f39db25 ProGuard: Guardsquare/proguard/v7.0.1@912d149 SQLite: xamarin/sqlite/3.35.4@85460d3 Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-10@c5732a0
Xamarin.iOS and Xamarin.Mac SDK 14.20.0.10 (0e35b2e0b) Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.
Installed MSBuild : 15.0
Android SDK
I have one more question: Shiny 1, app is using Shiny locations and Shiny Notifications. With Shiny 2 do I still need to install Shiny core?
Should I also install Shiny. My system does not have MSBuild 16.8+
Appreciate all your help to resolve this critical issue. I am thankful to you.
Shiny.Core is reference by all other Shiny packages. It doesn't matter if you install it, it's there.
The "Shiny" is for code generation of the boilerplate you have already put in yourself. You don't need it or msbuild 16.8 if you aren't using it (If you're using the latest version of visual studio, you already have it though).
I don't know what to tell you for your issue. The sample you sent is working fine and I reviewed it, it looks fine. You'll have to do some debugging on your own. I can't solve something I can't see.
Thanks for the response. Is there any financial terms where we can get paid technical support call to resolve the issues? We would require technical support to upgrade Shiny from 1 to 2 with Shiny locations(GPS and Geofence), Shiny Notifications, Shiny Jobs.
This is critical for the app as app has been rejected from the play store on background location permission. We have to show education UI to user explaining why user has to provide location permission. The issue with current setup with Shiny 1 it showing location permission popup in the beginning.
I am getting below error on: await geofences.RequestAccess();
System.IndexOutOfRangeException: 'Index was outside the bounds of the array.'
System.IndexOutOfRangeException: 'Index was outside the bounds of the array.'
[mono-rt] [ERROR] FATAL UNHANDLED EXCEPTION: System.IndexOutOfRangeException: Index was outside the bounds of the array. [mono-rt] at Shiny.PermissionRequestResult.IsGranted (System.String permission) [0x00012] in //src/Shiny.Core/Platforms/Android/PermissionRequestResult.cs:31 [mono-rt] at Shiny.Locations.PlatformExtensions.RequestLocationAccess (Shiny.IAndroidContext context, System.Boolean background, System.Boolean fineAccess, System.Boolean gpsRequired, System.Boolean networkRequired) [0x0015e] in //src/Shiny.Locations.Common/Platforms/android/PlatformExtensions.cs:67 [mono-rt] at App2.ViewModels.AboutViewModel.OnLoginClicked (System.Object obj) [0x0002b] in C:\Users\dipannitad\source\repos\App2\App2\App2\ViewModels\AboutViewModel.cs:24 [mono-rt] at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.25(intptr,intptr) [mono-rt] at (wrapper native-to-managed) Android.Runtime.DynamicMethodNameCounter.25(intptr,intptr)
Here is an update:
On Android 10: await geofences.RequestAccess();
I am getting Location Permission Popup
On Android 11: await geofences.RequestAccess();
I did not get any location permission popup. Checked Android Device Monitor it is only requesting for Foreground Service Permission
On Android 11 with below code I am getting first location permission popup, however I am getting bellow exception on
var gpsManager = ShinyHost.Resolve<IGpsManager>(); var status = await gpsManager.RequestAccess(new GpsRequest { UseBackground = false }); var geofences = ShinyHost.Resolve<IGeofenceManager>(); var accessState = await geofences.RequestAccess();
My app is in foreground only.
System.ApplicationException: 'You cannot make permission requests while your application is in the background. Please call RequestAccess in the Shiny library you are using while your app is in the foreground so your user can respond. You are getting this message because your user has either not granted these permissions or has removed them.'
[libc] Requested dump for tid 5389 (ompanyname.app2)
[mono-rt] [ERROR] FATAL UNHANDLED EXCEPTION: System.ApplicationException: You cannot make permission requests while your application is in the background. Please call RequestAccess in the Shiny library you are using while your app is in the foreground so your user can respond. You are getting this message because your user has either not granted these permissions or has removed them.
[mono-rt] at Shiny.AndroidPlatform+<>c__DisplayClass70_0.1[TSource].SubscribeCore (System.IObserver
1[T] observer) [0x00000] in //Rx.NET/Source/src/System.Reactive/Linq/QueryLanguage.Creation.cs:35
[mono-rt] at System.Reactive.ObservableBase1[T].ScheduledSubscribe (System.Reactive.AutoDetachObserver
1[T] autoDetachObserver) [0x00000] in //Rx.NET/Source/src/System.Reactive/ObservableBase.cs:85
[mono-rt] --- End of stack trace from previous location where exception was thrown ---
[mono-rt]
[mono-rt] at Shiny.Locations.PlatformExtensions.RequestLocationAccess (Shiny.IAndroidContext context, System.Boolean background, System.Boolean fineAccess, System.Boolean gpsRequired, System.Boolean networkRequired) [0x0010c] in /_/src/Shiny.Locations.Common/Platforms/android/PlatformExtensions.cs:58
[mono-rt] at App2.ViewModels.AboutViewModel.OnLoginClicked (System.Object obj) [0x000c4] in C:\Users\dipannitad\source\repos\App2\App2\App2\ViewModels\AboutViewModel.cs:32
[mono-rt] at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.50(intptr,intptr)
[mono-rt] at (wrapper native-to-managed) Android.Runtime.DynamicMethodNameCounter.50(intptr,intptr)
You can try the latest preview as it has fixes for permission on Android 11 & 12. I
Thanks for the response, I have upgraded shiny to 2.3.0.2946-preview, could you suggest if google play service nuget needs to added or not, if yes which version to use or it is been already added? Thanks again
I have registered couple of geofence regions and from GeofenceDelegate I am triggering notification on OnStatusChanged, I am getting below logs in the console not always, however it is triggering notifications, I am bit confused about the log messages and the purpose.
Also if there are 9 logs however I got 8 notifications, for 13100 I haven't received any notification, on checking found 13100 and 12655 found lat, lng is same. To verify registered two more regions with same lat lng, however received notifications for both of them. I am bit confused about the logs. Could you please guide me here on what is happening?
Error: Error in geofence delegate - Region: 13100 State: Entered Error: Error in geofence delegate - Region: 12685 State: Entered Error: Error in geofence delegate - Region: 13060 State: Entered Error: Error in geofence delegate - Region: 13080 State: Entered Error: Error in geofence delegate - Region: 13070 State: Entered Error: Error in geofence delegate - Region: 12665 State: Entered Error: Error in geofence delegate - Region: 12655 State: Entered Error: Error in geofence delegate - Region: 12675 State: Entered Error: Error in geofence delegate - Region: 13090 State: Entered
I have upgraded to 2.4.0.2960
Please note this is NOT a support forum. The library is free, my time is not. This issue has been resolved and is now closed. If you need help further to issues, you can become a sponsor of the library at one of the higher tiers.
Component
Locations (GPS, Geofencing, Motion Activity)
What platform(s) are effected?
Steps To Reproduce
Expected Behavior
It should trigger Location permission
Actual Behavior
It does not trigger location permission
Exception or Log output
Forwarding debugger port 8812 Detecting existing process
Code Sample
App1.zip
Please let me know where it is going wrong. Google playstore build has been rejected because of the location permission which shown up at the beginning while opening the app. I am upgrading Shiny from 1 to 2 so I can get rid of automated initial location permission, but in blocked state as with shiny 2, location permission screen does not show up at all
Code of Conduct