react-native-nfc-manager 3.14.6 → 3.14.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -948,34 +948,6 @@ class NfcManager extends ReactContextBaseJavaModule implements ActivityEventList
|
|
|
948
948
|
}
|
|
949
949
|
}
|
|
950
950
|
|
|
951
|
-
@ReactMethod
|
|
952
|
-
public void setNdefPushMessage(ReadableArray rnArray, Callback callback) {
|
|
953
|
-
synchronized(this) {
|
|
954
|
-
if (techRequest == null && writeNdefRequest == null) {
|
|
955
|
-
try {
|
|
956
|
-
Activity currentActivity = getCurrentActivity();
|
|
957
|
-
if (currentActivity == null) {
|
|
958
|
-
throw new RuntimeException("cannot get current activity");
|
|
959
|
-
}
|
|
960
|
-
|
|
961
|
-
NdefMessage msgToPush = null;
|
|
962
|
-
if (rnArray != null) {
|
|
963
|
-
msgToPush = new NdefMessage(rnArrayToBytes(rnArray));
|
|
964
|
-
}
|
|
965
|
-
|
|
966
|
-
NfcAdapter nfcAdapter = NfcAdapter.getDefaultAdapter(context);
|
|
967
|
-
nfcAdapter.setNdefPushMessage(msgToPush, currentActivity);
|
|
968
|
-
callback.invoke();
|
|
969
|
-
} catch (Exception ex) {
|
|
970
|
-
Log.d(LOG_TAG, ex.toString());
|
|
971
|
-
callback.invoke(ex.toString());
|
|
972
|
-
}
|
|
973
|
-
} else {
|
|
974
|
-
callback.invoke(ERR_MULTI_REQ);
|
|
975
|
-
}
|
|
976
|
-
}
|
|
977
|
-
}
|
|
978
|
-
|
|
979
951
|
@ReactMethod
|
|
980
952
|
public void start(Callback callback) {
|
|
981
953
|
NfcAdapter nfcAdapter = NfcAdapter.getDefaultAdapter(context);
|
package/package.json
CHANGED
package/src/NfcManagerAndroid.js
CHANGED
|
@@ -77,8 +77,9 @@ class NfcManagerAndroid extends NfcManagerBase {
|
|
|
77
77
|
getLaunchTagEvent = () =>
|
|
78
78
|
handleNativeException(callNative('getLaunchTagEvent'));
|
|
79
79
|
|
|
80
|
-
setNdefPushMessage = (bytes) =>
|
|
81
|
-
|
|
80
|
+
setNdefPushMessage = (bytes) => {
|
|
81
|
+
return Promise.reject('this api is deprecated');
|
|
82
|
+
}
|
|
82
83
|
|
|
83
84
|
setTimeout = (timeout) =>
|
|
84
85
|
handleNativeException(callNative('setTimeout', [timeout]));
|