NFC

gjaman, working on writing feature at the moment.

max.srdk, it’s becoming \u000bú90 when you convert to JSON. You can convert the bytes representation to hexadecimal when you get the Lua table with the event.
If you convert the \u000bú90 value back to HEX you would get 000B 00FA 0039 0030, which is your starting value, but with extra zero bytes because of the unicode conversion.

Hi,

Any chance to get NFCA support ?

{  “id”:“Gx[Ä”,

  “name”:“nfc”,
  “tag”:{
    “id”:“Gx[Ä”,

    “toString”:“TAG: Tech [android.nfc.tech.NfcA]”,
    “techs”:[“android.nfc.tech.NfcA”]
  },
  “type”:“tag”,
  “isError”:false
}

Best regards.

Can I use it for write tag ?

shohoku-boy, yes, please see http://docs.spiralcodestudio.com/plugin/nfc/writeTag/

I have problem when init nfc plugin
runtime error with java.lang.NullPointerException
run on android version 4.2.2
 

https://drive.google.com/open?id=0B3Ve3AAODG0MRXoxZlFIX3JENFk

Here is error log from device with NFC Sample Project

ww808_emmc: main.lua:69: java.lang.NullPointerException
ww808_emmc: Java Stack Trace:
ww808_emmc:  android.nfc.NfcAdapter.enableForegroundDispatch(NfcAdapter.java:1184)
ww808_emmc:  plugin.nfc.LuaLoader.enableForegroundDispatch(LuaLoader.java:79)
ww808_emmc:  plugin.nfc.LuaLoader.init(LuaLoader.java:135)
ww808_emmc:  plugin.nfc.LuaLoader.access$900(LuaLoader.java:31)
ww808_emmc:  plugin.nfc.LuaLoader$InitWrapper.invoke(LuaLoader.java:470)
ww808_emmc:  com.ansca.corona.JavaToNativeShim.nativeResize(Native Method)
ww808_emmc:  com.ansca.corona.JavaToNativeShim.resize(JavaToNativeShim.java:381)
ww808_emmc:  com.ansca.corona.graphics.opengl.CoronaGLSurfaceView$CoronaRenderer.onSurfaceChanged(CoronaGLSurfaceView.java:378)
ww808_emmc:  com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1612)
ww808_emmc:  com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1378)
ww808_emmc: stack traceback:
ww808_emmc:  [C]: ?
ww808_emmc:  [C]: in function ‘init’
ww808_emmc:  main.lua:69: in main chunk

shohoku-boy, hi, thanks for the patience, I will look into it this weekend.

Thank you , Lerg

shohoku-boy, does it happen with the test project on github?
https://github.com/Lerg/plugins-sample-nfc

And what is your device?

Couldn’t figure out what could be wrong yet.

Here is my device information Lerg
https://www.dropbox.com/s/1ef29k3jld7iux5/Photo%2011-1-2560%20BE%2C%202%2022%2046%20AM.jpg?dl=0 
Hope you find it soon

Hi, 

I have a problem with the NFC, I read correctly the tag, but seems like the tag remains resident in the phone. I try to use the function nfc.releaseTag() but the stills remaining in the phone. How can I do to remove the tag? Is there any related issue with that?

Thanks.

lluispancorbo, hi, have you figured out your issue?

Updated NFC Plugin: Added iOS Support!

Please see the new documentation
http://docs.spiralcodestudio.com/plugin/nfc/

And updated sample app

https://github.com/Lerg/plugins-sample-nfc

Since the plugin is now complete, it will become paid soon.

Hi @Lerg,

I am getting this error when I upload iOS build.

ERROR ITMS-90163: “Invalid Code Signing Entitlements. The entitlements in your app bundle signature do not match the ones that are contained in the provisioning profile. The bundle contains a key that is not included in the provisioning profile: ‘com.apple.developer.nfc.readersession.formats’ in ‘Payload/MyApp.app/MyApp’.”

 

ERROR ITMS-90778: “Invalid entitlement for core nfc framework. The sdk version ‘13.2’ and min OS version ‘8.0’ are not compatible for the entitlement ‘com.apple.developer.nfc.readersession.formats’ because ‘TAG is missing in the entitlement’.”

–> I am using Corona Build: 2019.3555

Please help me to solve this issues.

Thank you.
Bhavin :slight_smile:

Something has changed at Apple. Try replacing
[‘com.apple.developer.nfc.readersession.formats’] = {‘NDEF’}
With

[‘com.apple.developer.nfc.readersession.formats’] = {‘TAG’}

in build.settings

Still Same errors.

Have you enabled NFC for your App Id at developer.apple.com?

ohhh , I have missed that very important thing to do.
After Update App id on developer.apple.com  it’s working.
But we have to add “TAG” and “NDEF” both in build.settings line like this :
 

['com.apple.developer.nfc.readersession.formats'] = {'TAG',"NDEF"}

Then upload success. 
Thank you for your Quick reply.