gpt4 book ai didi

parse-platform - 如何从 Parse 安装中检索设备 token

转载 作者:行者123 更新时间:2023-12-02 03:12:33 26 4
gpt4 key购买 nike

我已经构建了一个 Trigger.io 应用程序,并且一直在为我的推送通知使用解析。

我现在正在迁移到 pushwoosh 以满足我的推送通知需求,但是我意识到 parse 使用安装 id 来推送通知,但 pushwoosh 使用设备 token 。

我无法从解析中检索设备 token ,因为可用函数只允许我检索安装 ID。

forge.parse.installationInfo(function (info) {
//info object only stores the installation id
forge.logging.info("installation: "+JSON.stringify(info));
});

但是对于 pushwoosh,我需要来自服务器端的设备 ID 将消息推送到特定设备
//Notify some devices or a device:
Pushwoosh.notify_devices(message, devices, other_options)

所以我的问题是,在我将数据从 parse 迁移到 pushwoosh 之后,如何检索所有旧用户的所有设备 token ,以便我也可以向使用 parse 通知的用户发送通知消息?

最佳答案

对于 Android,您可以获得 devicetoken使用下面的代码。 Trigger.io没有 JavaScript他们的 API 中相同的包装器。您可以根据自己的目的构建它。

ParseInstallation.getCurrentInstallation().saveInBackground(new SaveCallback() {
@Override
public void done(ParseException e) {
String deviceToken = (String) ParseInstallation.getCurrentInstallation().get("deviceToken");
}
});

关于parse-platform - 如何从 Parse 安装中检索设备 token ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39060071/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com