Last active
August 29, 2015 14:01
-
-
Save TheRyanHickman/a471674792f61453dd95 to your computer and use it in GitHub Desktop.
Using facebook connect with Parse + Appcelerator on Android
This file contains 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
var parseLoginCheck = function(APP_ID, REST_KEY, u, p, success, error) { | |
/* ****************************************** | |
* | |
* Alternative Login for Parse (Android Specific) | |
* | |
*/ | |
var request = Ti.Network.createHTTPClient(); | |
request.onerror = function(e) | |
{ | |
console.log(e); | |
error(e); | |
}; | |
request.onload = function(e){ | |
success(e); | |
}; | |
request.open('GET', 'https://api.parse.com/1/login', true); | |
request.setRequestHeader('X-Parse-Application-Id', APP_ID); | |
request.setRequestHeader('X-Parse-REST-API-Key', REST_KEY); | |
request.setRequestHeader('Content-Type', 'application/json'); | |
var params = {}; | |
params.username = u; | |
params.password= p; | |
request.send(params); | |
}; | |
module.exports = parseLoginCheck; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use this function to determine if a user exists with android