【发布时间】:2015-08-19 21:39:41
【问题描述】:
在我的 iOS 应用程序中,我想在 didreceiveRemotenotification 方法中接收 推送通知 时隐藏 UIAlertView。
应用程序委托的整个页面我没有为显示 UIAlertView 编写代码。那为什么会自动显示呢?
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
[PFPush handlePush:userInfo];
if (application.applicationState == UIApplicationStateActive) { self.noti_json=[userInfo objectForKey:@"msg"];
[[NSNotificationCenter defaultCenter] postNotificationName:[userInfo objectForKey:@"title"] object:self];
} }
提前致谢。
编辑(为我的didReceiveRemoteNotification: 添加代码):
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
{
[PFPush handlePush:userInfo];
if (application.applicationState == UIApplicationStateActive)
{
self.noti_json=[userInfo objectForKey:@"msg"];
[[NSNotificationCenter defaultCenter] postNotificationName:[userInfo objectForKey:@"title"] object:self];
}
}
【问题讨论】:
-
发布你的 didreceiveRemotenotification 方法实现
-
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo { [PFPush handlePush:userInfo]; if (application.applicationState == UIApplicationStateActive) { self.noti_json=[userInfo objectForKey:@"msg"]; [[NSNotificationCenter defaultCenter] postNotificationName:[userInfo objectForKey:@"title"] object:self]; } }
标签: ios hide uialertview