Skip to content

Instantly share code, notes, and snippets.

@autonome
Created September 12, 2014 16:36
Show Gist options
  • Save autonome/bdf2f72e4511fa899418 to your computer and use it in GitHub Desktop.
Save autonome/bdf2f72e4511fa899418 to your computer and use it in GitHub Desktop.
if (navigator.mozSetMessageHandler) {
function NFCActivityHandler(activity) {
var text = activity.source.data.text;
if (!text) {
updateText('No text record')
}
else if (text.indexOf('bcm:') === 0) {
var email = text.substr(4)
registerRider(email)
updateText('Registered ' + email)
}
else {
updateText(text)
}
}
navigator.mozSetMessageHandler('activity', NFCActivityHandler);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment