Skip to content

Commit

Permalink
Merge pull request #16 from appcelerator-modules/MOD-2420
Browse files Browse the repository at this point in the history
iOS: Expose "service" to keychain-item
  • Loading branch information
hansemannn authored May 11, 2018
2 parents 002e685 + d662ab7 commit 470e730
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 6 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<p align="center">This native module allows you to use Fingerprint authentication, Keychain Access and Face authentication (iOS) with Axway Titanium.</p>

## Requirements
- Titanium Mobile SDK 6.2.0 or later
- Titanium SDK 6.2.0 or later
- iOS 8.0 or later
- Xcode 8 or later

Expand All @@ -16,8 +16,8 @@
Please see the full-featured example in `ios/example/app.js` and `ios/example/app.js`.

## Build from Source
- iOS: `appc ti build -p ios --build-only` from the `ios` directory
- Android: `appc ti build -p android --build-only` from the `android` directory
- iOS: `appc run -p ios --build-only` from the `ios` directory
- Android: `appc run -p android --build-only` from the `android` directory

> Note: Please do not use the (deprecated) `build.py` for iOS and `ant` for Android anymore.
> Those are unified in the above appc-cli these days.
Expand Down
11 changes: 11 additions & 0 deletions apidoc/KeychainItem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ description: |
// Create a keychain item
var keychainItem = Identity.createKeychainItem({
identifier: 'mypassword',
service: 'my_service', // iOS only. Defaults to 'ti.touchid' for backwards compatibility
accessGroup: '<YOUR-TEAM-ID>.com.appc.identitytest',
accessibilityMode: Identity.ACCESSIBLE_WHEN_PASSCODE_SET_THIS_DEVICE_ONLY,
accessControlMode: Identity.ACCESS_CONTROL_TOUCH_ID_ANY,
Expand Down Expand Up @@ -123,6 +124,16 @@ properties:
Required identifier to create or receive a keychain item. The identifier
cannot contain alphanumeric characters or it might be rejected by the keychain.
type: String

- name: service
platforms: [iphone, ipad]
optional: false
summary: |
A key whose value is a string indicating the item's service. Defaults
to `ti.touchid` if not set for backwards compatibility with the deprecated
Ti.TouchID module. This property is required when using app extensions
and should also include the app-prefix (aka team-ID).
type: String

- name: accessGroup
platforms: [iphone, ipad]
Expand Down
1 change: 1 addition & 0 deletions ios/Classes/TiIdentityKeychainItemProxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
@private
APSKeychainWrapper *keychainItem;

NSString *service;
NSString *identifier;
NSString *accessGroup;
NSString *accessibilityMode;
Expand Down
3 changes: 2 additions & 1 deletion ios/Classes/TiIdentityKeychainItemProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ - (id)_initWithPageContext:(id<TiEvaluator>)context args:(NSArray *)args
accessibilityMode = [[params objectForKey:@"accessibilityMode"] copy];
accessControlMode = [params objectForKey:@"accessControlMode"];
options = [params objectForKey:@"options"];
service = [[params objectForKey:@"service"] copy] ?: @"ti.touchid"; // Keep "ti.touchid" default for backwards compatibility
}
return self;
}
Expand All @@ -30,7 +31,7 @@ - (APSKeychainWrapper *)keychainItem
if (!keychainItem) {

keychainItem = [[APSKeychainWrapper alloc] initWithIdentifier:identifier
service:@"ti.touchid" // Keep for backwards compatibility
service:service
accessGroup:accessGroup
accessibilityMode:(CFStringRef)accessibilityMode
accessControlMode:[self formattedAccessControlFlags]
Expand Down
2 changes: 1 addition & 1 deletion ios/manifest
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# this is your module manifest and used by Titanium
# during compilation, packaging, distribution, etc.
#
version: 1.0.4
version: 1.0.5
apiversion: 2
architectures: armv7 arm64 i386 x86_64
description: titanium-identity
Expand Down
2 changes: 1 addition & 1 deletion ios/titanium.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
// OF YOUR TITANIUM SDK YOU'RE BUILDING FOR
//
//
TITANIUM_SDK_VERSION = 7.1.0.GA

TITANIUM_SDK_VERSION = 7.1.1.GA

//
// THESE SHOULD BE OK GENERALLY AS-IS
Expand Down

0 comments on commit 470e730

Please sign in to comment.