You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 14, 2020. It is now read-only.
Hi,
I want to get more data from the users who login with their account, like email, profile pic so I can store them in the Parse Server. After logged in successfully using
loginwithtwitterbtn.setOnClickListener {
ParseTwitterUtils.logIn(this@Login, com.parse.LogInCallback { user, err ->
if (err != null) {
ParseUser.logOut()
Log.e("err", "err", err)
}
when {
user == null -> {
ParseUser.logOut()
Toast.makeText(this@Login, "The user cancelled the Twitter login.", Toast.LENGTH_LONG).show()
Log.d("MyApp", "Uh oh. The user cancelled the Twitter login.")
}
user.isNew -> {
Toast.makeText(this@Login, "User signed up and logged in through Twitter.", Toast.LENGTH_LONG).show()
val d = Log.d("MyApp", "User signed up and logged in through Twitter!")
getTwitterData()
user.saveInBackground { e ->
if (null == e) {
alertDisplayer("First time login!", "Welcome!")
} else {
ParseUser.logOut()
Toast.makeText(this@Login, "It was not possible to save your username.", Toast.LENGTH_LONG).show()
}
}
}
else -> {
Toast.makeText(this@Login, "User logged in through Twitter.", Toast.LENGTH_LONG).show()
Log.d("MyApp", "User logged in through Twitter!")
alertDisplayer("Oh, you!", "Welcome back!")
}
}
})
}
How can I take more informations if there is no .signRequest to request them like below ?
val twitter = ParseTwitterUtils.getTwitter()
val infoGetUrl = "https://api.twitter.com/1.1/users/show.json?user_id=" + twitter.getUserId()
object:AsyncTask<Void, Void, Bundle>() {
internal var twitterBundle = Bundle()
protected fun doInBackground(vararg params:Void):Bundle {
val twitter = ParseTwitterUtils.getTwitter()
val client = DefaultHttpClient()
val verifyGet = HttpGet(String.format(infoGetUrl, twitter.getScreenName()))
twitter.signRequest(verifyGet)
try
{
val response = client.execute(verifyGet)
val `object` = JSONObject(EntityUtils.toString(response.getEntity()))
if (`object`.getString("profile_image_url") != null)
twitterBundle.putString(ParseTables.Users.IMAGE, `object`.getString("profile_image_url").replace("_normal", ""))
if (`object`.getString("profile_background_image_url") != null)
twitterBundle.putString(ParseTables.Users.COVER, `object`.getString("profile_background_image_url"))
if (`object`.getString("name") != null)
twitterBundle.putString(ParseTables.Users.NAME, `object`.getString("name"))
if (`object`.getString("screen_name") != null)
{
twitterBundle.putString(ParseTables.Users.USERNAME, `object`.getString("screen_name"))
}
return twitterBundle
}
catch (e:Exception) {
}
return null
}
protected fun onPostExecute(twitterBundle:Bundle) {
showSignUpFragment(twitterBundle)
}
}.execute()
What is the equivalent of ParseTwitterUtils.getTwitter().signRequest in the newer versions? Because it doesn't exist after 1.11.0 version
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi,
I want to get more data from the users who login with their account, like email, profile pic so I can store them in the Parse Server. After logged in successfully using
How can I take more informations if there is no .signRequest to request them like below ?
What is the equivalent of ParseTwitterUtils.getTwitter().signRequest in the newer versions? Because it doesn't exist after 1.11.0 version
The text was updated successfully, but these errors were encountered: