I have a xamarin forms app in which user will make call from a button.I need to access the call log in the android part.How to provide the runtime permission for read call log? If I asked this permission will it cause any problems after submitting to the playstore?Because I saw some articles about dangerous permissions. Any help is appreciated.
-
Why exactly do you want to read the call log? – FreakyAli Sep 03 '19 at 09:48
-
I am developing an app for employee tracking. Employees supposed to do call from number from app and the call duration is to be uploaded to their database.it will used for calculation incentives for them. so thats why I accessing the log – Anand Sep 03 '19 at 09:50
-
@G.hakim is it possible bro? – Anand Sep 03 '19 at 11:14
-
Well, I think it can be done on Android you, as anyways multiple apps are already doing it. Check this out for a simple detail https://developer.android.com/guide/topics/permissions/overview Also check the comments here https://stackoverflow.com/q/39870043/7462031 – FreakyAli Sep 03 '19 at 11:43
1 Answers
First
About Runtime Permission.Google has improved the permission system in Android 6.0, changing some permissions related to user privacy to dynamically request authorization from the app runtime,you could refer to Runtime Permission and Document
you could refer to a sample(requset CallPhone permission,in your case you should change it to ReadCallLog):https://stackoverflow.com/a/56898446/10768653
you also could use the NugetPackage Plugin.Permissions to request runtime permissions simply
Second
Google has announced a new Play Store policy meant to prevent intrusive Android apps from collecting call log and SMS information from users' devices.According to Google, only an app that has been selected as the phone's default app for making calls or sending text messages will be able to access call logs and SMS data via the SMS and Call Log permissions.Google says that alternative APIs, such as the SMS Retriever API, the SMS Intent API, the Share Intent API, or the Dial Intent API can be used as replacements for some of the features powered by having direct access to the SMS and Call Log permissions.Related Blog;
and if you want to get a call duration,you could refer to :call duration

- 15,726
- 1
- 7
- 23
-
Thanks for the reply. The reffered link is mine :). I am using Phone's default app to make call. If I use this permission will it cause problems on uploading it to Playstore? Like any policies something? – Anand Sep 04 '19 at 06:39
-
@AndroDevil aha,I didn't realize that the author was you.You could fill the [google form](https://docs.google.com/forms/d/e/1FAIpQLSfCnRaa4b1VuHhE4gVekWJc_V0Zt4XiTlsKsTipTlPg5ECA7Q/closedform) after publish your app on Google Play Store to explain why your app needs to use the SMS and/or Call Log permissions to receive Google Play approval. But, if Google deems the use of these permissions to be non-essential to the app, the form will get rejected.And this restriction only on google play store, you can still distribute the app on others store – Leo Zhu Sep 04 '19 at 06:57