dropbox-sdk-obj-c icon indicating copy to clipboard operation
dropbox-sdk-obj-c copied to clipboard

Showing Blank white screen with error dbapi-8-emm and dbapi-2://1/connect

Open shoaibhassanWhizpool opened this issue 8 years ago • 27 comments

Hello Dropbox Team, i am getting

-canOpenURL: failed for URL: "dbapi-2://1/connect" - error: "The operation couldn’t be completed. (OSStatus error -10814.)"
2017-08-10 11:31:29.961522+0500 [2831:792345] -canOpenURL: failed for URL: "dbapi-8-emm://1/connect" - error: "The operation couldn’t be completed. (OSStatus error -10814.)"

I am using pod version 3.1.1 into my application.

shoaibhassanWhizpool avatar Aug 10 '17 06:08 shoaibhassanWhizpool

The 10814 errors themselves are expected if the official Dropbox app isn't installed, so they're safe to ignore. (The SDK checks if the official app is installed, and would use that for the authorization flow if it is. If it isn't though, it will fall back to an in-app flow.)

You shouldn't be seeing a blank screen for the authorization page though. Can you share a screenshot showing the issue? Also, which device(s) is it affecting? (Is it only affecting split view controllers on iPad? If so, that's a known issue we're looking into.)

greg-db avatar Aug 10 '17 14:08 greg-db

here is my code for calling login screen
-(void)loadDropBoxData{
    if (![DBClientsManager authorizedClient]) {
        [DBClientsManager authorizeFromController:[UIApplication sharedApplication]
                                       controller:self
                                          openURL:^(NSURL *url) {
                                              [[UIApplication sharedApplication] openURL:url];
                                          }];
    }
    else{
        [self performSelector:@selector(requestDropBoxFiles) withObject:nil afterDelay:0];
    }
}

when i uninstall app and call this code for first time, it shows login window, but if i don't login and press done button of dropbox login screes it comes back, and if i press login button again.it shows white blank screen like this. simulator screen shot aug 11 2017 2 59 23 pm

shoaibhassanWhizpool avatar Aug 11 '17 10:08 shoaibhassanWhizpool

Based on the screenshot, it looks like you're seeing this on iPhone, not iPad.

I just tried to reproduce this using the code you supplied, but it worked properly for me. I'm not sure I understand the part where you said "press done button of dropbox login screes it comes back" though. What specifically comes back? Can you clarify the steps to reproduce this?

Additionally, please let us know:

  • which version of Xcode you're using
  • which version of iOS you're using

By the way, I notice you mentioned you're using version 3.1.1 of the SDK. The latest version is 3.2.0, so please upgrade to that first and try again.

greg-db avatar Aug 11 '17 16:08 greg-db

I can confirm I'm seeing the same thing on v3.1.2 (and v3.2.0 won't compile, I've raised this issue). I had v3.0.18 before and it was working perfectly.

guidedways avatar Aug 13 '17 18:08 guidedways

@guidedways Can you let me know what version(s) of Xcode and iOS you're seeing this with? This isn't reproducing for me with SDK v3.1.2.

greg-db avatar Aug 14 '17 16:08 greg-db

This is Xcode 8.x (latest) and iOS Simulator 10.x (latest). I switched back to 3.0.18 and I've had no issues whatsoever. I tried this with a completely fresh install on a iOS simulator. The same code (unchanged) worked the moment I reverted back to v3.0.18.

guidedways avatar Aug 14 '17 16:08 guidedways

@guidedways Thanks! That's the same setup I'm testing with though and it unfortunately isn't showing the same issue for me.

Does the DBRoulette sample app display the same issue for you? Also, does this only reproduce when following the steps outlined by shoaibhassanWhizpool above, or does it occur on every call to authorizeFromController?

greg-db avatar Aug 14 '17 16:08 greg-db

Hello! I have the same problem. On the iPhone (both simulator iPhone 7 and device iPhone 7plus) I have white blank screen when try to log in. The code for log in used the as in the listing above.

The app used splitViewController. Also interesting behaviour I can observe: In my app I have two place where is used login into Dropbox: The first place is the settings screen. This screen is the only one viewController in the UINavigationController stack. On this screen everything works well(properly opens webView for log in into Dropbox, and I can log in). The second place - some viewController, which is fourth in the UINavigationController stack. And in this ViewController I have white blank screen, every time when I try to login in to Dropbox.

Oleksandren avatar Aug 18 '17 01:08 Oleksandren

@Oleksandren Thanks for the information!

greg-db avatar Aug 18 '17 14:08 greg-db

@greg-db Instead passing self as parameter (UIViewController), I pass self.navigationController.viewControllers[0] and everything works well on the simulator. Then I tried to check it on the device. The problem still unresolved, and when I run app on the simulator - the provided solution stop working on simulator too. The I try pass self.parentViewController - it not helps. When I pass rootViewController ( [[[[UIApplication sharedApplication] delegate] window] rootViewController] ) - it helps, but on the simulator only. On the device nothing to help to resolve this problem.

So, working call to ask authorization in Dropbox look like the following (works only on the simulator):

[DBClientsManager authorizeFromController:[UIApplication sharedApplication]
                                       controller:self.navigationController.viewControllers[0]
                                          openURL:^(NSURL *url) {
                                              [[UIApplication sharedApplication] openURL:url];
                                          }];

But it works only on simulator.

Oleksandren avatar Aug 20 '17 19:08 Oleksandren

I tried to use latest version of the Dropbox SDK. It is not helps to resolve bug. But when I used the latest version of the SDK, in the log appeared the following warning:

[ViewService] Failed to get remote view controller with error: Error: domain=_UIViewServiceInterfaceErrorDomain, code=2

As I see in the search results this problem in iOS core (in the Safari View Controller which opened to make log in). Also the same bug with FBSDK too. The one of the solution which proposed here: https://stackoverflow.com/questions/44327068/failed-to-get-remote-view-controller-with-error-error-domain-uiviewserviceint is to clear data and history from Safari settings on your phone. But it no way for us(we can't ask user to clear the cache every time when him/she will want to use Dropbox). Also I tried to use another solution, which proposed here: https://stackoverflow.com/questions/34015649/problems-with-sfsafariviewcontroller But it also not helps.

Oleksandren avatar Aug 21 '17 00:08 Oleksandren

Thanks again @Oleksandren ! We'll follow up here once we have any news on this issue.

greg-db avatar Aug 21 '17 19:08 greg-db

@greg-db I think you can try remove all appearance configurations for UIToolbar and for UIBarButtonItem's. In this case toolbar will be not so attractive, but it not cause the bug.

Oleksandren avatar Aug 22 '17 00:08 Oleksandren

Thanks @Oleksandren !

greg-db avatar Aug 22 '17 14:08 greg-db

We have integrated dropbox SDK API v2 in our app.We are getting a blank screen,no login screen found when App runs on iPad.Our App runs fine on iPhone and the login screen appears.May you help us on this issue this seems to be a bug in your SDK,because the login screen is getting rendered from your server. iOS version used -> 10.3.3 Besides, dropbox SDK API v1 works fine on iPhone and iPad.Please provide us solution.

manishbajo2008 avatar Sep 11 '17 08:09 manishbajo2008

Thanks for the additional report @manishbajo2008 ! I don't have an update on this yet, but I'll follow up here once I do.

greg-db avatar Sep 11 '17 14:09 greg-db

@greg-db Thanks for your response. May we get some type of confirmation report from dropbox team regarding this issue.As we have tried to release our app HpePrint but apple has rejected our app raising this user interface bug.We have also tried contacting the developer team of dropbox but no response has been found.

manishbajo2008 avatar Sep 13 '17 10:09 manishbajo2008

@manishbajo2008 I work with the API team at Dropbox and I can confirm this issue is currently open with engineering, though I don't have a timeline for a fix right now.

I do see that you just opened an API ticket and a forum thread for this, but I'll close those in favor of this GitHub issue so we can track this in one place.

greg-db avatar Sep 13 '17 11:09 greg-db

@greg-db Is there any progress on this?May your team communicate with apple team explaining this open issue?

Below find the details for rejection from Apple:- From Apple • 2. 1 Performance: App Completeness Guideline 2.1 - Performance - App Completeness

We discovered one or more bugs in your app when reviewed on iPad running iOS 11 on Wi-Fi connected to an IPv6 network.

When attempting to connect Dropbox, an empty, white page is displayed with no close or back button.

manishbajo2008 avatar Sep 26 '17 08:09 manishbajo2008

@manishbajo2008 Thanks for the information. I don't have an update from the team on this, but I'll let them know about the issues it is causing for you in app review to see if we can help.

greg-db avatar Sep 26 '17 17:09 greg-db

An update on this, I am facing the same issue.

manish-cs avatar Sep 28 '17 11:09 manish-cs

@manish-cs I don't have an update on this yet. I'll reply here once I do.

greg-db avatar Sep 28 '17 11:09 greg-db

Lovely iOS 11, in DBOAuthMobile-iOS.m add this before presentViewController:

if (@available(iOS 11.0, *)) { [NSThread sleepForTimeInterval:0.5f]; }

Works for me!

fmalekpour avatar Sep 29 '17 08:09 fmalekpour

We're still looking into this, but it no longer reproduces for us. If anyone is still seeing this issue, would you be able to share a sample project that shows it? Thanks!

greg-db avatar Sep 29 '17 20:09 greg-db

Sorry for the long delay here. I think the solution is to make sure that you're passing the topmost view controller when authorizing. With the UISplitViewController case, it's not necessarily self.

So would people mind trying this to see if it fixes the problem for them:

[DBClientsManager authorizeFromController:[UIApplication sharedApplication] controller:[UIApplication sharedApplication].keyWindow.rootViewController openURL:^(NSURL *url){
        [[UIApplication sharedApplication] openURL:url];
 }];

[UIApplication sharedApplication].keyWindow.rootViewController should get you the topmost view controller.

I can be sure to add a note in the documentation.

scobbe avatar Oct 04 '17 02:10 scobbe

Should check the top controller:

       let vc = UIApplication.shared.keyWindow?.rootViewController
        if var topController = vc {
            while let presentedViewController = topController.presentedViewController {
                topController = presentedViewController
            }
            DBClientsManager.authorize(fromController: UIApplication.shared, controller: topController) { (url) in
                UIApplication.shared.openURL(url)
            }
        }

sovannarithsok avatar Oct 04 '17 09:10 sovannarithsok

Make sure you are not presenting the WebView from an ActionSheet - that can cause the blank screen / no loading issues. I wasted a long time before checking the view hierarchy which was ultimately my issue. I also was distracted by the TCP / Socket errors.

CharlieBurtoff avatar Oct 11 '17 23:10 CharlieBurtoff