@iotize/device-com-nfc.cordova 3.9.2 → 3.9.4
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.
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iotize/device-com-nfc.cordova",
|
|
3
3
|
"main": "bundles/iotize-device-com-nfc.cordova.umd.js",
|
|
4
|
-
"version": "3.9.
|
|
4
|
+
"version": "3.9.4",
|
|
5
5
|
"description": "Near Field Communication (NFC) Plugin. Read and write NDEF messages to NFC tags and share NDEF messages with peers.",
|
|
6
6
|
"cordova": {
|
|
7
7
|
"id": "@iotize/device-com-nfc.cordova",
|
package/src/android/build.gradle
CHANGED
|
@@ -508,7 +508,11 @@ public class NfcPlugin extends CordovaPlugin {
|
|
|
508
508
|
} catch (SecurityException e) {
|
|
509
509
|
callbackContext.error("NFC Tag lost!");
|
|
510
510
|
} catch (Throwable e) {
|
|
511
|
-
|
|
511
|
+
String errorMessage = e.getMessage();
|
|
512
|
+
if (errorMessage == null) {
|
|
513
|
+
errorMessage = "NFC Tag lost!";
|
|
514
|
+
}
|
|
515
|
+
callbackContext.error(errorMessage);
|
|
512
516
|
}
|
|
513
517
|
});
|
|
514
518
|
}
|
|
@@ -68,7 +68,7 @@ extension NFCNDEFMessage {
|
|
|
68
68
|
|
|
69
69
|
func ndefToNSDictionary(record: NFCNDEFPayload) -> NSDictionary {
|
|
70
70
|
let dict = NSMutableDictionary()
|
|
71
|
-
dict.setObject(
|
|
71
|
+
dict.setObject(record.typeNameFormat.rawValue, forKey: "tnf" as NSString)
|
|
72
72
|
dict.setObject([UInt8](record.type), forKey: "type" as NSString)
|
|
73
73
|
dict.setObject([UInt8](record.identifier), forKey: "id" as NSString)
|
|
74
74
|
dict.setObject([UInt8](record.payload), forKey: "payload" as NSString)
|