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
public void getOrCreateUser(final ParseUser parseUser, final String email, final ProgressDialog dialog){ | |
String URL = "https://example.co/api/accounts?email="+ email +"&action=get_or_create"; | |
JsonArrayRequest req = new JsonArrayRequest(URL, new com.android.volley.Response.Listener<JSONArray>() { | |
@Override | |
public void onResponse(JSONArray jsonArray) { | |
try { | |
JSONObject apiUser = jsonArray.getJSONObject(0); | |
parseUser.put("email", email); | |
parseUser.put("api_token", apiUser.getString("token")); | |
parseUser.put("api_id", apiUser.getInt("id")); |
NewerOlder