Created
September 12, 2014 16:36
-
-
Save autonome/bdf2f72e4511fa899418 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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