cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox 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: 

Re: -canOpenURL: failed for URL:

-canOpenURL: failed for URL:

DimMalysh
Explorer | Level 4
Go to solution

Hi!

I get the following in the console:Снимок экрана 2017-08-25 в 12.08.08.png

What could be the problem?

Please, help. 

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

The canOpenURL messages are expected, and can be ignored, since the "(null)" error indicates that nothing went wrong. Your plist also looks correct.

 

The "view is not in the window hierarchy" error message is likely indicating why the authorization view isn't being shown. It is indicating that your ViewController isn't in the window hierarchy. It appears your ViewController wasn't presented (or was already dimissed). The screenshot seems to support that, as it doesn't show anything, such as the button that would trigger your myButtonInControllerPressed. You'll need to make sure your ViewController is presented and not dismissed. Exactly how you do that would be specific to your app, and is outside the scope of Dropbox API support, so I'm afraid I can't offer much more specific guidance.

View solution in original post

5 Replies 5

DimMalysh
Explorer | Level 4
Go to solution

It's my .plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>dbapi-8-emm</string>
<string>dbapi-2</string>
</array>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>db-h0tdpp8hmg0pj17</string>
</array>
<key>CFBundleURLName</key>
<string></string>
</dict>
</array>
</dict>
</plist>

DimMalysh
Explorer | Level 4
Go to solution

 

Снимок экрана 2017-08-25 в 12.30.22.pngit's my ViewController.m:

 

DimMalysh
Explorer | Level 4
Go to solution

... but there is no authorization form when starting the program

Снимок экрана 2017-08-25 в 12.33.09.png

Greg-DB
Dropbox Staff
Go to solution

The canOpenURL messages are expected, and can be ignored, since the "(null)" error indicates that nothing went wrong. Your plist also looks correct.

 

The "view is not in the window hierarchy" error message is likely indicating why the authorization view isn't being shown. It is indicating that your ViewController isn't in the window hierarchy. It appears your ViewController wasn't presented (or was already dimissed). The screenshot seems to support that, as it doesn't show anything, such as the button that would trigger your myButtonInControllerPressed. You'll need to make sure your ViewController is presented and not dismissed. Exactly how you do that would be specific to your app, and is outside the scope of Dropbox API support, so I'm afraid I can't offer much more specific guidance.

DimMalysh
Explorer | Level 4
Go to solution

Thank you friend! I changed the place of the function authorizeFromController:controller:openURL call and it all worked!

Need more support?