我已將我的雲代碼函數上傳到back4app,並在我的android工作室中調用雲功能,但它會返回無效函數,請幫助我。在back4app服務器解析推送通知
雲碼功能
Parse.Cloud.define('push', function (req, res)
{
Parse.Push.send(
{
alert: req.params.alert;
data: req.params.data;
},
{
success: function (result)
{
res.success(result);
},
error: function()
{
res.error("Nothing here");
}
});
});
我的回調函數在Android Studio中
HashMap < String, Object > params = new HashMap < String, Object >();
params.put("data", data);
params.put("alert", "User " + email + " Liked " + getnaeofcommenter + " comment");
ParseCloud.callFunctionInBackground("push", params, new FunctionCallback <Object>()
{@
Override
public void done(Object o, ParseException e)
{
if (e == null)
{
Toast.makeText(context, "Push notification sent", Toast.LENGTH_SHORT).show();
}
else
{
e.getMessage().toString();
}
}
});