【发布时间】:2016-07-19 21:39:37
【问题描述】:
这是我的有效载荷
{
aps = {
ImageURL = "http://i.forbesimg.com/media/lists/people/cristiano-ronaldo_416x416.jpg";
alert = testing;
};
}
这是我的代码
NSDictionary *aps = [[NSDictionary alloc] initWithDictionary:[launchOptions objectForKey:@"aps"]];
NSString *text = [aps objectForKey:@"alert"];
NSString *imageUrl = [aps objectForKey:@"ImageURL"];
此代码在 didRecievePushNotification 中有效,但在 didFinishLaunching 中无效
【问题讨论】:
-
你确定你的 launchOptions 字典在从这两种方法调用时是一样的吗?尝试记录 launchOptions 并比较输出。
-
实际上是在我杀死应用程序并发送推送通知时的问题,当时没有调试器
标签: ios objective-c iphone push-notification