2017 © Pedro Peláez
 

library web-push-notifications

Web Push Notifications for websites

image

pushassist/web-push-notifications

Web Push Notifications for websites

  • Friday, February 16, 2018
  • by bluehaoran
  • Repository
  • 3 Watchers
  • 6 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 200 % Grown

The README.md

web-push-notifications

Push Notification Delivery & Analytics for Websites and Mobile, (*1)

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., (*2)

Initialization

Simply require and initialize the PushAssist class like:, (*3)

require_once 'PushAssist.php';

Composer Installation

To install PushAssist Class, simply:, (*4)

$ 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., (*5)

About PushAssist

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

The Versions

16/02 2018

dev-master

9999999-dev https://github.com/PushAssist/Web-Push-Notifications

Web Push Notifications for websites

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

push notifications web push notifications