Skip to content

mafuth/onesignal-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 

Repository files navigation

ONESIGNAL SDK

Installation

Clone the repo

git clone https://github.com/mafuth/onesignal-sdk.git

config

require 'onsignal.class.php';
$ONESIGNAL =  new onesignal (
'your app id',
'your app key',
'your app icon',
'your app safari web id',
'your app email'
);

send a notification

$ONESIGNAL -> creatNotification(
'user ids to get notification',
'title of the notification',
'your message',
'redirect url'
);

cancel a notification

$ONESIGNAL -> cancelNotification('notification id');

get notification history

print_r($ONESIGNAL -> getHistory());

get all user devices

print_r($ONESIGNAL -> getDevices());

creat html code to get user id and post to a url using ajax jquery

echo $ONESIGNAL -> createCode(
'url you want to sent a post request with user id',
'post variable for user id',
'if you have ajax.js already included in you scripts use true else use false'
);

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages