I’m using the iOS Dropbox SDK and want to check if my App is already linked with a Dropbox account. So I do:
if (self.isLinked) {
NSLog(@"linked");
}
However self.isLinked always returns YES. Even after cleaning and resetting the iPhone Simulator.
This only occurs when running in the iOS simulator not on a real device. I don’t know why this happens, but the Dropbox SDK on the Simulator also is linked if its host Mac is linked with a Dropbox account.
To get realistic behavior in the Simulator unlink your Mac in the Dropbox Preferences.
Sometime in mid-2012 (can’t find the iOS SDK version log) the Dropbox iOS SDK behaviour changed to retain ‘link’ status through uninstall/reinstall of an app (even on device). As a result, apps that perform some action on receiving the ‘linked’ callback (like mine) would not work after a reinstall.
One solution is to unlink on first-run. Something like so: