Skip to content

Commit

Permalink
Added an easy way to override the faceid usage description (with a de…
Browse files Browse the repository at this point in the history
…fault fallback)
  • Loading branch information
EddyVerbruggen committed Nov 6, 2017
1 parent 617579d commit c7a6a3d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,10 @@ window.plugins.touchid.isAvailable(
function(msg) {alert('not available, message: ' + msg)} // error handler: no TouchID available
);
```

If you want to alter the usage description in the consent popup, then override the
default empty adds an empty `NSFaceIDUsageDescription`. To do so, pass the following variable when installing the plugin:

```
cordova plugin add cordova-plugin-touch-id --variable FACEID_USAGE_DESCRIPTION="For easy authentication"
```
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cordova-plugin-touch-id",
"version": "3.3.0",
"version": "3.3.1",
"description": "Scan the fingerprint of your user with the TouchID sensor, or the user's Face with Face ID on iPhone X",
"cordova": {
"id": "cordova-plugin-touch-id",
Expand Down
8 changes: 7 additions & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
id="cordova-plugin-touch-id"
version="3.3.0">
version="3.3.1">

<name>Touch ID</name>

Expand Down Expand Up @@ -36,6 +36,12 @@
</feature>
</config-file>

<!-- Usage description of Face ID for iOS 11+ -->
<preference name="FACEID_USAGE_DESCRIPTION" default=" " />
<config-file target="*-Info.plist" parent="NSFaceIDUsageDescription">
<string>$FACEID_USAGE_DESCRIPTION</string>
</config-file>

<framework src="LocalAuthentication.framework" />
<framework src="Security.framework" />

Expand Down

0 comments on commit c7a6a3d

Please sign in to comment.