Git Product home page Git Product logo

Comments (13)

JohnMcLear avatar JohnMcLear commented on July 25, 2024

+1 for a solution :)

from phonegap-nfc.

don avatar don commented on July 25, 2024

Given a tag with a URI - TNF_WELL_KNOWN, Type U, Payload http://windowsphone.com

My WP8 code can read NFC tags OK with the following

proximityDevice.SubscribeForMessage("NDEF", MessageReceivedHandler);

MessageReceivedHandler manually parses the NDEF message

The problem is that even though my app is running, WP8 prompts the user "Receive content? Someone is sharing a website from windowsphone.com with you." This WP8 dialog shows up over my app.

When my app is running in the foreground I want WP8 to ignore NFC tags. (This is what Android does with foreground dispatch.)

I tried adding additional subscribers for "Windows", "WindowsURI" but that didn't work either. I need something like Javascript's e.preventDefault().

from phonegap-nfc.

JohnMcLear avatar JohnMcLear commented on July 25, 2024

I assume you took a read through https://ndef.codeplex.com/ ?

from phonegap-nfc.

JohnMcLear avatar JohnMcLear commented on July 25, 2024

Half way down this page: http://developer.nokia.com/Community/Wiki/Windows_Phone_8:_Treasure_Hunt_Application_Example_using_NFC_and_Nokia_Maps_API

Search for "using Windows.Networking.Proximity;"

from phonegap-nfc.

don avatar don commented on July 25, 2024

@JohnMcLear Just tried the NDEF Demo example from ndef on codeplex. It has the same problem when scanning a URI tag. The app reads the tag, but so does WP8, so the user gets a dialog box over the app.

wp_ss_20131002_0003
wp_ss_20131002_0004

from phonegap-nfc.

JohnMcLear avatar JohnMcLear commented on July 25, 2024

oh boy ;\ looks like that's the best experience we can get now then?

from phonegap-nfc.

don avatar don commented on July 25, 2024

The Nokia NFC Write app is able to suppress WP8 from reading tags while it is writing to a tag
http://www.windowsphone.com/en-gb/store/app/nokia-nfc-writer/709e64e0-5849-4ce4-b252-b7b252aefacf

from phonegap-nfc.

JohnMcLear avatar JohnMcLear commented on July 25, 2024

Just an update, me and don both bumped folks at MS and NOK about this issue, we're awaiting a response.

from phonegap-nfc.

don avatar don commented on July 25, 2024

http://msdn.microsoft.com/en-us/library/windows/apps/hh701129.aspx

Windows will always handle "WindowsUri" messages by prompting the user to view a received URI ... even if another app is also subscribed to "WindowsUri".

Windows will always handle "WindowsMime" messages by prompting the user to view the mime content that was received, even if an app is also subscribed for the mime content.

from phonegap-nfc.

JohnMcLear avatar JohnMcLear commented on July 25, 2024

Testing other apps:

http://www.windowsphone.com/en-us/store/app/nfc-publisher-pro/45f5f690-c894-4087-9cc0-708d7624b886 manages to suppress during write, not during read. <-- might be worth contacting this author? -- appears to be the case that if you are publishing at the time it will suppress a message? [email protected] being their email

https://projects.developer.nokia.com/nfctagreader does not suppress on read

http://www.windowsphone.com/en-gb/store/app/nfc-tag-writer/895711f1-2b38-4af1-8780-f6501f4371e0 does not suppress on read/write

from phonegap-nfc.

don avatar don commented on July 25, 2024

@JohnMcLear it is probably fine to call nfc.write(message, success, failure) anytime on WP8, since WP8 probably doesn't attempt the write until a tag is in range. Android is different where nfc.write must be called from inside the callback when a NFC tag is in range. I'll see if that works, then figure out the correct way to document it or change the code.

from phonegap-nfc.

JohnMcLear avatar JohnMcLear commented on July 25, 2024

+1 @don -- Thanks

from phonegap-nfc.

don avatar don commented on July 25, 2024

Documentation looks OK https://github.com/chariotsolutions/phonegap-nfc#nfcwrite

from phonegap-nfc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.