【发布时间】:2012-12-10 09:02:19
【问题描述】:
我在 iOS 应用中使用 parse.com 和 iOS Parse Framework。我想向频道发送推送通知,但我希望将徽章的值设置为 1,即使用户收到多个通知。
这是用于发送通知的代码,取自文档:
NSDictionary *data = [NSDictionary dictionaryWithObjectsAndKeys:
@"Here is the content of the notification !", @"alert",
@"Increment", @"badge",
@"cheering.caf", @"sound",
nil];
PFPush *push = [[PFPush alloc] init];
[push setChannels:[NSArray arrayWithObjects:@"A Channel", nil]];
[push setData:data];
[push sendPushInBackground];
这里是what they say(转到“发送选项”>“自定义通知”)关于字典中badge 键的值:
徽章: (仅限 iOS) 应用图标右上角指示的值。 这可以设置为一个值或 Increment 以将当前值增加 1。
很明显,@"Increment" 的值可以正常工作,但我想始终将徽章值设置为“1”。
什么是正确的语法?好像没找到!
【问题讨论】:
标签: ios push-notification badge parse-platform