Skip to content

Commit

Permalink
hard coded NSMicrophoneUsageDescription for compatibility with PhoneG…
Browse files Browse the repository at this point in the history
…ap Build.
  • Loading branch information
Bob Moore committed Dec 21, 2016
1 parent 5bd8554 commit d186438
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
11 changes: 11 additions & 0 deletions README.md
Expand Up @@ -293,6 +293,17 @@ Starts or resumes playing an audio file.
var myMedia = new Media("audio/beer.mp3")
myMedia.play() // first looks for file in www/audio/beer.mp3 then in <application>/documents/tmp/audio/beer.mp3

Since iOS 10 it's mandatory to add a `NSMicrophoneUsageDescription` in the info.plist.

* `NSMicrophoneUsageDescription` describes the reason that the app accesses the user’s microphone.

When the system prompts the user to allow access, this string is displayed as part of the dialog box.

This string has been hard coded with the following text to allow the plugin to be used by PhoneGap Build as well as the Cordova CLI:

* `NSMicrophoneUsageDescription:` This app requires access to the microphone to record audio.


## media.release

Releases the underlying operating system's audio resources.
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "cordova-media-with-compression",
"version": "2.1.0",
"version": "2.1.1",
"description": "Cordova Media Plugin with MPEG 4 audio compression for iOS and Android",
"cordova": {
"id": "cordova-media-with-compression",
Expand Down
6 changes: 3 additions & 3 deletions plugin.xml
Expand Up @@ -21,7 +21,7 @@
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="cordova-media-with-compression"
version="2.1.0">
version="2.1.1">

<name>Media With Compression: Alpha Software Edition</name>
<description>Cordova Media Plugin with MPEG 4 audio compression for iOS and Android</description>
Expand Down Expand Up @@ -111,9 +111,9 @@ version="2.1.0">
<header-file src="src/ios/CDVSound.h" />
<source-file src="src/ios/CDVSound.m" />

<preference name="MICROPHONE_USAGE_DESCRIPTION" default=" " />

<config-file target="*-Info.plist" parent="NSMicrophoneUsageDescription">
<string>$MICROPHONE_USAGE_DESCRIPTION</string>
<string>This app requires access to the microphone to record audio.</string>
</config-file>
</platform>

Expand Down

0 comments on commit d186438

Please sign in to comment.