gpt4 book ai didi

ios - 在通知中心检测特定应用推送通知

转载 作者:行者123 更新时间:2023-11-29 00:48:21 26 4
gpt4 key购买 nike

如果通知中心有通知,请清除该应用NSUserdefault,不点击通知。

UILocalNotification* oneEvent = [eventArray objectAtIndex:i];      
NSDictionary *userInfoCurrent = oneEvent.userInfo;
NSString *uid=[NSString stringWithFormat:@"%@",[userInfoCurrent valueForKey:@"uid"]];
NSString *msg =[NSString stringWithFormat:@"%@",userInfoCurrent];

试过了,还是不行

最佳答案

如果应用程序位于前台或由于用户点击通知而被带到前台,您可以在application:didReceiveRemoteNotification: 方法。

如果应用程序因用户点击通知而启动,您可以在 application:didFinishLaunchingWithOptions: 方法中检测到通知。

如果应用程序不在前台,则除非用户点击通知,否则无法检测到通知。

关于ios - 在通知中心检测特定应用推送通知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38389469/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com