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
If FB.JustDisconnected Then 'JustDisconnected property will be set to true only when disconnected once
Msgbox("Bye bye!", "JustDisconnected!")
End If
End Sub
Common.mFB.Login(Array As String ("email"))
Common.mFB.RequestPublishPermissions
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
Common.mFB.SetActivity(CurrentActivity.Initialize("facebook_statuschanged_event"))
End Sub
Sub facebook_statuschanged_event
If Common.mFB.JustConnected Then
Common.mFB.RequestPublishPermissions
End If
End Sub