小记:Bmob云端代码测试APNS推送功能 #代码片段
1 function onRequest(request, response, modules) { 2 var push = modules.oPush; 3 push.send({ 4 "data":{ 5 "where": { 6 "objectId": "ab2fa8d8d2"//ab2fa8d8d2为测试设备的objectId 7 }, 8 "data": { 9 "alert": "Willie Hayes injured by own pop fly." 10 } 11 } 12 },function(err,data){ 13 //回调函数 14 response.send(data) 15 }); 16 }