How to manage FINE and COARSE location permission in Android 12? - location

I need to manage ACCESS_FINE_LOCATION and ACCESS_COARSE_LOCATION in Android 12 simultaneously. My app will first check for ACCESS_FINE_LOCATION, if denied it will show permission rationale. If further denied will request for ACCESS_COARSE_LOCATION.
I can't figure out how to handle this as both fine and coarse location permission fall in same group.
Please help.

Related

Apps requesting access to the All files access permission without a permitted use will be removed from Google Play, and you won't be able to publish

Apps requesting access to the All files access permission without a permitted use will be removed from Google Play, and you won't be able to publish updates.
This is the bit that's unclear, at least to me. So if an app is currently in the Play Store but targets API 29 and has requestLegacyExternalStorage=true, will that app be removed from the Play Store in the future? If so, that's bad. I get that after November for any updates the target API must be 30.
We received this warning what does it means, we use requestLegacyExternalStorage flag and targetsdk 29, so my app will be removed from play? And what changes i need to do for this?
No, your app is not get removed from playstore...
but your app not might work if you targeted API 30 above. "requestLegacyExternalStorage=true" is a temporary solution provided by google to allow developer to smooth transition to new Secure Storage Model.
Many apps that had no legitimate need to read all the files stored on the device’s storage were requesting this permission, causing Google to narrow storage access permissions with Android 11’s “Scoped Storage” changes.
You have two option:
If your app require little to moderate use of storage > Use “Scoped Storage”
If your app is such as File Manager,Anti-virus,etc in which required all storage file access to work effectively and efficiently > Use "All files access"
Further query link_1 , link_2

How to get runtime time permissions using android management API?

I am using the Android Management API to get runtime permission android.permission.SYSTEM_ALERT_WINDOW. The app is going to be installed on fully managed devices. The policy has the below permissions defined:-
defaultPermissionPolicy: "GRANT"
I have added this to the application section of the policy as well. However, the app does not obtain these permissions and the user has to manually go to the settings and enable this permission. I understand that this permission is rated as advanced level permission, but this is a fully managed device.
Android Management API defaultPermissionPolicy can only grant/deny runtime permission requests. For example, READ_CONTACTS, WRITE_CONTACTS, ACCESS_FINE_LOCATION, ACCESS_COARSE_LOCATION and etc.
SYSTEM_ALERT_WINDOW is a special permission. This permission doesn't behave like a dangerous or normal permission. This is a sensitive permission that needs user authorization.
For more information you may refer to this link.
I had the same problem with AE. The solution was set targetSdkVersion to 19 in your app.
To fully benefit from android.permission.SYSTEM_ALERT_WINDOW, it's usually necessary to request also Draw over other apps which is special permission that the user must grant manually per app. It's nicely described here.

Geo Locator Location permission

I am using GeoLocator for location. I have given permission in the manifest for:
1.Access_Coarse_Location
2.Access_Fine_Location
3.Internet
Still, it is not asking for permission. I have to give permission from Device App Setting. otherwise, the app will be crash.
Please give me the solution.
Thanks in advance.
From android 6 and onward you have to request the permission at the run-time.
You have added permissions in manifest, hence you can allow them in settings.
But as you haven't requested for them when the app starts or your activity launches, your app doesn't have the required permission and hence it's crashing.
You can follow this article to know how to request permission at run-time.
https://blog.xamarin.com/requesting-runtime-permissions-in-android-marshmallow/

Where exactly Android Wear app Permission request to be placed

I want to request the permissions that I need for my android wear app upfront as per this. So Programmatically where exactly I should put my permission request code. Also is the protocol to ask for Permission the same as the mobile app like this.
All of the permissions are controlled in the Androidmanifest. Here is an example of some permissions being declared in the Androidmanifest:
These permissions are used to get the weather from the device and relay the information to an Android Wear device. Google offers documentation for developers to use to determine what permissions should be used. Declaring permissions should happen in the Androidmanifest in the format provided in the image. In the sample code posted, it is not necessary to include watch permissions, they are only required if the app works with Android Wear.
Way back in the day Google added a feature in Android 4.3 that let the user control what permissions apps could access on a per app basis known as App Ops. This was a great feature that cut down on privacy issues and gave users the piece of mind knowing that random apps installed could not access the device’s location. When Google introduced Android 6.0 Marshmallow, This time when an app needs to use a permission a dialog box pops up on the screen and asks the user if it is OK that the app uses a certain permission. This may get a little annoying, but at least every permission used by an app has to go through the user first.
If your app doesn't already have the permission it needs, the app must call one of the [requestPermissions()](https://developer.android.com/reference/android/support/v4/app/ActivityCompat.html#requestPermissions(android.app.Activity, java.lang.String[], int)) methods to request the appropriate permissions. Your app passes the permissions it wants, and also an integer request code that you specify to identify this permission request. This method functions asynchronously: it returns
right away, and after the user responds to the dialog box, the system calls the app's callback method with the results, passing the same request code that the app passed to requestPermissions().
You should dynamically request the permissions from user on wearable devices just the same way you do on the phone side.

OSX Push Notifications for Websites - Safari requestPermission callback never called

Following the instructions as per Apple Documentation to allow a user with Safari to visit a website and get Push Notifications for the Apple Push Notification Service.
I'm using SSL, have a certificate from Apple, and have generated the push package file.
Safari downloads this when running the prompt requestPermission, displays the user permission request prompt, but on the user clicking 'approve', the callback function is never called.
window.safari.pushNotification.requestPermission(url, websitePushID, userInfo, callback);
The callback function is never called.
No exceptions are thrown.
No POST is made to the server for any success or error.
The website is now listed under System Preferences > Notifications.
The website is not listed under Notifications within Safari Preferences.
Further attempts to requestPermission or query permission are denied instantly.
The only way to reset the denied permission is to edits OSXs internal sqllite file and delete a bunch of config files within Safari before I can retry the request.
What could be causing this unusual behaviour?
It's hard to judge without the exact javascript you are using, but the 3 permission types that you see in the apple documentaion are default, granted and denied.
If the permission is granted or denied, then the user has already set whether they want to receive these push notifications. Once a user has denied a push notification then Apple has made the decision that they cannot be asked again (without changing settings.) If they already have been granted permission there is no need to call window.safari.pushNotification.requestPermission
The only time that you would call window.safari.pushNotification.requestPermission is when permission has neither been denied nor granted. Only in this case will you want to call the function and expect for a response to trigger the callback function. If you see a permission request prompt it means the requestionPermission has worked.

Resources