When you start your app with an NFC intent you needed to write a bunch of boilerplate to make it work.
I changed this so that after you register NDEF with nfc.addNdefListener, the app launch parameters will trigger the success callback. Now you no longer need to write this code to listen for the activated event:
WinJS.Application.addEventListener("activated", function (eventArgs) {
if (eventArgs.detail.kind == Windows.ApplicationModel.Activation.ActivationKind.protocol) {
// eventArgs.detail.uri.rawUri;
}
}, false);
Nevermind... there isn't a good way to determine that this is a NDEF launch. It wouldn't make sense if the app started from some other means and triggered this.
When you start your app with an NFC intent you needed to write a bunch of boilerplate to make it work.
I changed this so that after you register NDEF with
nfc.addNdefListener
, the app launch parameters will trigger the success callback. Now you no longer need to write this code to listen for the activated event:I also reformatted the script.