Skip to content
This repository has been archived by the owner on Jul 25, 2023. It is now read-only.

Remote items and shared folders #91

Closed
tobihagemann opened this issue May 5, 2016 · 9 comments
Closed

Remote items and shared folders #91

tobihagemann opened this issue May 5, 2016 · 9 comments

Comments

@tobihagemann
Copy link

tobihagemann commented May 5, 2016

It seems to me that this SDK doesn't take remote items and shared folders into account, as it should do: https://dev.onedrive.com/misc/working-with-links.htm

I came across this issue, because ODItem's folder property is nil for shared folders. It would be great if this SDK would handle shared folders properly. I'll implement on a workaround for my project in the meantime.

Edit: Maybe some further information for reproducing... share a folder from a second account to your first account... that's it! That means, you can't be the owner of the shared folder. If you're the owner of the shared folder, everything's just fine. The other way round causes the issue.

@tobihagemann
Copy link
Author

tobihagemann commented May 5, 2016

ODItemRequestBuilder's itemByPath: method doesn't seem to work on shared folders either. I'm always receiving a response with an empty collection. That's too bad, I really liked this method.

But it works, if I use the id of remoteItem (which doesn't exist in this SDK yet, but I've implemented a category on ODItem as a workaround).

Maaan, I really wanted to avoid implementing an ID-based directory browser. It's so similar to Google Drive and I think it's awful. Dropbox has a really good API purely based on paths, as it should be. I guess I have no choice, or maybe someone here has an idea to use paths to access shared folders?

@kevklam
Copy link
Contributor

kevklam commented May 6, 2016

Hi @MuscleRumble,
Regarding shared folders - the service API returns all facets (including 'folder' as you discovered) as sub-properties of the 'remoteItem' facet rather than on the item itself.

Can you give an example of a failing query using itemByPath? I did a quick test against a shared folder and it returned the item including remoteItem facet as expected (at least in the JSON response - as you noticed, remoteItem is not exposed as a property on ODItem yet):

[ODClient authenticatedClientWithCompletion:^(ODClient *client, NSError *error){
        [[[[[client drive] items:@"root"] itemByPath:@"sharedfolder"] request] getWithCompletion:^(ODItem *response, NSError *error) {
            NSLog(@"name: %@ id: %@", response.name, response.id);
        }];
    }];

@kevklam kevklam self-assigned this May 6, 2016
@tobihagemann
Copy link
Author

tobihagemann commented May 6, 2016

Thanks for looking into it! Sorry, I wasn't clear enough. Now try to get the children of this shared folder by using the children method between the itemByPath: and request methods:

[[[[[[client drive] items:@"root"] itemByPath:@"sharedfolder"] children] request] getWithCompletion:^(...){...}]

That doesn't work for me. I can't "navigate" inside a shared folder by its path.

@kevklam
Copy link
Contributor

kevklam commented May 6, 2016

Ah, gotcha. Yes, unfortunately that's less than convenient. I'll forward this feedback to the service team.

@kevklam
Copy link
Contributor

kevklam commented May 17, 2016

As of PR #96 remoteItem should be supported (will need to explicitly point pod at this commit until pod is versioned next)

@kevklam kevklam closed this as completed May 17, 2016
@tobihagemann
Copy link
Author

Alright, thanks! How about "navigating" through a shared folder by its path. Any update on this?

@kevklam
Copy link
Contributor

kevklam commented May 17, 2016

I haven't heard back, but will post here when I do.

@kevklam
Copy link
Contributor

kevklam commented May 27, 2016

Unfortunately it looks like there is nothing planned in that regard in the short term, but it's been added to the growing "to-investigate" list of features :)

@tobihagemann
Copy link
Author

Okay, I guess I have to work with IDs then. Thanks for the info!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants