Skip to content

PushAssist/Web-Push-Notifications

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 

web-push-notifications

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.

About

Push Notification Delivery & Analytics for Websites and Mobile

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages