4

In my app, I've already integrated Dropbox Sync SDK. So when the Dropbox Chooser SDK for iOS comes in, I give it a try.

My question is, when I tested on my actual device, it says

"Unable to Generate Link. Sorry, an error occurred. Please try again later."

// Note: They say "You may have a project that requires multiple app keys because it also uses the Core or Sync API. In this case, you'll need to explicitly initialize your own instance of the Chooser with the right app key by using the -initWithAppKey: method."

Update: Because I already has the same URL scheme for the Sync API, so what I did was to initialize another instance of Chooser with -initWithAppkey: method in both -application:openURL:sourceApplication:annotation: in my AppDelegate

-(BOOL) application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { // instantiate a new DBChooser instance with Chooser Key // .. make sure it should not include 'db-' prefix DBChooser *chooser = [[DBChooser alloc] initWithAppKey:@"my-chooser-key"]; if ([chooser handleOpenURL:url]) { // This was a Chooser response and handleOpenURL automatically ran the // completion block return YES; } return NO; } 

... and my top most view controller.

- (void)didPressChoose { // .. make sure it should not include 'db-' prefix DBChooser *chooser = [[DBChooser alloc] initWithAppKey:@"my-dropbox-key"]; [chooser openChooserForLinkType:DBChooserLinkTypeDirect fromViewController:self completion:^(NSArray *results) { if ([results count]) { // Process results from Chooser _result = results[0]; NSLog(@"%@", _result.link); } else { // User canceled the action } }]; } 
1
  • 2
    Sounds like some connection issue, or otherwise some issue Dropbox-side. Open a ticket using the "API support" link on dropbox.com/developers for help Commented Jul 22, 2013 at 19:56

1 Answer 1

2

Make sure you do the request with the right app-key. Not the one you use for the syncer, but a new Drop-in app with its own app key.

If you did that, try to manage your own instance of the DBChooser. Now you take an instance and call an init-method on it. You should manage your own singleton instance which you share through you app. You should create that instance with [[DBChooser alloc] initWithAppKey:@"my-dropbox-key"]. Never use the defaultChooser in your case.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.