DropboxSDK: credentials not saved - ios

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 ?

Related

react-native-text-detector worked fine in android but why it always returned false in iOS?

First, I used https://github.com/jeanpan/react-native-camera-roll-picker#readme to get an image from photo library, it returned a uri: ph://11A68DD6-A651-462D-BDAB-68FB853ED141/L0/001
Then, I used https://github.com/zsajjad/react-native-text-detector to get text from that image
It worked fine in android but it always returned false in iOS, and I found the following error in console log
NSURLConnection finished with error - code -1002
For more information, the image control can show that image correctly
Here is my source code : https://github.com/haison8x/react-native-test-ocr
Is there any problem with that URI or with application permission?
Due to the sandbox policy of Apple https://developer.apple.com/library/archive/documentation/Security/Conceptual/AppSandboxDesignGuide/AboutAppSandbox/AboutAppSandbox.html, your app cannot read the photo in gallery directly, it will encounter the error: NSURLConnection finished with error - code -1002.
Here is my approach:
Use RNFS.copyAssetsFileIOS copy photo to temp file at your app documents
Use react-native-text-detector to analyze that temp file
The full example is pushed to https://github.com/haison8x/react-native-test-ocr

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. :)

"Login cancelled by player" callback in facebook api for Unity IOS (only if you have facebook app in device)

I am using unity facebook api 4.3.6 for ios. Its working perfectly fine if I don't have #facebookapp in my device. Once I download it and try login, it takes me to #facebookapp and redirect again to my game with callback
FB Login callback : {"is_logged_in":false, "user_id":"", "access_token":""}
Login cancelled by player
This happens only if I have facebook app downloaded! I think its some how cache issue but not sure exactly what is it. Any luck?
I believe this is not connected with Unity.
Here is few reasons I faced
You need to ask read and write permissions separately. Wait until you get read permissions than send request for write permission.
Make sure your app is allowed to login ( if you have FB app installed on your device )
Make sure you have your app bundle identifier added to developer.facebook.com
Here is what helped me fixed that problem with Unity Facebook-Android.
setting the sandbox mode ON:
Go to https://developers.facebook.com/apps
Select the respective app from the drop down.
Go to 'Status & Review' from the table in the left side of the page.
Do you want to make this app and all its live features available to the general public? - Select switch to set YES/NO value.
if the ON/OFF button is disable, please go back to Settings and enter a valid email address.
I understood why when the device is installed a facebook app, my app can't login facebook.
First : software OpenSSL create keyhass wrong. I have downloaded OpenSSL from here : http://code.google.com/p/openssl-for-windows/downloads/list , and it creates keyhash wrong.
I have used other OpenSSL sofware, you can download it here : https://www.dropbox.com/sh/t6tt44dc2nm6vza/6mp1W74GiZ , it is create keshash right.
Second: In class FacebookAndroidUtil.cs , line 62, you add System.Environment.GetEnvironmentVariable("HOMEDRIVE") before System.Environment.GetEnvironmentVariable("HOMEPATH"). Facebook SDK requires a file debug.keystore in : C:\Users\UserName.android\debug.keystore.
If the Unity Editor, Edit Setting Facebook has yet to create android debug hash key. Then use the Eclipse Software, create and run onr any project. Eclipse will generate a debug.keystore. If it is't create in folfer : C:\Users\UserName.android\debug.keystore , then find it, coppy and paste into C:\Users\UserName.android\debug.keystore
Third: publish your app in Facebook, so be sure it is:"This app is public and available to all users".

Dropbox iOS SDK: WebKit Discarded an Uncaught Exception

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.

Why can't I link my dropbox app using mergDropbox?

I can't seem to get a response from Dropbox when I call any of the mergDropbox commands. I've setup an app on Dropbox, so I have an app key and secret to pass in the mergDropbox setup command but nothing happens when I do. All this works fine in the demo stack that comes with the external (which links me to Monte's demo Dropbox app) BTW.
I wonder if it has anything to do with the fact that my Dropbox app status is 'development' rather than 'production', but if it is then I'm unsure how to proceed as I am unable to apply for production status until I have successfully linked to the app - which seems like a catch 22 situation to me.
This question was asked on a mailing list, however, I thought the answer would be helpful to others so I'm posting here.
The problem that's occurring is you haven't set the custom url scheme required by the dropbox app to return to your app after linking. When you don't set this and you try and link the app then you don't switch to the Dropbox app and the dropbox sdk logs something like this:
[ERROR] DropboxSDK: unable to link; app isn't registered for correct URL scheme (db-c0sbjqyibf12hg1)
So what you need to do is enter db-yourappkey as your custom url scheme here:

Resources