question

kprpi avatar image
kprpi asked

IOS Cloud drive listNodesRequest unsupported URL error

My iOS app can login to the amazon cloud drive with the whitelisted security profile key. But when the app made the first call listNodesRequest, the following error is returned: Error Domain=NSURLErrorDomain Code=-1002 "unsupported URL" UserInfo={NSUnderlyingError=0x7ff142549870 {Error Domain=kCFErrorDomainCFNetwork Code=-1002 "(null)"}, NSErrorFailingURLStringKey=(null)/nodes?, NSErrorFailingURLKey=(null)/nodes?, NSLocalizedDescription=unsupported URL} Not sure where is wrong? Is there something missing from my security profile (I followed the steps)? Thanks for help.
amazon drive
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Jamie Grossman avatar image
Jamie Grossman answered
Hi there, Thanks for posting! Is this issue in your own app, or the sample provided in the SDK? Have you been able to reproduce this in the sample?
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

kprpi avatar image
kprpi answered
Thanks for your reply! It's in my application and also reproduced with the sample application with my api key.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Levon@Amazon avatar image
Levon@Amazon answered
Hi kprpi, That's unusual. Could you please specify what your redirect URL is? If the error is "unsupported URL", it would help to see the full requests that caused the error. If you could please share more details, it would be very helpful. Cheers, Levon
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Levon@Amazon avatar image
Levon@Amazon answered
Hello, There are a few prerequisites for accessing Cloud Drive. Please make sure that you have: - registered your Amazon Cloud Drive app - registered your security profile. - whitelisted your security profile In addition to that, for Login with Amazon: 1. You could be missing permissions to the 'profile' scope. If you followed the sample code in step 3 "Add the SDK for JavaScript" in the Getting Started for Web guide, then this should be already be taken care of. 2. The access token expires after 1 hour, so if your access token is hardcoded for testing purposes, it may have expired. 3. Your access token is URL-encoded in the call header. Notice in the sample code that when calling the ' https://api.amazon.com/auth/o2/tokeninfo' endpoint, the access token needs to be URL-encoded. However, when placing the access token in the call header to get the user profile, it should not be URL-encoded. Check your code, it seems possible to me that your access token is URL-encoded at that point, which could be why your first call succeeds but your second call fails. Please see if you can follow this sample and whether it works for you: https://developer.amazon.com/public/apis/experience/cloud-drive/content/sdk-for-android-getting-started
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

S.A.M avatar image
S.A.M answered
This SO answer fixed the issue for me. http://stackoverflow.com/questions/23241872/nsurlconnection-cfurlconnection-http-load-failed-kcfstreamerrordomainssl-9813 Particularly this section: For iOS 9, above procedure don't work. Add the following snippet in info.plist: NSAppTransportSecurity NSAllowsArbitraryLoads
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

S.A.M avatar image
S.A.M answered
Though this could be a big hack, need to investigate more if its the right thing to do, viz-a-viz security, but at least some forward progress can be made in running the sample app !
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.