I\'m adding Dropbox to my app using the SDK available on their site. Is there any way of calling some method once [[DBSession sharedSession] linkFromController:self];<
in App delegate add:
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
if ([[DBSession sharedSession] handleOpenURL:url]) {
[[NSNotificationCenter defaultCenter]
postNotificationName:@"isDropboxLinked"
object:[NSNumber numberWithBool:[[DBSession sharedSession] isLinked]]];
return YES;
}
return NO;
}
and in you custom class:
- (void)viewDidLoad {
[super viewDidLoad];
//Add observer to see the changes
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(isDropboxLinkedHandle:) name:@"isDropboxLinked" object:nil];
}
and
- (void)isDropboxLinkedHandle:(id)sender
{
if ([[sender object] intValue]) {
//is linked.
}
else {
//is not linked
}
}