通过解析向单个设备发送推送通知

par*_*ram 5 android parse-platform

我可以在我的Android应用程序中向一个特定设备(可能带有设备ID?)而不是每个设备发送推送消息吗?
一个简单的"是的,那可能是解析"或"不,你不能使用解析"就足够了!如果ans是,那么我需要知道如何.....

mak*_*tar 9

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

接收器:

ParseInstallation installation = ParseInstallation.getCurrentInstallation();
installation.put("device_id", "1234567890");
installation.saveInBackground();
Run Code Online (Sandbox Code Playgroud)

发件人:

ParseQuery query = ParseInstallation.getQuery(); 
query.whereEqualTo("device_id", "1234567890");    
ParsePush push = new ParsePush();
push.setQuery(query);
push.sendPushInBackground();
Run Code Online (Sandbox Code Playgroud)