I am using @ionic-native/android-permissions. My code in app.component.ts:
this.androidPermissions.checkPermission(this.androidPermissions.PERMISSION.RECORD_AUDIO).then(
(result)=>{
if(!result.hasPermission)
{
this.androidPermissions.requestPermissions(
[this.androidPermissions.PERMISSION.RECORD_AUDIO,
this.androidPermissions.PERMISSION.GET_ACCOUNTS]
).then(()=>{
// this.rootPage = HomePage;
window.location.reload();
});
}
});
It is working when I do :
ionic cordova run android
or
ionic cordova build android
or
ionic cordova build android --release
But the app is not asking for permission if I add --prod. i.e. :
ionic cordova run android --prod
or
ionic cordova build android --prod --release
So the device mic is not working for the app.