public class VkSocialNetwork extends SocialNetwork
| Modifier and Type | Field and Description |
|---|---|
static int |
ID
Social network ID in asne modules, should be unique
|
BUNDLE_APP_NAME, BUNDLE_CAPTION, BUNDLE_LINK, BUNDLE_MESSAGE, BUNDLE_NAME, BUNDLE_PICTURE, DIALOG_FRIENDS, mGlobalListeners, mLocalListeners, mSharedPreferences, mSocialNetworkManager, REQUEST_ACCESS_TOKEN, REQUEST_ADD_FRIEND, REQUEST_CHECK_IS_FRIEND, REQUEST_GET_CURRENT_PERSON, REQUEST_GET_DETAIL_PERSON, REQUEST_GET_FRIENDS, REQUEST_GET_PERSON, REQUEST_GET_PERSONS, REQUEST_LOGIN, REQUEST_LOGIN2, REQUEST_POST_DIALOG, REQUEST_POST_LINK, REQUEST_POST_MESSAGE, REQUEST_POST_PHOTO, REQUEST_REMOVE_FRIEND| Constructor and Description |
|---|
VkSocialNetwork(android.support.v4.app.Fragment fragment,
java.lang.String key,
java.lang.String[] permissions) |
| Modifier and Type | Method and Description |
|---|---|
AccessToken |
getAccessToken()
Method to get AccessToken of VK social network
|
int |
getID()
Get id of VK social network
|
boolean |
isConnected()
Check is social network connected
|
void |
logout()
Logout from VK social network
|
void |
onActivityResult(int requestCode,
int resultCode,
Intent data)
Overrided for VK support
|
void |
onCreate(Bundle savedInstanceState)
Overrided for connect vk to activity
|
void |
onDestroy()
Overrided for VK support
|
void |
onResume()
Overrided for VK support
|
void |
requestAccessToken(OnRequestAccessTokenCompleteListener onRequestAccessTokenCompleteListener)
Request
AccessToken of VK social network that you can get from onRequestAccessTokenCompleteListener |
void |
requestAddFriend(java.lang.String userID,
OnRequestAddFriendCompleteListener onRequestAddFriendCompleteListener)
Invite friend by id to current user
|
void |
requestCheckIsFriend(java.lang.String userID,
OnCheckIsFriendCompleteListener onCheckIsFriendCompleteListener)
Check if user by id is friend of current user
|
void |
requestCurrentPerson(OnRequestSocialPersonCompleteListener onRequestSocialPersonCompleteListener)
Request current user
SocialPerson |
void |
requestDetailedSocialPerson(java.lang.String userId,
OnRequestDetailedSocialPersonCompleteListener onRequestDetailedSocialPersonCompleteListener)
Request user
VKPerson by userId - detailed user data |
void |
requestGetFriends(OnRequestGetFriendsCompleteListener onRequestGetFriendsCompleteListener)
Get current user friends list
|
void |
requestLogin(OnLoginCompleteListener onLoginCompleteListener)
Make login request - authorize in VK social network
|
void |
requestPostDialog(Bundle bundle,
OnPostingCompleteListener onPostingCompleteListener)
Not supported via vk sdk - in development
|
void |
requestPostLink(Bundle bundle,
java.lang.String message,
OnPostingCompleteListener onPostingCompleteListener)
Post link with comment to social network
|
void |
requestPostMessage(java.lang.String message,
OnPostingCompleteListener onPostingCompleteListener)
Post message to social network
|
void |
requestPostPhoto(java.io.File photo,
java.lang.String message,
OnPostingCompleteListener onPostingCompleteListener)
Post photo to social network
|
void |
requestRemoveFriend(java.lang.String userID,
OnRequestRemoveFriendCompleteListener onRequestRemoveFriendCompleteListener)
Remove friend by id from current user friends
|
void |
requestSocialPerson(java.lang.String userID,
OnRequestSocialPersonCompleteListener onRequestSocialPersonCompleteListener)
Request
SocialPerson by user id |
void |
requestSocialPersons(java.lang.String[] userID,
OnRequestSocialPersonsCompleteListener onRequestSocialPersonsCompleteListener)
Request ArrayList of
SocialPerson by array of userIds |
cancelAccessTokenRequest, cancelAddFriendRequest, cancelAll, cancelCheckIsFriendRequest, cancelGetCurrentPersonRequest, cancelGetDetailedSocialRequest, cancelGetFriendsRequest, cancelGetSocialPersonRequest, cancelGetSocialPersonsRequest, cancelLoginRequest, cancelPostDialogRequest, cancelPostLinkRequest, cancelPostMessageRequest, cancelPostPhotoRequest, cancelRemoveFriendRequest, checkRequestState, onPause, onSaveInstanceState, onStart, onStop, requestAccessToken, requestAddFriend, requestCheckIsFriend, requestCurrentPerson, requestDetailedCurrentPerson, requestDetailedCurrentPerson, requestDetailedSocialPerson, requestGetFriends, requestLogin, requestPostDialog, requestPostLink, requestPostMessage, requestPostPhoto, requestRemoveFriend, requestSocialPerson, requestSocialPersons, setOnCheckIsFriendListener, setOnLoginCompleteListener, setOnPostingDialogCompleteListener, setOnPostingLinkCompleteListener, setOnPostingMessageCompleteListener, setOnPostingPhotoCompleteListener, setOnRequestAccessTokenCompleteListener, setOnRequestAddFriendCompleteListener, setOnRequestCurrentPersonCompleteListener, setOnRequestDetailedSocialPersonCompleteListener, setOnRequestGetFriendsCompleteListener, setOnRequestRemoveFriendCompleteListener, setOnRequestSocialPersonCompleteListener, setOnRequestSocialPersonsCompleteListenerpublic static final int ID
public VkSocialNetwork(android.support.v4.app.Fragment fragment,
java.lang.String key,
java.lang.String[] permissions)
public boolean isConnected()
isConnected in class SocialNetworkpublic void requestLogin(OnLoginCompleteListener onLoginCompleteListener)
requestLogin in class SocialNetworkonLoginCompleteListener - listener to trigger when Login completepublic void logout()
logout in class SocialNetworkpublic int getID()
getID in class SocialNetworkpublic AccessToken getAccessToken()
getAccessToken in class SocialNetworkAccessTokenpublic void requestAccessToken(OnRequestAccessTokenCompleteListener onRequestAccessTokenCompleteListener)
AccessToken of VK social network that you can get from onRequestAccessTokenCompleteListenerrequestAccessToken in class SocialNetworkonRequestAccessTokenCompleteListener - listener for AccessToken requestpublic void requestCurrentPerson(OnRequestSocialPersonCompleteListener onRequestSocialPersonCompleteListener)
SocialPersonrequestCurrentPerson in class SocialNetworkonRequestSocialPersonCompleteListener - listener for SocialPerson requestpublic void requestSocialPerson(java.lang.String userID,
OnRequestSocialPersonCompleteListener onRequestSocialPersonCompleteListener)
SocialPerson by user idrequestSocialPerson in class SocialNetworkuserID - id of VK useronRequestSocialPersonCompleteListener - listener for SocialPerson requestpublic void requestSocialPersons(java.lang.String[] userID,
OnRequestSocialPersonsCompleteListener onRequestSocialPersonsCompleteListener)
SocialPerson by array of userIdsrequestSocialPersons in class SocialNetworkuserID - array of VK users idonRequestSocialPersonsCompleteListener - listener for array of SocialPerson requestpublic void requestDetailedSocialPerson(java.lang.String userId,
OnRequestDetailedSocialPersonCompleteListener onRequestDetailedSocialPersonCompleteListener)
VKPerson by userId - detailed user datarequestDetailedSocialPerson in class SocialNetworkuserId - id of VK useronRequestDetailedSocialPersonCompleteListener - listener for VKPerson requestpublic void requestPostMessage(java.lang.String message,
OnPostingCompleteListener onPostingCompleteListener)
requestPostMessage in class SocialNetworkmessage - message that should be sharedonPostingCompleteListener - listener for posting requestpublic void requestPostPhoto(java.io.File photo,
java.lang.String message,
OnPostingCompleteListener onPostingCompleteListener)
requestPostPhoto in class SocialNetworkphoto - photo that should be sharedmessage - message that should be shared with photoonPostingCompleteListener - listener for posting requestpublic void requestPostLink(Bundle bundle,
java.lang.String message,
OnPostingCompleteListener onPostingCompleteListener)
requestPostLink in class SocialNetworkbundle - bundle containing information that should be shared(Bundle constants in SocialNetwork)message - message that should be shared with bundleonPostingCompleteListener - listener for posting requestpublic void requestPostDialog(Bundle bundle,
OnPostingCompleteListener onPostingCompleteListener)
requestPostDialog in class SocialNetworkbundle - bundle containing information that should be shared(Bundle constants in SocialNetwork)onPostingCompleteListener - listener for posting requestSocialNetworkExceptionpublic void requestCheckIsFriend(java.lang.String userID,
OnCheckIsFriendCompleteListener onCheckIsFriendCompleteListener)
requestCheckIsFriend in class SocialNetworkuserID - user id that should be checked as friend of current useronCheckIsFriendCompleteListener - listener for checking friend requestpublic void requestGetFriends(OnRequestGetFriendsCompleteListener onRequestGetFriendsCompleteListener)
requestGetFriends in class SocialNetworkonRequestGetFriendsCompleteListener - listener for getting list of current user friendspublic void requestAddFriend(java.lang.String userID,
OnRequestAddFriendCompleteListener onRequestAddFriendCompleteListener)
requestAddFriend in class SocialNetworkuserID - id of user that should be invitedonRequestAddFriendCompleteListener - listener for invite resultpublic void requestRemoveFriend(java.lang.String userID,
OnRequestRemoveFriendCompleteListener onRequestRemoveFriendCompleteListener)
requestRemoveFriend in class SocialNetworkuserID - user id that should be removed from friendsonRequestRemoveFriendCompleteListener - listener to remove friend request responsepublic void onCreate(Bundle savedInstanceState)
onCreate in class SocialNetworksavedInstanceState - If the activity is being re-initialized after previously being shut down then this Bundle contains the data it most recently supplied in onSaveInstanceState(Bundle). Note: Otherwise it is null.public void onResume()
onResume in class SocialNetworkpublic void onDestroy()
onDestroy in class SocialNetworkpublic void onActivityResult(int requestCode,
int resultCode,
Intent data)
onActivityResult in class SocialNetworkrequestCode - The integer request code originally supplied to startActivityForResult(), allowing you to identify who this result came from.resultCode - The integer result code returned by the child activity through its setResult().data - An Intent, which can return result data to the caller (various data can be attached to Intent "extras").