dropbox-sdk-js: Error "NSURLErrorDomain error -999" on iOS when using API in Cordova app

I use the newest dropbox-sdk-js in my cordova app. I have troubles getting authenticated on iOS. On Android the API works properly and I can authenticate in my app, download/upload files. Everyting seems to work OK. I use the following code to authenticate:

var dropboxsdkclient = new Dropbox.Dropbox({ clientId: DROPBOX_APP_KEY });

dropboxsdkclient.authenticateWithCordova( 
	function(accessToken) {
	  $rootScope.dropboxaccesstoken = accessToken;
	  $scope.readfromfilefordropbox(sourcepath, remoteFileName, privateUpload);
    }, 
    function(error) {
	  console.log("failed DROPBOX authentication!");
	  $scope.showAlert();
    }
);

Unfortunately on iOS the inappbrowser appears on screen for a moment and then I’m getting the following xcode debug log error:

app[41978:580267] THREAD WARNING: ['InAppBrowser'] took '67.250244' ms. Plugin should use a background thread.
app[41978:580267] Unbalanced calls to begin/end appearance transitions for <UIViewController: 0x7f8a68651070>.
app[41978:580391] WF: _userSettingsForUser : (null)
app[41978:580391] WF: _WebFilterIsActive returning: NO
app[41978:580267] webView:didFailLoadWithError - -999: The operation couldn’t be completed. (NSURLErrorDomain error -999.)
app[41978:580267] webView:didFailLoadWithError - -999: The operation couldn’t be completed. (NSURLErrorDomain error -999.)
app[41978:580267] failed DROPBOX authentication!
app[41978:580267] IAB.close() called but it was already closed.
app[41978:583091] Task <D57EA0DA-17B2-4F60-A2DB-7F275B0F3A40>.<0> HTTP load failed (error code: -999 [1:89])
app[41978:583091] Task <123ECEDE-EC7B-4B3F-B6C0-D3CD429B84FC>.<0> HTTP load failed (error code: -999 [1:89])
app[41978:583091] Task <6DC41B40-AB0B-43BD-A37F-8C80E5D833BC>.<0> HTTP load failed (error code: -999 [1:89])

I’m stuck and not quite sure what’s going on. I suppose the issue might be with iOS 11 or maybe the inappbrowser plguin version (2.0.2)? Could anybody help?

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 15 (8 by maintainers)

Most upvoted comments

PR #228 to fix this is released as of v4.0.15.

Thanks for your (now merged) PR @destegabry !

@heidg Thanks so much for the investigation and information!

I’ve used this successfully with cordova-plugin-inappbrowser v1.7.2. Can you try downgrading to that and met let me know if that does or doesn’t help? Thanks in advance!