Twitter App Card

android

#1
                                final TwitterSession session = TwitterCore.getInstance().getSessionManager()
                                        .getActiveSession();
                                final Card card = new Card.AppCardBuilder(getActivity())
                                        .imageUri(uri)
                                        .googlePlayId("com.twitter.android")
                                        .build();
                                final Intent intent = new ComposerActivity.Builder(getActivity())
                                        .session(session)
                                        .card(card)
                                        .hashtags("#" + campaignDeatilResponse.getTwitter().getUser_description())
                                        .createIntent();
                                startActivityForResult(intent, TWEETER_REQ_CODE);

using appcards if we cancel tweet we get result code 0 in both caseses succes and failure…


#2

We don’t set a result for success or failure since the upload happens in the background using an IntentService. You can use a BroadcastReceiver to listen for success or failure. Here is an example from our sample application: https://github.com/twitter/twitter-kit-android/tree/master/samples/app/src/main/java/com/example/app/tweetcomposer


#3

Thanks for reply EricFrohnhoefer ,but the problem is that we need to show loader on screen because Tweet id getting some time to receive in broadcast receiver so if loader will show then it will help to understand that something is happen in background to user but without success or failure response, not possible to show loader on UI.


#4

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.