我试图使用RHMAP向iOS设备发送推送通知。谁能让我知道如何使用RHMAP发送推送通知到特定的设备ID。我可以向所有设备发送通知,但不能发送到特定设备。我在RHMAP文档中也找不到关于这个的任何东西。
发布于 2017-03-28 18:03:20
RHMAP有很多关于推送通知的文档和例子。
您要查找的信息在产品功能文档的"2.3.4.2.收件人筛选“一节中。
别名-用户标识,如用户名或代表单个人的电子邮件(可能有多个设备)。目的是启用单播通信模型。
有关更多信息和示例,您可以向fh.push client API2和fh.push CloudAPI3查询。在这里,您可以在推送通知中找到具有筛选条件的以下示例。
Push a message for specific deviceType in a specific Client App
var message = {
alert: "hello from FH"
},
options = {
apps: ["3uzl1ebi6utciy56majgqlj8"], // list of App IDs
criteria: {
deviceType: "android"
}
};
$fh.push(message, options,
function (err, res) {
if (err) {
console.log(err.toString());
} else {
console.log("status : " + res.status);
}
});在上面的示例中,为了实现使用别名的方法,需要将别名的deviceType更改为下面的示例。
alias: [] // Set here the alias that you are looking for下面是Android的一个示例。
import com.feedhenry.sdk.PushConfig;
..........
......
...
private void register() {
PushConfig p = new PushConfig();
p.setAlias("my-alias");
FH.pushRegister(p, new FHActCallback() {
@Override
public void success(FHResponse fhResponse) {
startActivity(new Intent(RegisterActivity.this, MessagesActivity.class));
}
@Override
public void fail(FHResponse fhResponse) {
Toast.makeText(getApplicationContext(),
fhResponse.getErrorMessage(), Toast.LENGTH_SHORT).show();
finish();
}
});
}1- features/#sending-notifications
2- api/#fh-push
3- api/#fh-push
发布于 2017-03-07 13:16:03
您可以为设备设置别名,并使用该别名向设备发送通知。
由于您没有提到哪个SDK (Objective、Swift、Cordova),您使用的是哪个SDK(Objective、Swift、Cordova),因此我无法帮助您设置别名,因为它们每个都是不同的,如果您提供更多的信息,我可以尝试帮助您。
https://stackoverflow.com/questions/40173854
复制相似问题