Updates to the HID Approve SDK for Apple iOS/macOS
This page details the design changes made in the new HID® Approve™ SDK for Apple® iOS®
Please refer to the code examples provided below that illustrate the code changes, as well as Add Functions to your App.
What's New in Version 5.13 from 5.12
NEW [HIDDeviceFactory getDevice] method replaces [HIDDeviceFactory newInstance]
UPDATE [HIDDeviceFactory reset] method reviewed to be more robust
Several deprecated APIs (from SDK 5.5 and SDK 5.7.1) have been removed
What's New in Version 5.12 from 5.11
None - this is release is to provide important security updates and third-party component updates.
What's New in Version 5.11 from 5.10
SDK Additions and New Features
UPDATE method "retrieveActionInfo" to add "HIDInexplicitContainer" exception
NEW method with a different signature "retrieveActionInfo(char[] actionId, char[] userId)"
What's New in Version 5.10 from 5.9
SDK Additions and New Features
NEW constant "HID_PARAM_TX_MOBILE_CONTEXT"
UPDATE method "setStatus" supports "HID_PARAM_TX_MOBILE_CONTEXT" parameter
What's New in Version 5.9 from 5.7.1
SDK Updates
Sequential passwords are prohibited unless explicitly authorized with password policy parameters
SDK Additions and New Features
NEW constant "HID_DEVICE_INFO_ISROOTED"
NEW constant "HID_PROPERTY_ORIGINAL_CREATION_DATE"
NEW accessor method “getOriginalCreationDate”
-(NSDate*)getOriginalCreationDate:(NSError**)error;
NEW property “isSequenceAllowed”
NEW enum value “HIDBioAuthenticationStateInvalidKey” for “HIDBioAuthenticationState”
NEW accessor method “getPayload”
- (NSString*)getPayload:(NSError**)error;
Bitcode support will be removed from SDK in a future version.
For further information regarding bitcode deprecation, refer to item "86118779" in the Apple XCode 14 Release Notes.
What's New in Version 5.7.1 from 5.5
SDK Updates
Migration to 5.7.1 from versions 3.0 and 4.0 is no longer supported.
SDK Additions and New Features
REMOVED deprecated method “retrieveTransaction”
NEW method “retrieveActionInfo”
- (id<HIDServerActionInfo>)retrieveActionInfo:(NSString*)actionId error:(NSError**)error;
REMOVED deprecated method “createContainer” (use createContainer with sessionPassword)
REMOVED deprecated method “reset” (use HIDDeviceFactory reset)
REMOVED deprecated method “getDefaultInitializationPolicy” (use HIDProgressListener)
DEPRECATED method "updateDeviceInfo" (use HIDContainer updateDeviceInfo)
REMOVED deprecated property “initialPassword” (use HIDProgressListener)
NEW enumeration value “HIDUnsupportedVersion” (7)
NEW enumeration value "HIDInvalidContainer" (8)
UPDATE class declaration inherits from class HIDServerAction
REMOVED deprecated method “setStatus” (use setStatus with password)
NEW method "updateDeviceInfo" (moved from HIDDevice)
(BOOL)updateDeviceInfo:(NSString*)propertyId withValue:(NSString*)propertyValue withPassword:(NSString*)sessionPassword withParams:(NSArray*)parameters error:(NSError**)error
DEPRECATED class TransactionInfo (use retrieveActionInfo)
NEW class ServerAction
NEW class ServerActionInfo
In order to support framework target integrations, the XCFramework package now includes a clang modulemap header.
To support Apple optimization technology aimed at reducing the application binary size, the SDK framework fully supports Bitcode. For further information, refer to the Apple documentation.
What's New in Version 5.5 from 5.4
SDK Updates
iOS versions 10.0 and 11.0 are no longer supported.
SDK Additions and New Features
NEW method “newInstance”
-(id<HIDDevice>)newInstance:(HIDConnectionConfiguration*)config error:(NSError**)error;
DEPRECATED method “newInstance”
-(id<HIDDevice>)newInstance:(HIDConnectionConfiguration*)config withSessionPassword:(NSString*)sessionPassword error:(NSError**)error;
NEW HID_PARAM_PASSWORD_PROGRESS_EVENT_TYPE; ///< password event type
NEW HID_PARAM_PASSWORD_PROGRESS_EVENT_KEY_LABEL; ///< password event key label
NEW HID_PARAM_PASSWORD_PROGRESS_EVENT_KEY_USAGE; ///< password event key usage
NEW HID_PARAM_PASSWORD_PROGRESS_EVENT_TYPE_CONTAINER; ///< password event type container
NEW HID_PARAM_PASSWORD_PROGRESS_EVENT_TYPE_KEY; ///< password event type key
Documentation has been updated to specify possible exceptions on some functions and methods.
What's New in Version 5.4 from 5.1
SDK Updates
NEW "HIDInvalidArgument" to replace thrown exception NSInvalidArgumentException in the SDK
SDK Additions and New Features
NEW enumeration value “HIDInvalidArgument" for HIDErrorCode
NEW enumeration value “HIDLockTypeSilent” for HIDLockType
NEW constant "HID_KEY_PROPERTY_USAGE_OPPRO"
What's New in Version 5.1 from 4.0
SDK Updates
HIDTransactionInfo
NEW method “getTransaction”
-(id<HIDTransaction>)getTransaction:(NSString*)sessionPassword withParams:(NSArray*)parameters error:(NSError**)error;
HIDTransaction
UPDATE protocol moved from “HIDDevice.h” header
HIDProgressListener
UPDATE protocol moved from “HIDDevice.h” header
UPDATE method “onEventReceived”
- (HIDEventResult*)onEventReceived:(id<HIDEvent>)event;
HIDProgressEvent
UPDATE protocol moved from “HIDDevice.h” header
NEW enumeration “HIDEventResultCode”
NEW interface “HIDPasswordPromptResult”
NEW protocol “HIDEvent”
HIDContainerInitialization
UPDATE interface moved from “HIDDevice.h” header
DEPRECATED field “initialPassword” (use ProgressListener)
HIDDevice
DEPRECATED method “retrieveTransaction” (use TransactionInfo.getTransaction)
-(id<HIDTransaction>)retrieveTransaction:(NSString*)transactionId withPassword:(NSString*)sessionPassword withParams:(NSArray*)parameters error:(NSError**)error;
DEPRECATED method “createContainer” (use new method)
-(id<HIDContainer>)createContainer:(HIDContainerInitialization*)config withListener:(NSObject<HIDProgressListener>*)listener error:(NSError**)error;
DEPRECATED method “reset” (use new method HIDDeviceFactory.reset)
- (BOOL)reset:(NSArray*)parameters error:(NSError**)error;
DEPRECATED method “getDefaultInitializationPolicy” (use ProgressListener)
- (id<HIDProtectionPolicy>)getDefaultInitializationPolicy:(NSError**)error;
NEW method “createContainer”
-(id<HIDContainer>)createContainer:(HIDContainerInitialization*)config withSessionPassword:(NSString*)sessionPassword withListener:(NSObject<HIDProgressListener>*)listener error:(NSError**)error;
HIDDeviceFactory
DEPRECATED method “newInstance” (use new method)
-(id<HIDDevice>)newInstance:(HIDConnectionConfiguration*)config error:(NSError**)error;
NEW method “newInstance”
-(id<HIDDevice>)newInstance:(HIDConnectionConfiguration*)config withSessionPassword:(NSString*)sessionPassword error:(NSError**)error;
NEW method “reset”
+(void)reset:error:(NSError**)error;
SDK Additions and New Features
NEW interface “HIDContainerRenewal”
HIDContainer
NEW method “getCreationDate”
-(NSDate*)getCreationDate:(NSError**)error;
NEW method “getExpiryDate”
-(NSDate*)getExpiryDate:(NSError**)error;
NEW method “getRenewalDate”
-(NSDate*)getRenewalDate:(NSError**)error;
NEW method “isRenewable”
-(Boolean)isRenewable:(NSString*)sessionPassword error:(NSError**)error;
NEW method “renew”
-(Boolean)renew:(HIDContainerRenewal*)config withSessionPassword:(NSString*) sessionPassword withListener:(NSObject<HIDProgressListener>*)listener error:(NSError**)error;
HIDErrorCode
NEW enumeration value “HIDPasswordCancelled”
NEW enumeration value “HIDServerUnsupportedOperation”
NEW enumeration value “HIDServerOperationFailed”
What's New in Version 4.0 from 3.0
SDK Addition
HIDContainer
NEW method “IsFIPSModeEnabled” – Reserved for Future Use.
Code Examples
Transaction Retrieval
NSError* error;
// get device
HIDConnectionConfiguration* connectionConfig = [[HIDConnectionConfiguration alloc] init];
id<HIDDevice> pDevice = [[HIDDeviceFactory alloc] newInstance:connectionConfig error:&error];
// get transaction
id<HIDTransactionInfo> pTransactionInfo = [pDevice retrieveTransactionInfo:transactionId error:&error];
id<HIDTransaction> pTransaction = [pDevice retrieveTransaction:myTransactionId withPassword:mySessionPwd withParams:nil error:&error];
NSError* error;
// get device
HIDConnectionConfiguration* connectionConfig = [[HIDConnectionConfiguration alloc] init];
id<HIDDevice> pDevice = [[HIDDeviceFactory alloc] newInstance:connectionConfig withSessionPassword:mySessionPwd error:&error];
// get transaction
id<HIDTransactionInfo> pTransactionInfo = [pDevice retrieveTransactionInfo:myTransactionId error:&error];
id<HIDTransaction> pTransaction = [pTransactionInfo getTransaction:mySessionPwd withParams:nil error:&error];
NSError* error;
// get device
HIDConnectionConfiguration* connectionConfig = [[HIDConnectionConfiguration alloc] init];
id<HIDDevice> pDevice = [[HIDDeviceFactory alloc] newInstance:connectionConfig error:&error];
// get transaction
id<HIDTransactionInfo> pTransactionInfo = [pDevice retrieveTransactionInfo:myTransactionId error:&error];
id<HIDTransaction> pTransaction = [pTransactionInfo getTransaction:mySessionPwd withParams:nil error:&error];
Provisioning / Container Creation
// progress listener
-(void)onEventReceived:(id<HIDProgressEvent>)event {
NSArray* params = [event parameters];
NSString* message; NSString* percent;
for (HIDParameter* p in params) {
if ( [[p key] caseInsensitiveCompare:HID_PARAM_PROGRESSEVENT_MESSAGE]==NSOrderedSame)
message = [p value];
if ( [[p key] caseInsensitiveCompare:HID_PARAM_PROGRESSEVENT_PERCENT]==NSOrderedSame)
percent = [p value];
}
NSString* text = [NSString stringWithFormat:@"%@ (%@)", message, percent];
NSLog(@"Event Received: %@", text);
}
// provisioning
-(void)doProvisioning {
NSError* error;
// get device
HIDConnectionConfiguration* connectionConfig = [[HIDConnectionConfiguration alloc] init];
id<HIDDevice> pDevice = [[HIDDeviceFactory alloc] newInstance:connectionConfig error:&error];
// new container
HIDContainerInitialization* config = [[HIDContainerInitialization alloc] init];
config.activationCode = [[NSString alloc] initWithData:myActivationCodeData encoding:NSUTF8StringEncoding];
config.initialPassword = myInitialPassword;
config.pushId = myPushID;
config.containerFriendlyName = myServiceName;
id<HIDContainer> pContainer = [pDevice createContainer:config withListener:self error:&error];
}
// progress listener
-( HIDEventResult*)onEventReceived:(NSObject<HIDEvent>*)event {
if ([event isKindOfClass:[HIDPasswordPromptEvent class]]) {
// password request
HIDPasswordPromptEvent* pPwdEvent = (HIDPasswordPromptEvent*)event;
return [[HIDPasswordPromptResult alloc] initWithCode:Continue andPassword:myInitialPassword];
}
else { // progress message
NSArray* params = [event parameters];
NSString* message; NSString* percent;
for (HIDParameter* p in params) {
if ( [[p key] caseInsensitiveCompare:HID_PARAM_PROGRESSEVENT_MESSAGE]==NSOrderedSame)
message = [p value];
if ( [[p key] caseInsensitiveCompare:HID_PARAM_PROGRESSEVENT_PERCENT]==NSOrderedSame)
percent = [p value];
}
NSString* text = [NSString stringWithFormat:@"%@ (%@)", message, percent];
NSLog(@"Event Received: %@", text);
}
return [[HIDEventResult alloc] initWithCode:(Continue)];
}
// provisioning
-(void)doProvisioning {
NSError* error;
// get device
HIDConnectionConfiguration* connectionConfig = [[HIDConnectionConfiguration alloc] init];
id<HIDDevice> pDevice = [[HIDDeviceFactory alloc] newInstance:connectionConfig withSessionPassword:mySessionPwd error:&error];
// new container
HIDContainerInitialization* config = [[HIDContainerInitialization alloc] init];
config.activationCode = [[NSString alloc] initWithData:myActivationCodeData encoding:NSUTF8StringEncoding];
// NOTE: “config.initialPassword” is not supported; use listener
config.pushId = myPushID;
config.containerFriendlyName = myServiceName;
id<HIDContainer> pContainer = [pDevice createContainer:config withSessionPassword:mySessionPwd withListener:self error:&error];
}
// progress listener
-( HIDEventResult*)onEventReceived:(NSObject<HIDEvent>*)event {
if ([event isKindOfClass:[HIDPasswordPromptEvent class]]) {
// password request
HIDPasswordPromptEvent* pPwdEvent = (HIDPasswordPromptEvent*)event;
return [[HIDPasswordPromptResult alloc] initWithCode:Continue andPassword:myInitialPassword];
}
else { // progress message
NSArray* params = [event parameters];
NSString* message; NSString* percent;
for (HIDParameter* p in params) {
if ( [[p key] caseInsensitiveCompare:HID_PARAM_PROGRESSEVENT_MESSAGE]==NSOrderedSame)
message = [p value];
if ( [[p key] caseInsensitiveCompare:HID_PARAM_PROGRESSEVENT_PERCENT]==NSOrderedSame)
percent = [p value];
}
NSString* text = [NSString stringWithFormat:@"%@ (%@)", message, percent];
NSLog(@"Event Received: %@", text);
}
return [[HIDEventResult alloc] initWithCode:(Continue)];
}
// provisioning
-(void)doProvisioning {
NSError* error;
// get device
HIDConnectionConfiguration* connectionConfig = [[HIDConnectionConfiguration alloc] init];
id<HIDDevice> pDevice = [[HIDDeviceFactory alloc] newInstance:connectionConfig error:&error];
// new container
HIDContainerInitialization* config = [[HIDContainerInitialization alloc] init];
config.activationCode = [[NSString alloc] initWithData:myActivationCodeData encoding:NSUTF8StringEncoding];
// NOTE: “config.initialPassword” is not supported; use listener
config.pushId = myPushID;
config.containerFriendlyName = myServiceName;
id<HIDContainer> pContainer = [pDevice createContainer:config withSessionPassword:mySessionPwd withListener:self error:&error];
}