feat(nfc): add NFC readerMode (#2777)

* Work on NFC reader-mode

* Remove dist files, not needed in plugin development folder

* Revert package changes

This reverts part of commit 24a893fdcf.

* Update index.ts

* Correct the flags and return types for the wrapper

* Add reader flags.

Thanks @sfaizanh
This commit is contained in:
Stephen Wolff 2018-10-17 18:52:52 +01:00 committed by Daniel Sogl
parent 99cebcba0b
commit 2aa73b5546

View File

@ -76,6 +76,15 @@ export interface NdefTag {
*/
@Injectable()
export class NFC extends IonicNativePlugin {
FLAG_READER = {
NFC_A: 0,
NFC_B: 0x2,
NFC_F: 0x4,
NFC_V: 0x8,
NFC_BARCODE: 0x10,
SKIP_NDEF_CHECK: 0x80,
NO_PLATFORM_SOUNDS: 0x100,
};
/**
* Starts the NFCNDEFReaderSession allowing iOS to scan NFC tags.
* @param onSuccess
@ -286,6 +295,22 @@ export class NFC extends IonicNativePlugin {
bytesToHexString(bytes: number[]): string {
return;
}
/**
* Read NFC tags sending the tag data to the success callback.
*/
@Cordova({
observable: true,
successIndex: 1,
errorIndex: 4,
clearFunction: 'disableReaderMode',
clearWithArgs: true
})
readerMode(
flags: number,
readCallback?: Function,
errorCallback?: Function
): void { return; }
}
/**
* @hidden