After fabric removal , now Twitter kit 3 is used in the android
Case :
I need share the text , image and video without opening the
Twitter Composer
I am sharing the text , image and the video using twitter kit 3 by using the method
StatusesService
So i can share the text by using below code :
final TwitterSession session = TwitterCore.getInstance().getSessionManager().getActiveSession(); StatusesService statusesService = TwitterCore.getInstance().getApiClient(session).getStatusesService(); statusesService.update("Click this link "+getShareLink(),null,null,null,null,null,null,null,null).enqueue(new Callback<Tweet>() { @Override public void success(Result<Tweet> result) { Toast.makeText(context,"Tweet success ",Toast.LENGTH_SHORT).show(); Log.e(TAG,"Twitter "+ result.data.toString()); } @Override public void failure(TwitterException exception) { Toast.makeText(context,"Tweet failure ",Toast.LENGTH_SHORT).show(); Log.e(TAG,"Twitter "+ exception.getMessage()); } });
For image upload we can use
MediaService
and for uploading it we can useMediaService.upload()
method , but in theMediaService
they are only prompt the images to upload and i also checked their docs .And now How to share Video in the Twitter kit 3 using
StatuesServices
or any other method ?