mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-03-13 06:01:04 +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 24a893fdcf6c445be0cd97a0d6e4645a4b9f2bb8. * 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…
x
Reference in New Issue
Block a user