[RESOLVED] Android Marshmallow runtime Permissions for Microphone and Local Storage

Hey Meteor Forums

I’m having issues on the latest version of Android where my permissions aren’t working, with Meteor v 1.3.2.

I need to grant permissions for microphone and storage, How would I go about this?

Do you have ‘development mode’ enabled in the settings of Android?

Also, it might be useful to post any errors or a slightly more in-depth explanation of your issue. Are you talking about permissions on the phone? On the server? Any errors being thrown? What OS are you developing on etc…

I would like to add that local storage should not require any user prompts. We are using that for our application and haven’t encountered any issues like that. Local storage is available on web browsers, so the cordova build should have no issues with that (and it doesn’t).

H iThere

I’m developing on OSX, I’m talking about device permissions, no errors, just when checking app permission on the device they’re off, I’m not refering to localstorage, but device storage, building for Android Marshmellow

@npolet the issue here is really that Android Marshmellow requires permissions to be requested at runtime.

Essentially, marshmallow requires a new approach to permissions, where you are required to check and request them at runtime. The tricky bit here, is that it fails silently. This cordova plugin works for android and iOS,

You may use it something like this:

Meteor.startup(function() {
  if (Meteor.isCordova) {
    // check and request microphone access
    cordova.plugins.diagnostic.getMicrophoneAuthorizationStatus(function(status) {
        if (status !== "GRANTED") {
          cordova.plugins.diagnostic.requestMicrophoneAuthorization(function(status) {
            //...
            return;
          });
        }
    }, function() {
      throw new Meteor.error('failed to get permission for microphone');
    });

    // To request File access:
    cordova.plugins.diagnostic.requestRuntimePermission(function(success) {
      console.log(success);
    }, function(error) {
      console.log(error);
    }, 'READ_EXTERNAL_STORAGE');

  }
});

Hope this helps someone else.

Essentially, marshmallow requires a new approach to permissions, where you are required to check and request them at runtime. The tricky bit here, is that it fails silently. This cordova plugin works for android and iOS,

http://www.passwordmanagers.net/Android-Manager.html]My Device Manager