Dim Result As FacebookResult = Main.FB.PublishPost("Confira o aplicativo que distribui dinheiro pela cidade. Lançamento em BREVE!!!","http://www.vallow.com.br/achouganhou/", "http://www.vallow.com.br/achouganhou/compartilhar.jpg" ,"Achou Ganhou", Null, "O aplicativo que distribui dinheiro pela cidade confira!")
If Result.Success = True Then
updatecompartilhou
Else
Msgbox("Não foi possível compartilhar! tente novamente","Achou Ganhou")
End If
Now, there is 1 zip file that contains all samples and the wrapper.
There is no need now to manually call Facebook.Me, since the logged-in user's details will be fetched automatically whenever the system gets an access token
The previously Facebook.Me Method is now a Map object, and there is a new Facebook.GetMe method instead
There is a new Facebook.JustLoggedIn property that will be set once when connected and will ensure that Facebook.Me has all logged in user details.
All samples updated.
Various bug fixes
Important: The Facebook Object MUST be declared in Sub Process_Globals
How to use FB.JustConnected and Facebook.Me:
B4X:
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Public FB As Facebook
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim CurrentActivity As FacebookActivity
End Sub
Sub Activity_Resume
FB.SetActivity(CurrentActivity.Initialize("facebook_statuschanged_event"))
End Sub
Sub facebook_statuschanged_event
'Access FB public properties and update UI accordingly when session changes
If FB.JustConnected Then 'JustConnected property will be set to true only when connected once
Msgbox(FB.Me, "JustConnected!") 'FB.Me is a Map object that contains all user details
End If
End Sub
This is by facebook design and occurs if you haven't previously requested publish permissions.
Do a Facebook.RequestPublishPermissions first and then call Facebook.UploadPhoto or Facebook.UploadVideo.
Also, Facebook.UploadPhoto currently does not take an AlbumId as a parameter resulting in uploading to an app specific album (called "<appname>'s Photos"). Next wrapper update will introduce managing albums and photos functionality as well as specifying an AlbumId when using Facebook.UploadPhoto.
Added: extra parameter AlbumId (returned by Facebook.CreateAlbum and Facebook.GetAlbum) to Facebook.UploadPhoto. Set it to "" to upload to the app's default album
All "please-wait" dialogs are now cancelable. If user cancels, Facebook.Result.Canceled will be true
Added: upload progress while uploading
Samples updated.
Note: When uploading files from Assets there will be only an indeterminate progress bar with bytes uploaded shown, since there is no way to get the size of a file in assets (they are compressed resources)
@brelto85 No worries. What is shown and when is handled internally by the facebook SDK and the installed facebook app. The end-user logic is always the same. You don't have to change the login logic in your code.