Skip to content

Commit

Permalink
Merge pull request #50 from fasihul-axway/NFC/bump-version
Browse files Browse the repository at this point in the history
Rebase with NativeTagSupport branch and bumped version
  • Loading branch information
Fasihul Haque authored Mar 30, 2021
2 parents 1684bda + 0dc576a commit 33685e8
Show file tree
Hide file tree
Showing 39 changed files with 2,543 additions and 713 deletions.
3 changes: 1 addition & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ library 'pipeline-library'

buildModule {
// defaults:
//nodeVersion = '4.7.3' // Must have version set up on Jenkins master before it can be changed
sdkVersion = '9.2.0.v20200921095451'
sdkVersion = '9.3.1.GA'
androidAPILevel = '25' // if changed, must install on build nodes
iosLabels = 'osx && xcode-12'
}
18 changes: 18 additions & 0 deletions apidoc/NativeTagTechnology.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Modules.Nfc.NativeTagTechnology
summary: Native Tag Technology class will have the common methods.
description: Common methods get called for all the native tags so that we can save the redundancy of the code.
extends: Titanium.Proxy
since: "1.1.0"
platforms: [iphone]

methods:
- name: connect
summary: calls the connected to tag method for NFC Tag reader session.

- name: isConnected
summary: if session is connected to any tag or not
returns:
summary: provides if session is connected
type: Boolean


61 changes: 61 additions & 0 deletions apidoc/NfcMiFareTagTechnology.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Modules.Nfc.MifareTagTechnology
summary: Provides access to MIFARE Ultralight properties and I/O operations on a <Modules.Nfc.NfcTag>.
description: |
Use the <Modules.Nfc.createTagTechnologyMifareUltralight> method to create this tag technology.
See also:
[Mifare Ultralight](https://developer.apple.com/documentation/corenfc/nfcmifaretag?language=objc)
extends: Modules.Nfc.NativeTagTechnology
since: "1.1.0"
platforms: [iphone]

methods:
- name: mifareFamily
summary: The MIFARE product family identifier for the tag.

- name: identifier
summary: The unique hardware identifier of the tag.

- name: historicalBytes
summary: The historical bytes extracted from an Answer To Select response.

- name: sendMiFareCommand
summary: Sends a native MIFARE command to the tag.
parameters:
- name: data
summary: hex command with length will be sent in form of data
type: Array<Number>
- name: errorCode
type: String
summary: The error code; only present if an error occurred.
- name: errorDomain
type: String
summary: The error domain; only present if an error occurred.
- name: errorDescription
type: String
summary: The error description; only peresent if an error occurred.

- name: sendMiFareISO7816Command
summary: Sends a native MIFARE command to the tag along with other parameter.
parameters:
- name: data
summary: hex command with length will be sent in form of data
type: Array<Number>
- name: sw1
summary: The SW1 command-processing status byte.
type: Number
- name: sw2
summary: The SW2 command-processing status byte.
type: Number
- name: apdu
summary: An ISO 7816-4 command APDU object.
type: Titanium.Buffer
- name: errorCode
type: String
summary: The error code; only present if an error occurred.
- name: errorDomain
type: String
summary: The error domain; only present if an error occurred.
- name: errorDescription
type: String
summary: The error description; only peresent if an error occurred.
17 changes: 17 additions & 0 deletions apidoc/NfcNDEFTag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Modules.Nfc.NfcNDEFTag
summary: An interface for interacting with an NDEF tag.
description: |
It provide the interface for NFC Data Exchange Format (NDEF) tag.
extends: Titanium.Proxy
since: "3.0.1"
platforms: [iphone, ipad]
createable: false

methods:
- name: available
summary: A value that determines whether the NDEF tag is available in the current reader session.
platforms: [iphone]
returns:
type: Number

126 changes: 126 additions & 0 deletions apidoc/NfcNDEFTagTechnology.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
---
name: Modules.Nfc.NfcNDEFTagTechnology
summary: Provides access to NDEF tag and I/O operations on a <Modules.Nfc.NfcNDEFTag>
description: |
Use the <Modules.Nfc.createTagTechNdef> method to create this NDEF tag technology.
extends: Titanium.Proxy
since: "3.0.1"
platforms: [iphone, ipad]
createable: false

methods:
- name: connect
summary: Call to connect NfcNDEFTag from session NFCNDEFReaderSession, connection success or failure result in a didConnectTag event.
returns:
type: void

- name: queryNDEFStatus
summary: Asks the reader session for the NDEF support status of the tag. Success/Failure result in a didQueryNDEFStatus event.
returns:
type: void

- name: readNDEF
summary: Retrieves an NDEF message from the tag. Success/Failure result in a didReadNDEFMessage event.
returns:
type: void

- name: writeNDEF
summary: Saves an NDEF message to a writable tag. Success/Failure result in a didWirteNDEFMessage event.
returns:
type: void

- name: writeLock
summary: Changes the NDEF tag status to read-only, preventing future write operations. Success/Failure result in a didWriteLock event.
returns:
type: void

events:
- name: didConnectTag
summary: A event called when NFCNDEFReaderSession try to connect with NDEF tag
description: |
A tag stays connected until your app connects to a different tag or restarts polling. Connecting to a tag that is already connected has no effect.
platforms: [iphone, ipad]
properties:
- name: errorCode
type: Number
summary: The error code.
- name: errorDescription
type: String
summary: A string containing the localized description of the error.
- name: errorDomain
type: String
summary: A string containing the error domain.

- name: didQueryNDEFStatus
summary: Asks the reader session for the NDEF support status of the tag.
description: |
Asks the reader session (NFCNDEFReaderSession) for the NDEF support status of the tag.
platforms: [iphone, ipad]
properties:
- name: errorCode
type: Number
summary: The error code.
- name: errorDescription
type: String
summary: A string containing the localized description of the error.
- name: errorDomain
type: String
summary: A string containing the error domain.
- name: status
type: Number
summary: Constants that indicate status for an NDEF tag.
- name: capacity
type: Number
summary: Indicates the maximum NDEF message size, in bytes, that you can store on the tag.

- name: didReadNDEFMessage
summary: Retrieves an NDEF message from the tag.
description: |
Retrieves an NDEF message from the tag.
platforms: [iphone, ipad]
properties:
- name: errorCode
type: Number
summary: The error code.
- name: errorDescription
type: String
summary: A string containing the localized description of the error.
- name: errorDomain
type: String
summary: A string containing the error domain.
- name: message
type: Modules.Nfc.NdefMessage
summary: An NFC NDEF message consisting of an array of payload records.

- name: didWirteNDEFMessage
summary: Saves an NDEF message to a writable tag.
description: |
To determine whether the tag is writable, call queryNDEFStatus and check that the status is NFC_NDEF_READ_WRITE.
platforms: [iphone, ipad]
properties:
- name: errorCode
type: Number
summary: The error code.
- name: errorDescription
type: String
summary: A string containing the localized description of the error.
- name: errorDomain
type: String
summary: A string containing the error domain.

- name: didWriteLock
summary: Changes the NDEF tag status to read-only, preventing future write operations.
description: |
Calling this method updates the write access condition byte in the NDEF File Control of the tag's file system, thus locking the tag. This is a permanent action that you cannot undo. After locking the tag, you can no longer write data to it.
platforms: [iphone, ipad]
properties:
- name: errorCode
type: Number
summary: The error code.
- name: errorDescription
type: String
summary: A string containing the localized description of the error.
- name: errorDomain
type: String
summary: A string containing the error domain.

10 changes: 9 additions & 1 deletion apidoc/NfcTag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: |
[Tag](http://developer.android.com/reference/android/nfc/Tag.html)
extends: Titanium.Proxy
since: "1.0.0"
platforms: [android]
platforms: [android, iphone]
createable: false

methods:
Expand All @@ -20,6 +20,14 @@ methods:
returns:
type: Array<String>

- name: available
summary: Returns if the tag is available in current session
platforms: [iphone]
returns:
type: Number



properties:
- name: id
summary: Tag identifier (if it has one)
Expand Down
18 changes: 18 additions & 0 deletions ios/Classes/TiNfcFTagTechnology.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* Axway Titanium
* Copyright (c) 2009-present by Axway Appcelerator. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*/

#import "TiNfcNativeTagTechnologyProxy.h"
#import <CoreNFC/CoreNFC.h>
#import <TitaniumKit/TitaniumKit.h>

NS_ASSUME_NONNULL_BEGIN

@interface TiNfcFTagTechnology : TiNfcNativeTagTechnologyProxy

@end

NS_ASSUME_NONNULL_END
12 changes: 12 additions & 0 deletions ios/Classes/TiNfcFTagTechnology.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* Axway Titanium
* Copyright (c) 2009-present by Axway Appcelerator. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*/

#import "TiNfcFTagTechnology.h"

@implementation TiNfcFTagTechnology

@end
17 changes: 17 additions & 0 deletions ios/Classes/TiNfcISODepTagTechnology.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* Axway Titanium
* Copyright (c) 2009-present by Axway Appcelerator. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*/

#import "TiNfcNativeTagTechnologyProxy.h"
#import <CoreNFC/CoreNFC.h>
#import <TitaniumKit/TitaniumKit.h>

NS_ASSUME_NONNULL_BEGIN

@interface TiNfcISODepTagTechnology : TiNfcNativeTagTechnologyProxy
@end

NS_ASSUME_NONNULL_END
12 changes: 12 additions & 0 deletions ios/Classes/TiNfcISODepTagTechnology.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* Axway Titanium
* Copyright (c) 2009-present by Axway Appcelerator. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*/

#import "TiNfcISODepTagTechnology.h"

@implementation TiNfcISODepTagTechnology

@end
28 changes: 28 additions & 0 deletions ios/Classes/TiNfcMiFareUltralightTagTechnology.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* Axway Titanium
* Copyright (c) 2009-present by Axway Appcelerator. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*/

#import "TiNfcNativeTagTechnologyProxy.h"
#import <CoreNFC/CoreNFC.h>
#import <TitaniumKit/TitaniumKit.h>

NS_ASSUME_NONNULL_BEGIN

@interface TiNfcMiFareUltralightTagTechnology : TiNfcNativeTagTechnologyProxy

- (NSNumber *)mifareFamily;

- (TiBuffer *)identifier;

- (TiBuffer *)historicalBytes;

- (void)sendMiFareCommand:(id)args;

- (void)sendMiFareISO7816Command:(id)args;

@end

NS_ASSUME_NONNULL_END
Loading

0 comments on commit 33685e8

Please sign in to comment.