Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.

**Get a OneDriveClient object** sample code is outdated #143

Closed
ajpeacock0 opened this issue Jul 23, 2018 · 4 comments
Closed

**Get a OneDriveClient object** sample code is outdated #143

ajpeacock0 opened this issue Jul 23, 2018 · 4 comments

Comments

@ajpeacock0
Copy link

The sample code under the Get a OneDriveClient object section has the following

final DefaultCallback<IOneDriveClient> callback = new DefaultCallback<IOneDriveClient>(activity) {...};     
final IOneDriveClient oneDriveClient = new OneDriveClient.Builder()
                                            .fromConfig(oneDriveConfig)
                                            .loginAndBuildClient(getActivity(), callback);

The OneDriveClient.Builder.loginAndBuildClient function is now async, returning the IOneDriveClient in the given DefaultCallback. The sample code still expects a IOneDriveClient value returned from loginAndBuildClient however it's return type is now void.

A simple fix but confusing to first time readers.

@hollaus
Copy link

hollaus commented Sep 11, 2018

I agree with @ajpeacock0, the sample is outdated. I simply replaced DefaultCallback with ICallback:

ICallback<IOneDriveClient> callback = new ICallback<IOneDriveClient>() {
    @Override
    public void success(IOneDriveClient iOneDriveClient) {

    }

    @Override
    public void failure(ClientException ex) {

    }
};

new OneDriveClient.Builder()
        .fromConfig(oneDriveConfig)
        .loginAndBuildClient(activity, callback);

@josephnarai
Copy link

Thank you @hollaus lifesaver... thought I was going crazy - someone should really update the examples!

@ArashM98
Copy link

so what happen to the rest of sample ? * get root folder
how to get oneDriveClient object to call it's method?

oneDriveClient
.getDrive()
.getRoot()
.buildRequest()
.get(new ICallback() {
@OverRide
public void success(final Item result) {
final String msg = "Found Root " + result.id;
Toast.makeText(getActivity(), msg, Toast.LENGTH_SHORT)
.show();
}
...
// Handle failure case
});

@baywet
Copy link
Member

baywet commented Oct 2, 2024

Thank you for reaching out and for your patience. This SDK is being officially deprecated. See #172 for more information

@baywet baywet closed this as not planned Won't fix, can't repro, duplicate, stale Oct 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants