SearchService 403 Forbidden in Android Fabric


#1

Hi, I integrated my project thru fabric using eclipse. I managed to get the code below working for awhile yesterday for 30min but after that, until now, I keep hitting TwitterApiException: 403 Forbidden. Not sure what’s the root cause. I’m ssuspecting it should be some limitation to my account? since it was working fine before that.

LogCat code as below:

04-15 21:31:52.656: W/System.err(13672): com.twitter.sdk.android.core.TwitterApiException: 403 Forbidden
04-15 21:31:52.656: W/System.err(13672):     at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:382)
04-15 21:31:52.656: W/System.err(13672):     at retrofit.RestAdapter$RestHandler.access$100(RestAdapter.java:220)
04-15 21:31:52.656: W/System.err(13672):     at retrofit.RestAdapter$RestHandler$2.obtainResponse(RestAdapter.java:278)
04-15 21:31:52.656: W/System.err(13672):     at retrofit.CallbackRunnable.run(CallbackRunnable.java:42)
04-15 21:31:52.656: W/System.err(13672):     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
04-15 21:31:52.656: W/System.err(13672):     at java.util.concurrent.FutureTask.run(FutureTask.java:237)
04-15 21:31:52.656: W/System.err(13672):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
04-15 21:31:52.656: W/System.err(13672):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
04-15 21:31:52.656: W/System.err(13672):     at java.lang.Thread.run(Thread.java:841)

The snippet that hit 403.

final SearchService service = Twitter.getApiClient().getSearchService();
service.tweets("#test", null, null, null, "recent", 20, null, null, null, true, new Callback<Search>()
{
    @Override
    public void success(Result<Search> searchResult)
    {
        final List<Tweet> tweets = searchResult.data.tweets;
        for(Tweet tweet : tweets)
        {
            View tweetRow = getActivity().getLayoutInflater().inflate(R.layout.tweet_row_item, null);
            CardView cardView = (CardView) tweetRow.findViewById(R.id.card_view);
            CompactTweetView tweetView = new CompactTweetView(getActivity(), tweet);
            cardView.addView(tweetView);
            tweetLayout.addView(tweetRow);
        }
    }

    @Override
    public void failure(TwitterException error)
    {
        error.printStackTrace();
        swipeRefreshLayout.setRefreshing(false);
        Toast.makeText(getActivity(), error.toString(), Toast.LENGTH_SHORT).show();
    }
});

Please assist! thanks!


#2

Hey there,

Can you send a note to support@ and we’ll take a look at what’s going on with your keys.

Thanks!

V


#3