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
Developer
Posts: 41
Registered: ‎02-06-2013
My Device: Developer - BB10 Dev B
My Carrier: Rogers
Accepted Solution

Invoke framework to share via NFC

I have a webworks application successfully handling nfc reading via the invoked api, but need to write out simple text back to the tags. I see that nfc support is not coming any time soon

 

https://github.com/blackberry/BB10-WebWorks-Framework/issues/568

 

So my question is regarding the use of the invoke framework to write the tag. I have tested the cascades sample applications (NFCTool and specifically NFCToolLite) that do exactly what I need. NFCToolLite uses the invoke framework to share text to a tag.

 

I've tried many combinations of target, action, and type based around

Target: "sys.NFCViewer", action:"bb.action.SHARE", and type and uri: "application/vnd.rim.nfc.ndef" and "ndef://2/text/"

 

With no luck. Is their anything I can do to share text nfc tags from within webworks short of trying to write my own native extension?

 

Developer
Posts: 1,229
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C
My Carrier: 3, Orange, Vodafone

Re: Invoke framework to share via NFC

Can I suggest you get Martin Wooley in on this as he's the main NFC guy @ BB

 

For my part I'll nag my contacts to get this thread serious attention

 

Like you I wish we had good NFC for WW

 




Click the like button if you find my posts useful!
Retired
Posts: 418
Registered: ‎07-18-2012
My Device: Q10
My Carrier: Bell Canada

Re: Invoke framework to share via NFC

[ Edited ]
check out the sample code I wrote here; https://github.com/blackberry/BB10-WebWorks-Community-Samples/blob/master/nfc/ndefTagReading code is there to parse and construct NDEF tags, easy access to content of well known tags, byte level access to custom... (and writing via invoke)
--
Rob is no longer associated with BlackBerry.
Developer
Posts: 1,229
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C
My Carrier: 3, Orange, Vodafone

Re: Invoke framework to share via NFC

Cool

 

Just the kinda thing we need

 

One problem with doing BB is that sometimes there's something like this but its not widely known

 

Can I suggest a new sticky so that when this kind of thing happens those of us who want to keep on top of the game can find it all in one place

 

 




Click the like button if you find my posts useful!
Developer
Posts: 41
Registered: ‎02-06-2013
My Device: Developer - BB10 Dev B
My Carrier: Rogers

Re: Invoke framework to share via NFC

[ Edited ]

Edited: I'm going through your code more closely now. I think you have it pinned down. Will respond shortly

Developer
Posts: 41
Registered: ‎02-06-2013
My Device: Developer - BB10 Dev B
My Carrier: Rogers

Re: Invoke framework to share via NFC

Having tested the solution, it works great on my dev alpha.

HOWEVER:

 

Simulating under BB10 Simulator 10.0.10.261 throws INVOKE_NO_TARGET_ERROR when trying to share. I will open a bug under the webworks framework github. I'm also passing on your solution to the phonegap nfc plugin author

Retired
Posts: 418
Registered: ‎07-18-2012
My Device: Q10
My Carrier: Bell Canada

Re: Invoke framework to share via NFC

Sounds like a missing part of the simulator - not a WebWorks issue...

--
Rob is no longer associated with BlackBerry.
Developer
Posts: 41
Registered: ‎02-06-2013
My Device: Developer - BB10 Dev B
My Carrier: Rogers

Re: Invoke framework to share via NFC

Does the simulator team have a public bug tracker? Or someone to contact and inform? You can use the same framework through Cascades and it works fine in the simulator but not through webworks.
Highlighted
Retired
Posts: 418
Registered: ‎07-18-2012
My Device: Q10
My Carrier: Bell Canada

Re: Invoke framework to share via NFC

Oh! I didn't think that would work!

 

Any bug you log in Jira should get escalated to the correct team.

--
Rob is no longer associated with BlackBerry.