Evgeny Zinoviev e7b52b4453
Merge pull request #1 from wesleysmitthe/add-os-type-in-packagejson
fix: added os type in package.json because in multi-platform projects we don't need to use the library on others systems.
2020-08-21 20:59:04 +03:00
upd
2018-12-25 20:35:55 +03:00
2018-12-25 18:16:30 +03:00
2019-01-24 22:48:34 +03:00
2018-12-26 00:00:59 +03:00
2018-12-25 18:16:30 +03:00

mojave-permissions

This is native nodejs module that implements access to getMediaAccessStatus and askForMediaAccess functions introduced in macOS Mojave 10.14.

Building

node-gyp configure
node-gyp build

And you can check if it works:

node test.js

Tested on macOS 10.14 and 10.13 with nodejs 11.3.0 and Electron 1.8.8 (node 8.2.1).

API

getMediaAccessStatus(mediaType)

mediaType is a string and can be microphone or camera

Returns one of the following values: not-determined, restricted, denied or granted

askForMediaAccess(mediaType, callback)

Asks user for media access and returns user choice to the callback. Example:

mojavePermissions.askForMediaAccess('camera', (granted) => {
  if (!granted) {
    // user has denied access to camera
  }
})

License

I don't care; you can use it however you want.

Description
No description provided
Readme 42 KiB
Languages
Objective-C++ 80%
JavaScript 12.6%
Python 7.4%