2014-04-01 36 views
0

我设法recive一个推送通知,但我不知道如何处理到达应用的推送通知的点击,我想告诉应用程序时点击Go根据通知的类型,不只是打开应用程序(默认行为)如何处理上点击推送通知IOS

具体活动我知道我可以在这个函数接收

-(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo{ 

    NSLog(@"Here I should Recive The notification .... ") ; 
    //call the commented functions ..... 
} 

,但是当我实现它,通知不要”牛逼出现,只是做在此功能

回答

0

如果您想通过点击pushnotification就在didReceiveRemoteNotification

-(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo{ 

NSLog(@"Here I should Receive The notification .... ") ; 
//call the commented functions ..... 

FirstController *firstviewcontroller = [[FirstController alloc] initWithNibName:@"FirstController" bundle:nil]; 

    [self.navigationController pushviewcontroller:firstviewcontroller animated:YES]; 

} 
+0

但这会做一次我收到通知,而通知将不会出现在设备,我想默认行为的通知出现在设备,当我在敲打我能做的东西.. – mohamed

+0

第一请具体说明你想做什么 – morroko

+0

没有这个功能,我可以收到通知,我只想“点击通知做点什么”在哪里把这个代码 – mohamed

0

添加视图控制器导航代码,委托方法如果应用程序是活动只会被解雇浏览一些特定的视图控制器。如果应用程序未运行,则应在代理方法application:didFinishLaunchingWithOptions:中使用launchOptions获取通知有效内容,并根据有效内容进行导航。

+0

感谢您的回复:),我知道这一点,但所有这一切都将自动发生,我只是想处理上点击通知来执行特定的行为不只是打开应用程序 – mohamed

+0

哦,我明白了,你要添加的通知到通知中心。当您的应用程序处于活动状态时收到远程通知时,您可以添加一个立即的'UILocalNotification'。 – ismailgulek

+0

这个怎么实现? – mohamed