如何在没有警报的情况下发送Parse推送通知?

时间:2015-07-10 02:24:57

标签: ios parse-platform push-notification

我正在使用云代码从解析发送推送通知。问题是我不想要任何类型的警报,因为我只使用推送通知来触发其他人应用程序中的方法。

如何在没有任何警报的情况下发送推送通知我希望它纯粹是在后台?

非常感谢任何帮助。

这是我当前的代码,如何在没有任何警报的情况下执行此操作?

PFQuery *pushQuery = [PFInstallation query];
        [pushQuery whereKey:@"userId" containedIn:friendArray];

        // Send push notification to query
        PFPush *push = [[PFPush alloc] init];
        [push setQuery:pushQuery]; // Set our Installation query
        [push setMessage:nil];
        [push sendPushInBackground];

1 个答案:

答案 0 :(得分:1)

我明白了。

  1. 如果您将[push setMessage:""];设置为完全相同,则通知不会在应用程序之外弹出。

  2. 注释掉或删除[PFPush handlePush:userInfo];,以便通知不会在应用内弹出。

  3. 推送通知现在仍然会触发- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo方法,但不会发出任何警告:)

    现在,您可以使用推送通知调用没有警报的方法。

相关问题