如何知道 iOS 中推送通知的内容?
How to know what's coming from push notification in iOS?
我无法使用 NSLog,因为模拟器不支持推送通知。我如何查看来自推送通知的数据以及 launchOption 字典中的内容?
首先你想要真实的设备来检查推送通知。
在ios
中有一种检查推送通知内容的方法
- (void)application:(UIApplication *)application
didReceiveRemoteNotification:(NSDictionary *)userInfo
{
NsLog("%@",userInfo);//In the userinfo you will get the content of push notification.
}
说不定对你有帮助。
我无法使用 NSLog,因为模拟器不支持推送通知。我如何查看来自推送通知的数据以及 launchOption 字典中的内容?
首先你想要真实的设备来检查推送通知。
在ios
中有一种检查推送通知内容的方法- (void)application:(UIApplication *)application
didReceiveRemoteNotification:(NSDictionary *)userInfo
{
NsLog("%@",userInfo);//In the userinfo you will get the content of push notification.
}
说不定对你有帮助。