1. develephant
  2. mod_pushbots

Wiki

Clone wiki

mod_pushbots / Home

IMPORTANT: THIS MODULE IS NO LONGER BEING MAINTAINED.

Check out GameThrivePushNotifications for other free push options.

Pushbots Module

mod_pushbots is an unofficial Pushbots.com module for use in Corona SDK. Read on for usage information or jump to the docs.

You need to sign up for the Pushbots.com service to use the module.


Download the Pushbots module by clicking here. (Docs)


Usage

Make sure to include the "Internet" permission on Android in your build.settings:

--build.settings
settings = {
  androidPermissions = {
    "android.permission.INTERNET",
   },
}

To use the module you must first require it, then initialize it with your Pushbots appId.

Require the module:

local pushbots = require( "mod_pushbots" )

Initialize

Pass your Application ID from your Pushbots account:

pushbots:init( "PUSHBOTS_APP_ID" )

Debug Flags

You can set the following flags after you initialize the Pushbots module:

pushbots.showStatus = true|false -- outputs response info in the console
pushbots.showAlert = true|false -- show a native pop-up with error and result codes
pushbots.showJSON = true|false -- output the raw JSON response in the console

All debug flags default to false.


Callbacks

If you supply a callback method to the API call, you will recieve an event table with the following properties:

response The response from the call to the Pushbot API. Could be string, data table or nil.

error The error from the call to the Pushbot API. If empty will equal nil.

local function onDeviceInfo( event )
 if not event.error then
  print( event.response )
 else
  print( event.error )
 end
end

pushbots:getDevice( "device-token", onDeviceInfo )

Module Docs

View all of the module methods in the Pushbots Module Docs.


Tutorials

Using the Pushbots Module with Corona SDK

Pushbots Apple iOS Set-Up

Pushbots Google Android Set-Up

Updated