mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-02-21 00:23:00 +08:00
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:
parent
99cebcba0b
commit
2aa73b5546
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user