您好我在这里有关于从我的应用程序发送推送通知的问题。我可以从管理面板发送它们,但它们是由设备接收的,但不是从设备接收的。我现在已经多次重新上传了开发和生产证书。此外,推送通知只能从沙箱环境中的管理面板发送(无错误)而不是生产环境(无收件人。至少应该为一个用户订阅APNS(Apple推送)(通过SDK或REST API)。有人帮忙吗?
//
NSString *message = @"Testing APNS!";
NSMutableDictionary *payload = [NSMutableDictionary dictionary];
NSMutableDictionary *aps = [NSMutableDictionary dictionary];
[aps setObject:@"default" forKey:QBMPushMessageSoundKey];
[aps setObject:message forKey:QBMPushMessageAlertKey];
[payload setObject:aps forKey:QBMPushMessageApsKey];
QBMPushMessage *pushMessage = [[QBMPushMessage alloc] initWithPayload:payload];
// Send push to user
[QBMessages TSendPush:pushMessage toUsers:self.opponent.login delegate:self];
//
答案 0 :(得分:0)
[QBMessages TSendPush:pushMessage toUsers:self.opponent.login delegate:self];
您无法向用户登录发送推送通知,您必须使用用户ID
例如:
[QBMessages TSendPush:pushMessage toUsers:@"22,33,77" delegate:self];