filestack / filestack-android

Official Android SDK for Filestack - API and content management system that makes it easy to add powerful file uploading and transformation capabilities to any web or mobile application.
https://www.filestack.com
Apache License 2.0
154 stars 90 forks source link

Can't run demo and list files after authorize with Google Drive #142

Closed akaipham closed 6 years ago

akaipham commented 6 years ago

When it redirected me from Google Auth View, no files were listed as well as the screen remained states like before-auth with Google Drive.

BTW I found out that something went wrong with logic in the source code though:

In FsActitivity.java

@Override
    public void onSuccess(CloudResponse contents) {
        String authUrl = contents.getAuthUrl();

        if (authUrl != null) {
            shouldCheckAuth = true;
            CloudAuthFragment cloudAuthFragment = CloudAuthFragment.create(selectedSource, authUrl);
            FragmentManager manager = getSupportFragmentManager();
            FragmentTransaction transaction = manager.beginTransaction();
            transaction.replace(R.id.content, cloudAuthFragment);
            transaction.commit();
        } else {
            shouldCheckAuth = false;
            CloudListFragment cloudListFragment = CloudListFragment.create(selectedSource);
            FragmentManager manager = getSupportFragmentManager();
            FragmentTransaction transaction = manager.beginTransaction();
            transaction.replace(R.id.content, cloudListFragment);
            transaction.commit();
        }
    }

It caused auto-redirecting to auth screen and never successfully authorized with Google Drive.

Any ideas about this or am I missing something?

shawnmaten commented 6 years ago

Issues with refreshing the view after returning from auth were fixed in release 2.0.0-alpha.2. If you're not using that version, try it and see if that fixes the issue. I'm not clear what you mean by "It caused auto-redirecting to auth screen and never successfully authorized with Google Drive." That sounds like a potentially different issue, but let's see if you're still having issues after updating.

minhnhatspk commented 6 years ago

image I have the same problem, after authentication with Google Service , The app come back without any change.

shawnmaten commented 6 years ago

Are you positive that you're using version 2.0.0-alpha.2? You should set that version in your build.gradle, perform a gradle sync, and run the app again. I'm not seeing this behavior anymore with the fixed version.

shawnmaten commented 6 years ago

Closing this issue since there's been no reply. If you're still having this issue feel free to comment or open a new issue.