我已成功將自己的網址方案添加到我的應用程序中。該應用程序正確啓動使用該計劃。handleOpenURL在iPhone操作系統中未使用自定義網址架構調用
現在我想處理傳入的數據,但委託沒有被調用。這是一個普遍的應用程序,我還增加了以下功能都AppDelegates:
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
if (!url) { return NO; }
NSString *URLString = [url absoluteString];
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle:NSLocalizedString(@"test message", nil)
message:URLString
delegate:self
cancelButtonTitle:nil otherButtonTitles:@"OK", nil];
[alert show];
[alert release];
return YES;
}
我與喜歡的模式測試:MYAPP://appalarm.com ......並認爲那些是appalarm.com在URLString
它有什麼問題?
感謝您的回覆!
的感謝!該網址也包含在UIApplicationLaunchOptionsURLKey – favo 2010-06-03 10:20:07
的launchOptions中錯誤!如果返回YES,handleOpenURL將在applicationDidFinishLaunchingWithOptions後不久調用。請參閱Apple的「適用於iOS的應用程序編程指南」中「應用程序間通信」一章中的「處理URL請求」一節。 – AmitP 2015-08-25 15:14:40