The Movie Database Support

Does API V4 has these features: Mark as Favorite / Add to Watchlist? API V4 has new features in Account such as 'Get Movie Recommendations ' base on account info which i can't find in V3 I find it is difficult to use those features together, because i need to finish authentication twice for session_id and access_token

1 reply (on page 1 of 1)

Jump to last post

If you are using Android then you can authenticate with both versions. You can also look up the auth logic (links) from my project Moviebase.

Here an example for the WebView:

 private static final UriMatcher URI_MATCHER = new UriMatcher(UriMatcher.NO_MATCH);
    URI_MATCHER.addURI("moviebase://auth", "v3", 100);
    URI_MATCHER.addURI("moviebase://auth", "v4", 101);

    public void onCreate(@Nullable Bundle savedInstanceState) {

        // initialise webView
        webView.setWebViewClient(new WebViewClient() {
            @Override
            public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
                Uri uri = request.getUrl();
                return handleUriLoading(view, uri);
            }
        }

    }

    boolean handleUriLoading(WebView view, Uri uri) {
       switch (URI_MATCHER.match(uri)) {
        case 100: 
            // moviebase://auth/v3?request_token=[xxx]&approved=true
            // check approved parameter
            // handle request token
            // ...
            break;
        case 101:
            // request access token, account details for version 4 etc.
            break;
       }

    }