pushassist/web-push-notifications

Web Push Notifications for websites

dev-master 2018-02-16 11:03 UTC

This package is not auto-updated.

Last update: 2024-05-30 14:24:09 UTC


README

Push Notification Delivery & Analytics for Websites and Mobile

Web Push Notifications is a PHP Library to quickly integrate and send push notifications with PushAssist REST API. Setup is easy just create a Free Account, verify your email address and login to your PushAssist Control Panel to get the API & Secret Keys.

Initialization

Simply require and initialize the PushAssist class like:

require_once 'PushAssist.php';

Composer Installation

To install PushAssist Class, simply:

$ composer require PushAssist/Web-Push-Notifications 

Sending Out Notifications

// Create an object
$push_notification = new PushAssist('YOUR API KEY', 'YOUR SECRET KEY');

$notification_array = array("notification" => array(									
						    "title" => 'YOUR NOTIFICATION TITLE',
						    "message" => 'YOUR NOTIFICATION TITLE',
						    "redirect_url" => 'URL TO REDIRECT IF MESSAGE IS CLICKED',
						    "image" => 'MESSAGE IMAGE FULL PATH'),
                            //UTM is optional Keep it empty if you are not passing utm_params.
						    "utm_params" => array("utm_source" => $utm_source,	
							"utm_medium" => $utm_medium,
							"utm_campaign" => $utm_campaign),
                            //Segments is optional notification send only for those who subscribers by this  segment.
						    "segments" => ('Sports', 'Hockey');	
						);

$push_notification->pushassist_send_notification($notification_array)

Sending Out Campaigns

// Create an object
$push_notification = new PushAssist('YOUR API KEY', 'YOUR SECRET KEY');

$campaign_array = array("campaign" => array(									
						    "title" => 'YOUR CAMPAIGN TITLE',
						    "message" => 'YOUR CAMPAIGN TITLE',
						    "redirect_url" => 'URL TO REDIRECT IF MESSAGE IS CLICKED',
							"timezone" => 'TIME ZONE FORMAT(Y-M-D) 24 HOUR FORMAT',
						    "image" => 'MESSAGE IMAGE FULL PATH'),
                            //UTM is optional Keep it empty if you are not passing utm_params.
						    "utm_params" => array("utm_source" => $utm_source,	
							"utm_medium" => $utm_medium,
							"utm_campaign" => $utm_campaign),
                            //Segments is optional Campaign send only for those who subscribers by this  segment.
						    "segments" => ('Sports', 'Hockey');	
						);

$push_notification->pushassist_create_campaigns($campaign_array)

Add Segment

// Create an object
$push_notification = new PushAssist('YOUR API KEY', 'YOUR SECRET KEY');

$segment_array = array("segment" => array(
								"segment_name" => 'YOUR SEGMENT NAME')
							);
							
$push_notification->pushassist_create_segments($segment_array);

Get Account Details

// Create an object
$push_notification = new PushAssist('YOUR API KEY', 'YOUR SECRET KEY');
							
$push_notification->pushassist_account_details();

Get Dashboard Details

// Create an object
$push_notification = new PushAssist('YOUR API KEY', 'YOUR SECRET KEY');
							
$push_notification->pushassist_dashboard_details();

Get Notification History

// Create an object
$push_notification = new PushAssist('YOUR API KEY', 'YOUR SECRET KEY');
							
$push_notification->pushassist_notification_history();

Get Notification Details By Id

// Create an object
$push_notification = new PushAssist('YOUR API KEY', 'YOUR SECRET KEY');
							
$push_notification->pushassist_notification_details_by_id(ID);

Get Notification Details By Account Name

// Create an object
$push_notification = new PushAssist('YOUR API KEY', 'YOUR SECRET KEY');
							
$push_notification->pushassist_notification_details_by_subdomain('ACCOUNT NAME');

Get Campaign History

// Create an object
$push_notification = new PushAssist('YOUR API KEY', 'YOUR SECRET KEY');
							
$push_notification->pushassist_campaigns_history();

Get Campaign Details By Id

// Create an object
$push_notification = new PushAssist('YOUR API KEY', 'YOUR SECRET KEY');
							
$push_notification->pushassist_campaigns_details_by_id(ID);

Get Campaign Details By Account Name

// Create an object
$push_notification = new PushAssist('YOUR API KEY', 'YOUR SECRET KEY');
							
$push_notification->pushassist_campaigns_details_by_subdomain('ACCOUNT NAME');

Get Segment Details

// Create an object
$push_notification = new PushAssist('YOUR API KEY', 'YOUR SECRET KEY');
							
$push_notification->pushassist_segment_details();

Get Segment Details By Id

// Create an object
$push_notification = new PushAssist('YOUR API KEY', 'YOUR SECRET KEY');
							
$push_notification->pushassist_segment_details_by_id(ID);

Get Segment Details By Name

// Create an object
$push_notification = new PushAssist('YOUR API KEY', 'YOUR SECRET KEY');
							
$push_notification->pushassist_segment_details_by_name('SEGMENT NAME');

Get Segment Counts

// Create an object
$push_notification = new PushAssist('YOUR API KEY', 'YOUR SECRET KEY');
							
$push_notification->pushassist_segment_count();

Get Subscribers Details

// Create an object
$push_notification = new PushAssist('YOUR API KEY', 'YOUR SECRET KEY');
							
$push_notification->pushassist_subscribers_details();

Get Subscribers Details By Account Name

// Create an object
$push_notification = new PushAssist('YOUR API KEY', 'YOUR SECRET KEY');
							
$push_notification->pushassist_subscribers_details_by_subdomain('ACCOUNT NAME');

Feel free to integrate web-push-notification by PushAssist into your favorite PHP Framework. If you need any assistance just let us know.

About PushAssist

PushAssist is a Push Notification SaaS service for sites. You can contact us by email at support@pushassist.com.