【发布时间】:2018-02-18 14:29:18
【问题描述】:
我目前正在处理和测试 FCM 主题的订阅。 我正在尝试根据用户个人资料详细信息更新用户订阅的主题列表。
为了获取用户已经订阅的主题列表,我正在使用这个功能,它曾经非常适合一小时的测试:
app.get("/getTopics", function(req, res, next) {
var headers = {
'User-Agent': 'Super Agent/0.0.1',
'Authorization': 'key=my fcm key in here',
'Content-Type': 'application/json'
};
// Configure the request
let notifications_token = "the user notification token returned from the actuall app";
var fcm_firebase = "https://iid.googleapis.com/iid/info/" + notifications_token + "?details=true";
var options = {
url: fcm_firebase,
method: 'POST',
headers: headers
};
// Start the request
request(options, function (error, response, body) {
if (body)
{
let body1 = JSON.parse(body);
if (body1.rel)
{
let topics = [];
for (let k in body1.rel.topics) {
topics.push(k);
}
res.send(topics);
}
else res.send("Error");
}
if (error)
res.send(error);
});
});
如您所见,它已经在运行,并且我收到了用户订阅的主题。 突然,可能是因为很多测试,我没有收到主题,我收到了
"attestStatus":"NOT_ROOTED"
改为。
我曾尝试在 Google 文档中查找有关此内容的信息,我找到了:
attestStatus - 返回 ROOTED、NOT_ROOTED 或 UNKNOWN 以指示 设备是否已root。
但没有任何描述这意味着什么或应该如何解决。
如何解决?
谢谢。
【问题讨论】:
标签: cordova firebase push-notification cordova-plugin-fcm