【问题标题】:Push Notifications aren't sent - Parse SDK不发送推送通知 - Parse SDK
【发布时间】:2014-05-19 12:45:55
【问题描述】:

我正在使用Parse SDK 创建和发送推送通知,但是我发现我的通知都没有到达。难道我做错了什么?我已经正确设置了 App ID 和 Provisioning Profile,因为我可以从 Parse.com Dashboard 发送测试通知

        // Create new Push Notifications
        PFQuery *pushQuery = [PFInstallation query];
        [pushQuery whereKey:@"user" equalTo:otherUser];

        NSString *pushNotificationMessage = [NSString stringWithFormat:@"%@ added you",[[PFUser currentUser] username]];

        // Send push notification to query
        PFPush *push = [[PFPush alloc] init];
        [push setMessage:pushNotificationMessage];
        NSDictionary *dict = [[NSDictionary alloc] initWithObjectsAndKeys:@"added you",@"Alert", nil];
        [push setData:dict];
        [push setQuery:pushQuery];
        [push sendPushInBackground];

【问题讨论】:

  • 您是否检查了查询以确保它确实返回了结果?如果是,推送是否显示在 Parse 的服务器上?
  • 嗨...请您描述一下这一行中的用户是什么... [pushQuery whereKey:@"user" equalTo:otherUser];

标签: ios objective-c parse-platform


【解决方案1】:

从您的设备发送推送通知后,检查解析中的“推送通知”部分。

检查订阅者,如果订阅者为零则表示:

  1. 任一查询错误,未返回用户。
  2. 用户的设备未注册。
  3. 对于用户的创建和设备注册,您使用自定义 班级。需要使用内置的解析用户注册用户 类。

希望这些内容对您有所帮助。我遇到了同样的问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-05-17
    • 1970-01-01
    • 1970-01-01
    • 2023-03-14
    • 1970-01-01
    • 2015-01-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多