Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Contributor
christylele
Posts: 16
Registered: ‎08-14-2012
My Carrier: China unicom

[HELP]Is there a way to Invoke NFC APIS in BlackBerry 10 Webworks(Html5 Development) ?

[ Edited ]

Hello Everyone.

 

Currently I am testing some Apps On my BlackBerry 10 Dev Alpha.

 

My Question Is: Are  there some ways to Invoke NFC APIs in BlackBerry 10 Webworks(HTML5) Platform?

 

Such as Reading Tags or Writing Tags.

 

Higly Appreciated if anyone can help me.~~~ 

Please use plain text.
Developer
Developer
LBP
Posts: 607
Registered: ‎04-29-2011
My Carrier: none

Re: [HELP]Is there a way to Invoke NFC APIS in BlackBerry 10 Webworks(Html5 Development) ?

Read and Write NFC APIs are missing so far in WebWorks, but with the help of an Native-to-WebWorks extension you are able to make it working. For WebWorks extensions in BB10 have a closer look at this thread I reported about an example already available on github and how to get it running right now with a small fix: http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/BB10-WebWorks-Extensions/td-p/17...

 

Then there is the possibility to set up an app to be invoked when NFC tags are recognized by BB10 device. You could try the invokable example here: https://github.com/blackberry/BB10-WebWorks-Samples/tree/master/invoke

You need to change the config.xml to be invoked on NFC tags by adding this:

 

<rim:invoke-target id="example.NFCInvokable.app">
	<type>APPLICATION</type>
	<filter>
		<action>bb.action.OPEN</action>
		<mime-type>application/vnd.rim.nfc.ndef.1.Sp</mime-type>
		<mime-type>application/vnd.rim.nfc.ndef.1.T</mime-type>
		<mime-type>application/vnd.rim.nfc.ndef.1.U</mime-type>
		<mime-type>application/vnd.rim.nfc.ndef.4</mime-type>
	</filter>
</rim:invoke-target>

 

To read and write NFC, for now, there is an example written in Cascades: https://github.com/blackberry/Cascades-Community-Samples/tree/master/NfcTool


"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
Please use plain text.
Contributor
christylele
Posts: 16
Registered: ‎08-14-2012
My Carrier: China unicom

Re: [HELP]Is there a way to Invoke NFC APIS in BlackBerry 10 Webworks(Html5 Development) ?

Is there an example of Reading tags through  Webworks Extensions? Thank U


 

Please use plain text.
Developer
Developer
LBP
Posts: 607
Registered: ‎04-29-2011
My Carrier: none

Re: [HELP]Is there a way to Invoke NFC APIS in BlackBerry 10 Webworks(Html5 Development) ?

No. there isn't since there is not API to read and write NFC tags yet. Thats why I pointed out the invoker example. With the help of the invoker your app is opended when your device is reading NFC tags and is pointing ot it with the following data example:

 

action: "bb.action.OPEN"
background: "no"
data: "0QEaVAJlbkhlbGxvLCBJIGFtIGFuIE5GQyB0YWch"
target: "my.app"
type: "application/vnd.rim.nfc.ndef.1.T"

 So you get the "type" of the tag and the "data" written to it and can build something to read tags without waiting for the API or writing your own extension.

 


"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
Please use plain text.