Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/179.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
通过PushOver的Javascript(用户脚本)智能手机通知_Javascript_Android_Push Notification_Push_Pushover - Fatal编程技术网

通过PushOver的Javascript(用户脚本)智能手机通知

通过PushOver的Javascript(用户脚本)智能手机通知,javascript,android,push-notification,push,pushover,Javascript,Android,Push Notification,Push,Pushover,我试图用用户脚本中的PushOver AVI向我的智能手机发送消息 代码如下所示: function sendMsg() { $.ajax({ type: "POST", url: "https://api.pushover.net/1/messages.json", datatype: "application", token: "xxXxXxXXXxXx", user: "xXxXXYXxyxX",

我试图用用户脚本中的PushOver AVI向我的智能手机发送消息

代码如下所示:

function sendMsg() {

    $.ajax({
        type: "POST",
        url: "https://api.pushover.net/1/messages.json",
        datatype: "application",
        token: "xxXxXxXXXxXx",
        user: "xXxXXYXxyxX",
        device: "samsungs4",
        message: "This is a test message",
        sound: "echo",
        success: function(){ console.log("Message sent"); },
        error: function(){ console.log("Couldn't send message"); }
    });
}
然而,当我从一个随机网站(在用户脚本中添加为@match)执行此脚本时,我得到错误400“错误请求”

根据他们的API,我的请求看起来很好,我想不出为什么它不起作用


也许有更有经验的人可以帮我。

将所有内容作为数据发布:解决问题