2015-09-30 38 views
0

我們正在開發移動應用程序。首先,我們將註冊選項放入移動設備(Bluemix js Push API)。但是,出於安全原因,我們將所有(註冊設備,push devicebyid,tag ..)選項移至node.js服務器。我使用node.js Bluemix Push API,但是我沒有在那裏找到註冊設備選項。如何通過node.js註冊設備Bluemix推送API

我裝:

npm install ibmbluemix 
npm install ibmpush 

我寫了下面的功能在服務器端:

ibmpush.pushNotificationAll(JSON.parse(req.body),function(response){ 
     res.send(response); 
    }); 

    ibmpush.pushNotificationDeviceIds(JSON.parse(req.body),function(response){ 
     res.send(response); 
    }); 

ibmpush.pushNotificationAll(JSON.parse(req.body),function(response){ 
     console.log("push sent successfully",response); 
     res.send(response); 
    }); 

請幫我註冊一個設備通過Node.js的推式API。

+0

感謝ü@Bill溫特沃斯 – Gopi

回答

4

假設您正在使用MBaaS後端應用程序,目前還沒有通過Node.js推送API註冊設備的方法。 你可以找到JavaScript API的文檔推送這裏:

https://mobile.ng.bluemix.net/mbaas-api/docs/JavaScript/IBMPushService.html

如果您使用的是國際貨幣基金組織的後端應用程序,您可以使用REST API來註冊設備。你可以在這裏找到IMF REST API文檔:

https://mobile.ng.bluemix.net/imfrestapi/imfswagger/docs#!/push/registerDevice_post_15

+0

提供更多信息和可能的代碼片段,而不僅僅是鏈接,他們可以隨時間改變。 – Leb

+0

請給出一些示例鏈接@John – Gopi

+0

@Gopi約翰表示目前沒有辦法在MBaaS中註冊從節點推送,所以不會有示例代碼片段 –

相關問題