Skip to content

Commit

Permalink
Merge pull request #738 from tastydev/main
Browse files Browse the repository at this point in the history
feat(NfcManagerIOS): bind native session available methods
  • Loading branch information
whitedogg13 authored Jul 18, 2024
2 parents 0f06c0b + f24790a commit b2a37d5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,8 @@ declare module 'react-native-nfc-manager' {
setAlertMessageIOS: (alertMessage: string) => Promise<void>;
invalidateSessionIOS: () => Promise<void>;
invalidateSessionWithErrorIOS: (errorMessage: string) => Promise<void>;
isSessionAvailableIOS: () => Promise<Boolean>;
isTagSessionAvailableIOS: () => Promise<Boolean>;
sendMifareCommandIOS: (bytes: number[]) => Promise<number[]>;
sendFelicaCommandIOS: (bytes: number[]) => Promise<number[]>;
sendCommandAPDUIOS: (
Expand Down
6 changes: 6 additions & 0 deletions src/NfcManagerIOS.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ class NfcManagerIOS extends NfcManagerBase {
callNative('invalidateSessionWithError', [errorMessage]),
);

isSessionAvailableIOS = async () =>
handleNativeException(callNative('isSessionAvailable'));

isTagSessionAvailableIOS = async () =>
handleNativeException(callNative('isTagSessionAvailable'));

// -------------------------------------
// (iOS) NfcTech.MifareIOS API
// -------------------------------------
Expand Down

0 comments on commit b2a37d5

Please sign in to comment.