【问题标题】:Send push with parse to certain device?将带有解析的推送发送到特定设备?
【发布时间】:2014-03-19 00:27:31
【问题描述】:

我刚刚完成了这个(非常好的)教程:https://parse.com/tutorials/ios-push-notifications 只剩下一个问题了。我可以在我的应用程序中仅向一个特定设备(可能使用device token?)而不是每个设备发送推送消息吗?我现在不一定需要知道如何,一个简单的“是的,使用 parse 是可能的”或“不,你不能为此使用 parse”就足够了!

干杯

【问题讨论】:

标签: android ios push parse-platform device


【解决方案1】:

您可以在ParseInstallation 中保存设备ID,然后定位此安装:

接收者:

ParseInstallation installation = ParseInstallation.getCurrentInstallation();
installation.put("device_id", "1234567890");
installation.saveInBackground();

发件人:

ParseQuery query = ParseInstallation.getQuery(); 
query.whereEqualTo("device_id", "1234567890");    
ParsePush push = new ParsePush();
push.setQuery(query);
push.sendPushInBackground();

【讨论】:

  • 没有sendPushInBackground()时怎么办?
【解决方案2】:

是的,你可以。有多种方式,您可以使用设备令牌或订阅频道,甚至可以基于安装对象中的任何其他列。

首先,您可以使用 Parse 提供的 Push Composer 选项。

查看这些以获取更多信息:

https://parse.com/docs/push_guide#top/iOS

https://parse.com/products/push

http://blog.parse.com/2011/07/18/targeted-push-notifications/

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-02-28
    • 2017-10-03
    • 1970-01-01
    • 2015-11-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多