cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Back again with another edition of 'How we use Dropbox', so find out how Emma uses to-do lists to get it all done here!

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SwiftyDropbox not working in iPad device

SwiftyDropbox not working in iPad device

Bernadetha S.
New member | Level 1

I'm working on integration SwiftyDropbox with my iOS app, it works fine in simulator get file list, download and upload, unfortunately not in device (an iPad).

After success login, tried to get folder content(client.files.listFolder) the response will takes couple minutes after that I got "Http Error:"

I'm sure it wasn't the internet connection issue. I've tested use different network. it seems I got no response from API. 

I tried the demo, SwiftyTest and got the same result. it works in simulator only. 

did I miss something on setup? 

Any help is appreciated. Thanks

5 Replies 5

Re: SwiftyDropbox not working in iPad device

Greg-DB
Dropboxer

Hi Bernadetha, there shouldn't be anything extra you need to do for this. 

I can't reproduce this issue though. Can you share the relevant code you're using, and any/all output/errors you're getting? Thanks in advance! 

Re: SwiftyDropbox not working in iPad device

Bernadetha S.
New member | Level 1

Hi Gregory, thanks for the response. 

I think better to send you my sample project, please give it a try. since the issue happens in real device. https://www.dropbox.com/sh/g8l8h0tl8qoaver/AAB-C8GR34xMsN_ikEsrBcEya?dl=0 

step to reproduce: 

1. On welcome screen, click Dropbox button. it displays Dropbox view controller.

2. do login

3. if success, it navigates to file screen as follow.

below pic is the expected result, list of csv files and folder.

Issue: executing client.files.listFolder takes couple minutes, no files listed and the only error I got is "HTTP Error:" 

hope you can replicate the issue on device. Thanks in advance.

 

Re: SwiftyDropbox not working in iPad device

Greg-DB
Dropboxer

Thanks for the project! Unfortunately, the issue doesn't reproduce for me using this project on a test device. The files and folders do get listed for me.

Looking at your code though, one thing that might be an issue is how you're using your client object. That is, you're letting client be your authorizedClient, but that might then go out of scope before the response comes in (asynchronously). This could be a timing issue, which might explain why we see it inconsistently.

Try replacing these lines:

if let client = Dropbox.authorizedClient {

with:

if ((Dropbox.authorizedClient) != nil) {

And:

client.files.listFolder(path: dbPath).response { response, error in

with:

Dropbox.authorizedClient!.files.listFolder(path: dbPath).response { response, error in

If that doesn't help, it does sound like a network issue, so I'd recommend checking you can access api.dropboxapi.com on the networks you've tried.

Re: SwiftyDropbox not working in iPad device

Bernadetha S.
New member | Level 1

Many thanks for your assistance. the replacement code doesn't help 😞 

about the network issue (sorry, I'm not expert enough). is there a way to test? if so,  How do you test it? 
I did from safari on iPad, apr.droboxapi.com navigates to www.dropbox.com. is that the expected resul? I was wonder if I have to use additional tool.

Re: SwiftyDropbox not working in iPad device

Bernadetha S.
New member | Level 1

Hi Gregory, I found the main problem 🙂

It wasn't network connection. I used test device that doesn't have signed Apple ID. this morning I used personal device and it's working then compare the environment. I don't know the exact reason, but I think iOS will block any responses from API if no apple ID signed in. 

anyway, thanks 🙂

Who's talking

Top contributors to this post

  • User avatar
    Bernadetha S. New member | Level 1
  • User avatar
    Greg-DB Dropboxer
What do Dropbox user levels mean?
Need more support?