0
我正在为我的产品构建SDK,并且不会有应用程序委托类。我在SDK中使用了Dropbox集成,所以我必须使用以下方法。我们是否可以添加或使用handleOpenURL其他应用程序代理
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
NSString *stringUrl = [url absoluteString];
if ([stringUrl containsString:@"cancel"]) {
// Handle if user cancelled the login
[[NSNotificationCenter defaultCenter] postNotificationName:@"dropboxRegistrationCancel" object:self];
return NO;
}
if ([[DBSession sharedSession] handleOpenURL:url]) {
if ([[DBSession sharedSession] isLinked]) {
NSLog(@"App linked successfully!");
// At this point you can start making API calls
[[NSNotificationCenter defaultCenter] postNotificationName:ApplicationComeBackFromDropBoxLoginPage object:self];
}
return YES;
}
// Add whatever other url handling code your app requires here
return NO;
}
所以问题是没有应用程序委托,比如何使用上述方法? 或者任何其他的解决方案,以便在另一个类中使用它(如继承UIResponder类)。 寻求帮助。
谢谢弗洛里安,请看看我更新的问题,我完成显示的方法。我使用这种方法区分用户点击取消按钮或成功登录。 – Aleem
此外,这是SDK的一部分,而不是应用程序,用户可以从Dropbox中选择文件 – Aleem
正如你所提到的“它将在你的项目中你将使用你的SDK”我想添加这个我的SDK,我知道我可以添加这个在项目中,可以在SDK文档中提到,但首先我想解决这个问题,如果这可以在SDK中处理。 没有提到这种方法,我可以完成我的任务吗? – Aleem