Check and set the permission accordingly for location

This thread was migrated from an old forum. It may contain information that are no longer valid. For further assistance, please post a new question or open a support ticket from the Customer Support portal.

I am developing a app for android and ios in which there is map now for this map i need to check permission for location if it is granted then go ahead otherwise ask to allow access .

how can i achieve this ..?

I have gone through below link but I didn't get exact idea if anybody work on this and have any code refernce please share..

http://docs.kony.com/konylibrary/visualizer/viz_api_dev_guide/content/kony.application_functions_runtimepermissionsapi.htm#checkPermission

Help is appreciated

Thanks!!!!

Hi,

The document which you provided also consists of code examples.

Please try the below code, this might be helpful to resolve your issue

<uses-permission android:name = "android.permission.READ_PHONE_STATE"/>

kony.application.requestPermission("android.permission.READ_PHONE_STATE", permissionStatusCallback());

function permissionStatusCallback(response)

{

if(response.status == kony.application.PERMISSION_GRANTED)

{

kony.location.getCurrentPosition();

}

else if(response.status == kony.application.PERMISSION_DENIED)

{

//Display Application Settings alert by using kony.application.openApplicationSettings()

}

}

Thank you,