對於IOS下面的代碼適用於我。我認爲Android已更改爲4.5
var registerParsePush = new SMF.Net.WebClient({
httpMethod : "POST",
URL : "https://api.parse.com/1/installations",
contentType : "application/json",
requestHeaders : ["X-Parse-Application-Id: f5Y4tmDdKOYm5YdKDdDV8W6LDfviqFaCfhMgmxx", "X-Parse-REST-API-Key: PqbhEDYJcXP3xWmWRB6PBuzfIz4OIq0tK4V3dpxx", "Content-Type: application/json"],
onSyndicationSuccess : function (e) {},
onServerError : function (e) {}
});
Notifications.remote.registerForPushNotifications({
OnSuccess : function() {
var pushToken = Notifications.remote.token;
var req = {
"deviceType" : "ios",
"deviceToken" : pushToken,
"channels" : [
""
]
};
registerParsePush.requestString = JSON.stringify(req);
registerParsePush.run(true);
},
OnFailure : function() {}
});
我正在嘗試smartface api推送通知不與解析。爲此,我們需要從smartface api獲取access_token,並將其放置在可以看到所有註冊設備(而不是解析)的地方。 –
您可以將webclient url更改爲您的服務器以記錄令牌 –
感謝Alex。但是,我在哪裏可以獲取smartface api access_tocken來推送通知? –