Skip to content

eftalyurtseven/ionicPushClass

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP Ionic Push Class

It allows you to send notifications you created via Apps.ionic.io with PHP.

Usage

Ionic Profile Name and Auth Key required for construction function.

$setArray =  [
'profileName' => 'your-profile-name',
'AuthKey' => 'your-auth-key'
];

Set your devices

$devices = ['your-device-tokens'];
$notifyConfig = [
    'title' => "Your push title",
    "message" => "your push message!",
    "android" => [
        'title' => "Your push title",
        "message" => "your push message!",
        "sound" => "your-sound-src" // default
    ],
    "ios" => [
        'title' => "Your push title",
        "message" => "Your push title",
        "sound" => "your-sound-src" // default
    ]
];

Everything's ready, let's call the class now

$IonicPush = new IonicPush($setArray);
$IonicPush -> getDevices($devices);
$IonicPush -> setNotificationArray($notifyConfig);
if ($IonicPush -> send()){
    echo 'Push sent!';
}else {
    print_r (  $IonicPush -> err );
}

About

Ionic push with PHP

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages