ok, but i've a question.
The ActiveProvider in Social module, returns the provider that is connected
If in my preference activity i've connected two social (Facebook and twitter), it returns always the first
In your case, you should not use the Social.ActiveProvider at all since you can have more than 1 providers connected. Just address each Provider individually.
If you want to have a single share you can do this:
B4X:
Sub Share(Message as String, PathName As String, FileName As String)
If Social.Facebook.Connected Then
Social.Facebook.UploadPhoto(PathName, FileName, Message, "")
End If
If Social.Twitter.Connected Then
Social.Twitter.TweetMedia(Message, PathName, FileName)
End If
End Sub
ok, i changed it deleting the ActiveProvider reference but i don't understand why does not call the Provider_JustDisconnect method after Logout method
in addition, the provider_event fired for all providers declared (in my case two times for FAcebook and Twitter) after have clicked the checkbox Facebook Login (view my code)
It is normal to be fired for all providers. It is a measure to enforce a global UI update since the activity gets paused and resumed after a facebook logout.
Have you tested the sample2 APK? Have you checked the source in sample2.zip?
1. For the problem disconnect Facebook i don't know where is the cause. The code is the same
2. For the twitter the cause are my api keys. I've changed your keys with mine in sample2 and i have the same behaviors. After click Login, show the wait dialog and after that not appears anything. Probably is some settings in the developer console
i've notice the strange behavior
I've this scenario:
In main activity_resume event call the BindWithEvent method
After disconnect FacebookProvider into PreferenceActivity (that i've also here call the bindwithevent) open the main activiy and gets the "provider_justdisconnectd was not found" error
No sorry, i wrote wrong here. "....provider_justdisconnect was not found". the problem is that opened the Main activity as if the sender object was Main activity
1. For the problem disconnect Facebook i don't know where is the cause. The code is the same
2. For the twitter the cause are my api keys. I've changed your keys with mine in sample2 and i have the same behaviors. After click Login, show the wait dialog and after that not appears anything. Probably is some settings in the developer console
Thanks!! now works perfectly also the twitter login page is shown after update the twitter settings with Callback URL
but after inserted my credentials, appears also the facebook login without prompt any errors. my callback url is a real site ("http://altervista_site/") without specified the index page
@Periklis Koutsogiannis
hi man
i have a question
i m making login with google and facebook
i have a common with facebook and google declared
on my main i call
B4X:
Sub Activity_Resume
Common.Facebook.SetActivity(ThisActivityface.Initialize("facebook"))
Common.GooglePlus.SetActivity(ThisActivitygoogle.Initialize("googleplus"))
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub imgface_Click
Common.Facebook.Login(Array As String (Common.Facebook.Constants.Permissions.Email))
End Sub
Sub imggoogle_Click
Common.GooglePlus.Login
End Sub
ok
later i have this
B4X:
Sub Facebook_Connected (Provider As SocialApiProvider)
If Not(Common.Facebook.HasPermission(Common.Facebook.Constants.Permissions.PUBLISH_ACTIONS)) Then
Common.Facebook.RequestPublishPermissions
End If
idsocial = Provider.Me.Get("id")
confereusuario
End Sub
Sub Facebook_Disconnected (Provider As SocialApiProvider)
'here
End Sub
if user conected on facebook make this query
confereusuario
and this works fine ok
but when i go make a log out
B4X:
Sub Button1_Click
Common.Facebook.Logout
End Sub
when i click at Button1_Click to logout
execute this query again
confereusuario
why ? *-*
note my facebook disconect is empity
Sub Facebook_Disconnected (Provider As SocialApiProvider)
'here
End Sub