【发布时间】:2014-02-10 23:30:25
【问题描述】:
我需要从本地通知中打开一个 URL。 我通过 notification.userInfo 传递 URL,然后通过以下代码检索它:
(void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notif {
NSLog(@"didReceiveLocalNotification");
NSString *url = [notif.userInfo objectForKey:@"urlMedia"];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
}
当我单击应用程序打开时,但 openURL 不起作用。
不能用本地通知打开网址吗?
【问题讨论】:
-
网址是什么?是http吗?
-
它是http URL。问题不在URL,是对的......
标签: objective-c ios7 uilocalnotification