SCM iOS API
|
Main class for the Smart Card Middleware API. More...
Inherits NSObject.
Instance Methods | |
(NSArray *) | - getBluetoothPeripherals |
(void) | - setConfigBluetooth: |
(void) | - scanPeripheral |
(void) | - stopScan |
(void) | - notifyApplicationDidEnterBackground |
(void) | - notifyApplicationWillTerminate |
(NSArray *) | - getReaders |
(Reader *) | - getReader: |
(void) | - addReaderEventListener: |
(void) | - removeReaderEventListener: |
(NSString *) | - getBluetoothPeriphUuidRegistered |
(void) | - initTagReaderSession:completionHandler: |
(void) | - endTagReaderSession: |
(void) | - updateTagReaderSessionMessage: |
(BOOL) | - isSupportedNfcTagReaderSession |
Class Methods | |
(void) | + createEnvironment:completionHandler: |
Main class for the Smart Card Middleware API.
This class provides the initial entry points from connecting to the iOS API, obtaining the readers and listening to events.
- (void) addReaderEventListener: | (id <ReaderEvents>) | listener |
Registers a reader event listener.
listener | the listener object whose methods will be called when an event occurs. |
+ (void) createEnvironment: | (BOOL) | bluetoothSupport | |
completionHandler: | (void(^)(SCMEnvironment *env, NSError *error)) | completionHandler | |
Initializing the list af all smart card readers attached to the device (SCMEnvironment#getReaders), and starts monitoring smart card reader events.
Note that if the device supports NFC Tag Reading, a Nfc Reader named NFC Interface
will be added to (SCMEnvironment#getReaders) array.
Note that the SCMEnvironment must be created from your:
bluetoothSupport | true if the application wants to support bluetooth readers; false otherwise. Entitlements must be set accordingly. |
completionHandler | the completion handler block to be called as soon as the environment is created. The completion handler is executed on the main queue and takes the following parameters :
|
- (void) endTagReaderSession: | (NSString *) | message |
Closes the NFC Tag reader session and displays a feedback to the user. if the session was not successful, a message must be provided, which will be displayed to the user as an error. If the operation was successful, the message must be set to nil and a positive check mark will be displaye to the user.
message | nil if the session was successful, or a message error if the session was not successful. |
- (NSArray *) getBluetoothPeripherals |
Gets an array of the bluetooth peripherals visible to the phone.
- (NSString *) getBluetoothPeriphUuidRegistered |
Gets the uuid of the registered bluetooth peripheral.
- (Reader *) getReader: | (NSString *) | readerName |
- (NSArray *) getReaders |
Returns the list of all smart card readers attached to the phone.
- (void) initTagReaderSession: | (NSString *) | message | |
completionHandler: | (void(^)(NSError *error)) | completionHandler | |
Start scanning for NFC tags. After calling this function, iOS will display an alert action sheet waiting to detect tags.
message | descriptive text message that is displayed on the alert action sheet once tag scanning has started. The string can be update dynamically by calling (SCMEnvironment#updateTagReaderSessionMessage:). |
completionHandler | the completion handler to be called if the alert action sheet has been canceled by the user or if there was a session timeout. If the operation has been ended explicitly by a (SCMEnvironment#endTagReaderSession:) call, the callback is not called. |
- (BOOL) isSupportedNfcTagReaderSession |
Returns YES if the device supports NFC Tag Reading.
- (void) notifyApplicationDidEnterBackground |
Call this from your:
- (void) notifyApplicationWillTerminate |
Call this from your:
- (void) removeReaderEventListener: | (id <ReaderEvents>) | listener |
Removes a reader event listener.
listener | the listener object to remove. |
- (void) scanPeripheral |
Scan for bluetooth peripherals.
- (void) setConfigBluetooth: | (NSString *) | uuid |
Registers a bluetooth peripheral.
uuid | the Universally Unique Identifier of the bluetooth peripheral. |
- (void) stopScan |
Stop scan for bluetooth perihperals.
- (void) updateTagReaderSessionMessage: | (NSString *) | message |
Update the text message that was displayed on the alert action sheet of the NFC Tag Reader Session.
message | the new text message to be displayed on the alert action sheet. |