How to share video on Twitter using twitter 3 in android?

After removing the fabric, now Twitter set 3 is used in android

Happening:

  • I need to exchange text, image and video without opening Twitter Composer

  • I am sharing text, image and video using twitter 3 using method StatusesService

  • Therefore, I can share the text using the code below:

    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());
        }
    });
    
  • We can use the image to upload, and MediaServicewe can use the method to upload it MediaService.upload(), but MediaService they only ask for images to upload and I also checked my documents.

  • And now How do I share a video on Twitter 3 using StatuesServicesor in any other way?

+4
source share
2 answers

1) iOS (. )

2) gif .

3) :

/ .

. , post.

+3

, , Twitter, .

0

Source: https://habr.com/ru/post/1687188/


All Articles