diff --git a/android/src/main/java/community/revteltech/nfc/NfcManager.java b/android/src/main/java/community/revteltech/nfc/NfcManager.java index 249d426a..f2b6d7dc 100644 --- a/android/src/main/java/community/revteltech/nfc/NfcManager.java +++ b/android/src/main/java/community/revteltech/nfc/NfcManager.java @@ -948,34 +948,6 @@ public void requestNdefWrite(ReadableArray rnArray, ReadableMap options, Callbac } } - @ReactMethod - public void setNdefPushMessage(ReadableArray rnArray, Callback callback) { - synchronized(this) { - if (techRequest == null && writeNdefRequest == null) { - try { - Activity currentActivity = getCurrentActivity(); - if (currentActivity == null) { - throw new RuntimeException("cannot get current activity"); - } - - NdefMessage msgToPush = null; - if (rnArray != null) { - msgToPush = new NdefMessage(rnArrayToBytes(rnArray)); - } - - NfcAdapter nfcAdapter = NfcAdapter.getDefaultAdapter(context); - nfcAdapter.setNdefPushMessage(msgToPush, currentActivity); - callback.invoke(); - } catch (Exception ex) { - Log.d(LOG_TAG, ex.toString()); - callback.invoke(ex.toString()); - } - } else { - callback.invoke(ERR_MULTI_REQ); - } - } - } - @ReactMethod public void start(Callback callback) { NfcAdapter nfcAdapter = NfcAdapter.getDefaultAdapter(context); diff --git a/src/NfcManagerAndroid.js b/src/NfcManagerAndroid.js index 65c5d160..6724f614 100644 --- a/src/NfcManagerAndroid.js +++ b/src/NfcManagerAndroid.js @@ -77,8 +77,9 @@ class NfcManagerAndroid extends NfcManagerBase { getLaunchTagEvent = () => handleNativeException(callNative('getLaunchTagEvent')); - setNdefPushMessage = (bytes) => - handleNativeException(callNative('setNdefPushMessage', [bytes])); + setNdefPushMessage = (bytes) => { + return Promise.reject('this api is deprecated'); + } setTimeout = (timeout) => handleNativeException(callNative('setTimeout', [timeout]));