MrBlue
API for sending messages via various mobile notification services

Supported Games
GameServerKingsGameServerKings
used by

Push API is an API for sending messages via Pushalot, Pushbullet, and Pushalot mobile notification services. Keep in mind that alone this does nothing, as it's an API meant for other plugins to utilize. To use this with a supported plugin, simply install like you would any other plugin and configure.

Supported Services

Pushalot Service

  • 500 pushes per day, 300 messages per 300 seconds per IP address
  • Priority: high, low, quiet
  • Apps: Windows and Windows Phone
  • Signup at Pushalot.com

Pushbullet Service

  • 500 pushes per month for free accounts
  • Priority: no priority options available
  • Apps: Android, iOS, Chrome, Firefox, Safari, Opera
  • Signup at Pushbullet.com

Pushover Service

  • 7,500 pushes per month per application for free accounts
  • Priority: high, low, quiet
  • Sounds: pushover.net/api#sounds
  • Apps: Android, iOS, Chrome, Firefox, Safari, Windows
  • Signup at Pushover.net

Configuration

{
  "Pushalot Auth Token (32 characters)": "",
  "Pushbullet Access Token (34 characters)": "",
  "Pushover App Key (30 characters)": "",
  "Pushover User Key (30 characters)": "",
  "Service Name (Ex. pushover)": ""
}

Developer API

To call the functions in this API your plugin needs to get the plugin reference:

[PluginReference] Plugin PushAPI;

You can now call functions such as PushMessage to send notifications:

PushAPI?.Call("PushMessage", "This is a test", "This is a test of the Push API!");

Optional example with Push on Loaded

using Oxide.Core.Plugins;

namespace Oxide.Plugins
{
    [Info("Push Test", "Wulf/lukespragg", 0.1)]
    [Description("Push API test plugin")]
    private class PushTest : CovalencePlugin
    {
        [PluginReference]
        private Plugin PushAPI;

        private void Loaded()
        {
            if (!PushAPI)
            {
                Puts("Push API is not loaded! http://umod.org/plugins/push-api");
                return;
            }

            PushAPI.Call("PushMessage", "This is a test", "This is a test of the Push API!");
        }
    }
}

Required example with Push on command and callback

// Requires: PushAPI
using System;
using Oxide.Core.Libraries.Covalence;
using Oxide.Core.Plugins;

namespace Oxide.Plugins
{
    [Info("Push Test", "Wulf/lukespragg", 0.1)]
    [Description("Push API test plugin")]
    private class PushTest : CovalencePlugin
    {
        [PluginReference]
        private Plugin PushAPI;

        [Command("push.test")]
        private void TestCommand(IPlayer player, string command, string[] args)
        {
            Action<bool> callback = response =>;
            {
                if (player.IsConnected)
                {
                    player.Reply(response ? "Push test was a success!" : "Push test failed");
                }
            };

            PushAPI.Call("PushMessage", "This is a test", "This is a test of the Push API!", "high", callback);
        }
    }
}

MIT License, with distribution exclusivity for uMod.org


Copyright (c) 2020 Wulf


Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:


The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.


THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.