Skip to content

Checking if a user is subbed to my Channel returns Exception #28

@mircoianese

Description

@mircoianese

Hi. I'm trying to make a method to return whether a user is subbed to my channel or not.
I have authenticated my channel with the CHANNEL_SUBSCRIPTIONS Scope but, when I try to handle the getSubscription response I get an Exception:

com.fasterxml.jackson.core.JsonParseException: Illegal character ((CTRL-CHAR, code 31)): only regular white space (\r, \n, \t) is allowed between tokens
 at [Source: �����ڍY���1��0��������8��}@cI%ZPh�4�]o���L
G�%����M	�z��9�C��,��3�kҍ�X��s�5(�Β��ll���=���������1��AY���; line: 1, column: 2]

Here's the code:

twitch.channels().getSubscription("myChannelName", "UserToCheck", new ChannelSubscriptionResponseHandler() {
            
            @Override
            public void onSuccess(ChannelSubscription channelSubscription) {
                return true;
            }

            @Override
            public void onFailure(int i, String s, String s1) {
               return false;
            }

            @Override
            public void onFailure(Throwable throwable) {
            	System.out.println( throwable);
                return false;
            }
});

So I get into the onFailure(Throwable throwable) method. What I'm doing wrong?
Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions