First step is always to add the extension to your development environment. To do this use the tutorial located here.
Many of our extensions use some common libraries, for example, the Android Support libraries.
We have to separate these libraries into separate extensions in order to avoid multiple versions of the libraries being included in your application and causing packaging conflicts. This means that you need to include some additional extensions in your application along with the main extension file.
You will add these extensions as you do with any other extension, and you need to ensure it is packaged with your application.
The Core extension is required by this extension. You must include this extension in your application.
The Core extension doesn't provide any functionality in itself but provides support libraries and frameworks used by our extensions. It also includes some centralised code for some common actions that can cause issues if they are implemented in each individual extension.
You can access this extension here: https://github.com/distriqt/ANE-Core.
The following should be added to your
extensions node in your application descriptor to identify all the required ANEs in your application:
At a minimum you must add the NFC permission and include the
NFCActionActivity activity in your manifest application.
We also recommend setting the minimum SDK to 19.
You can optionally add the
uses-feature tag which will make sure your application is only installed on devices that have NFC hardware.
If you are planning on getting your application to launch from a tag you will need to add some intent filters to the activity tag. See the documentation on scanning for more information on the format of the intent filters.
Firstly you will need to update your provisioning profile to enable NFC features in your application.
To do this, login to the Apple developer program and navigate to the "Certificates, Identifiers & Profiles" section. Select your application identifier and edit the application services:
You will need to enable "NFC Tag Reading" :
Once enabled, you will need to regenerate your provisioning profiles and download them for your AIR application.
Info Additions and Entitlements
There are several additions required to enable NFC scanning on iOS. Firstly the usage description tag to the info additions, this is displayed to the user when starting a scan to inform the user why your application is scanning NFC tags in the foreground.
You will also need to add the following to the entitlements section to specify the tag formats the application accepts, currently iOS only supports
If you are using univeral links to background scan on iOS you need to add the domain for each univeral link to the entitlements section:
Note: iOS requires that you have a universal link setup to launch your application, and that the data in the tag contains this url.
To setup universal links you can follow the Apple documentation here.
You should always check whether the extension is supported before making calls. This allows you to react to whether the functionality is available on the device.