Dropbox iOS SDK: WebKit Discarded an Uncaught Exception - ios

I am using the Dropbox iOS SDK (as of this writing, Cocoapod version 1.3.9). I noticed a strange bug. Here are the steps to reproduce it.
Connect to Dropbox, successfully sign in, and link to my account.
URL logged to the console (tokens masked for security):
db-abcdef123://1/connect?oauth_token=xyz123&oauth_token_secret=lmno123&uid=10884&state=91D8CB70-1037-4A4C-8F7B-CB8970E5E0BC
App linked successfully!
Sign out, then sign in with a different account...
URL logged to the console again, similar to the previous one:
db-abcdef123://1/connect?oauth_token=def123&oauth_token_secret=jkl123&uid=95157647&state=DC716BF2-E033-4586-926C-5E733CEA1E3F
Then comes the error:
*** WebKit discarded an uncaught exception in the webView:decidePolicyForNavigationAction:request:frame:decisionListener: delegate: <Unsupported Signature Method> The signature method "(null)" is not currently support by MPOAuthConnection
[WARNING] DropboxSDK: error loading DBConnectController - Error Domain=NSURLErrorDomain Code=-1002 "unsupported URL" UserInfo=0x12848f00 {NSErrorFailingURLStringKey=db-abcdef123://1/connect?oauth_token=123abc&oauth_token_secret=xyz123&uid=95157647&state=DC716BF2-E033-4586-926C-5E733CEA1E3F, NSErrorFailingURLKey=db-abcdef123://1/connect?oauth_token=123abc&oauth_token_secret=xyz123&uid=95157647&state=DC716BF2-E033-4586-926C-5E733CEA1E3F, NSLocalizedDescription=unsupported URL, NSUnderlyingError=0x144c4c80 "unsupported URL"}
The Dropbox login screen remains in the webView, and clicking Sign in again causes the same error but then makes the app crash.
Any ideas?
I'm using Xcode 5 and iOS 7

This is a known issue which will be fixed in the next release of the iOS Dropbox app (not the SDK).
EDIT: I misdiagnosed this based on the error message. The actual issue is likely that once you've initialized a DBRestClient, it continues to try to use the same user ID for authentication throughout its lifespan. If you unlink that user (even if you've added another user instead), it will fail to authenticate API calls because it no longer has credentials for that user.
The fix is to create a new DBRestClient when you switch to a new user.
This issue is present in the DBRoulette sample app. We're going to try to put in a fix for the next SDK release.

Related

DropboxSDK: credentials not saved

I have follow this tutorila to integrate Dropbox in my app
http://www.theappguruz.com/blog/ios-dropbox-integration
I had made a demo project before integrate into my main project .
its working fine
When I add this code into my main project with same configuration , login page is appear and when I clicked for log in its says an error
[ERROR] DropboxSDK: credentials not saved. Make sure you call
-[DBSession handleOpenUrl:] in your app delegate's application:openURL:sourceApplication:annotation: method
How I can get rid off this ?

Spotify ios sdk suddenly failing on all requestItemAtURI

requestItemAtURI received error
Error Domain=com.spotify.ios-sdk Code=101
"JSON object contains no URI" UserInfo=0x16e2e890
{NSLocalizedDescription=JSON object contains no URI}
Testing with various uri have previously succeeded until just now, for example, this uri should be valid:
spotify:track:5jSz894ljfWE0IcHBSM39i
Any ideas?
Unfortunately this is part of the "This SDK may stop working at any time" part of the Beta. There'll be an update before long to resolve it.

redirect_uri_mismatch Unity Google API on iOS

I created an app in Unity with Google Play Leaderboard support. I could easily make it work on Android, then I moved to OSX to build it for iPhone too.
First I got a problem, that Apple won't accept any bundle identifier with the '_' character in it, but my Android app bundle identifier had 2 of them...
However I found out, that in the Google Developer Console I can link another app to my app (to use the same Leaderboard) for iOS too, so I was quite happy. Unfortunately this doesn't seem to work. I get the *redirect_uri_mismatch* error message every time I try to log in.
On Android I used the UnityGPGPlugin but as it didn't work for me on iOS, I tried the PlayGameServices too. In UnityGPGPlugin I could set only the Application ID, so I thought that's why it is not working. In the PlayGameServices plugin there are two fields, one for the Application ID and one for the Client ID that made it look like that's really what I need. Unfortunately the error is still present and I really don't know what I could do with it. Here is the well known message:
Error: redirect_uri_mismatch
Request Details
cookie_policy_enforce=false
scope=https://www.googleapis.com/auth/appstate
https://www.googleapis.com/auth/games
https://www.googleapis.com/auth/plus.login
https://www.googleapis.com/auth/plus.moments.write
https://www.googleapis.com/auth/plus.me
https://www.googleapis.com/auth/plus.profile.agerange.read
https://www.googleapis.com/auth/plus.profile.language.read
https://www.googleapis.com/auth/plus.circles.members.read
response_type=code
access_type=offline
redirect_uri= < my bundle identifier without '_' characters >:/oauth2callback
state=16885367
gpsdk=1.5.0
verifier=12647966
display=page
client_id=123456789123-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com
hl=en
The debug log contains only this:
2014-03-16 14:21:19.507 <my app>[1699:60b] GPGSAuthenticateWithCallback.
2014-03-16 14:21:19.509 <my app>[1699:60b] GPGSManager initializing and authenticating.
2014-03-16 14:21:19.512 <my app>[1699:60b] GPPSignIn initialized.
2014-03-16 14:21:19.514 <my app>[1699:60b] GPPSignIn attempting sign in now.
-> applicationWillResignActive()
-> applicationDidEnterBackground()
Does anyone know how could I solve this problem?
Thanks in advance!
Edit:
Maybe it wasn't obvious, but I have 2 bundle identifiers, both of them are linked to the same game service in Google Play Developer Console. The com.x.a_b_c belongs to the Android app, the com.x.abc belongs to the iOS app.
I was having redirect_uri_mismatch error while using UnityGPGPlugin. I was using "123456789123" as my Application ID instead of "123456789123-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx".
However, I manage to get through the Google Sign In page after changing all my setup to "123456789123-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" as my Application ID. Including the GPGApplicationID in Info.plist.
Sad to say that I am having another problem now, but at least that's how I manage to get through that error. :)

Facebook iOS 3.1 SDK: can login with Safari but not natively

I'm integrating the iOS 3.1 Facebook SDK. When implementing a login with Facebook feature, I call FBSession openActiveSessionWithReadPermissions:allowLoginUI:completionHandler:. When called on the simulator (where I don't have a FB account set up natively) I can successfully login.
However, from a device with a native Facebook account setup, when calling openActiveSessionWithReadPermissions... the session type returned in the completion handler is always sessionStateClosedLoginFailed, regardless of whether I allow or disallow my app to use Facebook in the alert dialog. The session state before calling the method is sessionStateCreated.
This is the NSError from the completion handler:
Error Domain=com.facebook.sdk Code=2 "The operation couldn’t be completed. (com.facebook.sdk error 2.)" UserInfo=0x20a80820 {com.facebook.sdk:ErrorLoginFailedReason=com.facebook.sdk:ErrorLoginFailedReason, com.facebook.sdk:ErrorInnerErrorKey=Error Domain=NSCocoaErrorDomain Code=3840 "The operation couldn’t be completed. (Cocoa error 3840.)" (No value.) UserInfo=0x208ed930 {NSDebugDescription=No value.}}
What am I doing wrong that would cause this problem?
Update: I just noticed that my app is not appearing in the Settings > Facebook > "Allow these apps to use your account' section. (It was definitely there earlier today).
Update2: If I delete my account from the iOS Settings app, and then log my test user into the Facebook iPhone app, I am able to login with fast app switching. So it appears to only be a problem with the native account.
Update3: I ran the sample Facebook app Scrumptious I have the same problem. Upon clicking 'Login', which calls the openActiveSessionWithRead... I get the same error.
Update4: Possibly related to this bug? http://developers.facebook.com/bugs/450137751688028?browse=search_50a43a39b37ae4868318658
Update5: I should have mentioned this earlier, but it was a Facebook test user account that had this problem.
I switched from using a Facebook test user account to a regular account and this solved the problem on both the Scrumptious app and my app.
Have you set the FacebookAppID in your plist? See "Adding your Facebook App ID" in section 5 of the Getting Started with the Facebook SDK. Also, check the "Facebook" section of your device's settings to make sure your app hasn't been unauthorized (in which case it won't be authorized unless you manually do so).

ACAccountStore Error 5

When attempting to save an account into an ACAccountStore, I sometimes receive this error. Later, if I attempt to access this account, I find that it's actually been saved. So far, I've yet to find any information about this nondescript error. Does anyone know what it means?
Error Domain=com.apple.accounts Code=5 "The operation couldn't be completed. (com.apple.accounts error 5.)"
This question is a little dated, but I'm struggling in the same area. Here's one thing that should help: I did find documentation on the error codes:
typedef enum ACErrorCode {
ACErrorUnknown = 1,
ACErrorAccountMissingRequiredProperty,
ACErrorAccountAuthenticationFailed,
ACErrorAccountTypeInvalid,
ACErrorAccountAlreadyExists,
ACErrorAccountNotFound,
ACErrorPermissionDenied,
ACErrorAccessInfoInvalid
} ACErrorCode;
I found this in the documentation under the Accounts.framework link.
Interpreting this gives error=5 being "Account already exists" and error=6 being "Account not found." I'm hopeful this makes the errors a little less "nondescript."
This error occurs because you didn't set the Facebook account in the settings. The settings are available in iOS 6. Set that account and then try again.
Also give proper alert message on error.
While I didn't find any documentation to support (or contradict) my findings, here is what seems be changed (since iOS 5):
In iOS 5, the user is prompted with access request even when there are no Twitter accounts setup. In iOS 6 it seems the request is declined with error code 6 when there are no accounts setup.
In iOS 5 the user is prompted again (and again) with access request if the user had previously disabled access to said account from Settings > Twitter. Now, in iOS 6, it seems access request is silently declined (with no error, i.e. nil error) if user has removed access to app from Settings
If anyone else finds a better answer, do comment, please.

Resources