All Projects → albaraam → php-gcm-apns

albaraam / php-gcm-apns

Licence: MIT license
A PHP Library for sending messages to devices (Android & IOS) through GCM and Apns respectively .

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to php-gcm-apns

Onesignal Unity Sdk
OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your Unity app with OneSignal. https://onesignal.com
Stars: ✭ 161 (+1138.46%)
Mutual labels:  apns, gcm
OneSignal-Ionic-Sample
No description or website provided.
Stars: ✭ 85 (+553.85%)
Mutual labels:  apns, gcm
MongoosePush
MongoosePush is a simple Elixir RESTful service allowing to send push notification via FCM and/or APNS.
Stars: ✭ 101 (+676.92%)
Mutual labels:  apns, gcm
pushex
Push notifications for Elixir
Stars: ✭ 96 (+638.46%)
Mutual labels:  apns, gcm
Notificationpusher
Standalone PHP library for easy devices notifications push.
Stars: ✭ 1,143 (+8692.31%)
Mutual labels:  apns, gcm
azure-notificationhubs-java-backend
Azure Notification Hubs SDK for Java
Stars: ✭ 31 (+138.46%)
Mutual labels:  apns, gcm
Node Pushnotifications
Push notifications for GCM, APNS, MPNS, AMZ (automatic detection from device token)
Stars: ✭ 432 (+3223.08%)
Mutual labels:  apns, gcm
PUSHTestFCM
[FireMonkey] Push test project
Stars: ✭ 17 (+30.77%)
Mutual labels:  apns, gcm
Django Push Notifications
Send push notifications to mobile devices through GCM or APNS in Django.
Stars: ✭ 1,881 (+14369.23%)
Mutual labels:  apns, gcm
Gaurun
General push notification server in Go
Stars: ✭ 804 (+6084.62%)
Mutual labels:  apns, gcm
epns
📱 Erlang Push Notifications. APNS(Apple Push Notifications) and FCM(Firebase Cloud Messaging) Push Notifications
Stars: ✭ 13 (+0%)
Mutual labels:  apns, gcm
Onesignal Ionic Example
Stars: ✭ 89 (+584.62%)
Mutual labels:  apns, gcm
Pushnotification
PHP and Laravel Package to send push notifications to Android and IOS devices.
Stars: ✭ 395 (+2938.46%)
Mutual labels:  apns, gcm
Gorush
A push notification server written in Go (Golang).
Stars: ✭ 5,933 (+45538.46%)
Mutual labels:  apns, gcm
Uniqush Push
Uniqush is a free and open source software system which provides a unified push service for server side notification to apps on mobile devices.
Stars: ✭ 1,238 (+9423.08%)
Mutual labels:  apns, gcm
Onesignal Cordova Sdk
OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your Ionic, PhoneGap CLI, PhoneGap Build, Cordova, or Sencha Touch app with OneSignal. Supports Android, iOS, and Amazon's Fire OS platforms. https://onesignal.com
Stars: ✭ 214 (+1546.15%)
Mutual labels:  apns, gcm
Pu.sh
A bash script to send iOS push notifications with the Apple Push Notification service (APNs)
Stars: ✭ 125 (+861.54%)
Mutual labels:  apns
Apns Http2
A Java library for sending notifications via APNS using Apple's HTTP/2 API.
Stars: ✭ 194 (+1392.31%)
Mutual labels:  apns
Net Core Push Notifications
Lightweight .NET Core Push Notifications for Android and iOS
Stars: ✭ 105 (+707.69%)
Mutual labels:  apns
mobile-push
A push notification library
Stars: ✭ 21 (+61.54%)
Mutual labels:  apns

albaraam/php-gcm-apns

A PHP Library for sending messages to devices (Android & IOS) through GCM and Apns (respectively).

Installation

The preferred way to install this extension is through composer.

Either run

composer require albaraam/php-gcm-apns "~1.0.0"

or add

"albaraam/php-gcm-apns": "~1.0.0"

to the require section of your composer.json.

Usage

use albaraam\gcmapns\Message;
use albaraam\gcmapns\Client;

// Message creation
$message = new Message("Title","Body");

// Common attributes for both ios and android
$message
	->setTitle("Title")
	->setBody("Body")
	->setSound("sound.mp3")
	->setData(['foo'=>'bar']);

// Android specific attributes
$message->android
	->setTo("ids")
	->setIcon("icon")
	->setCollapseKey("collapse_key")
	->setColor("#333");

// IOS specific attributes
$message->ios
	->setTo("ids")
	->setSound("sound_ios.mp3") // custom sound for ios
	->setBadge(3);

// Client
$client = new Client("google_api_key","path/to/pem/file",Client::IOS_ENVIRONMENT_SANDBOX);

// configure client
$client->setIosPassphrase("passphrase");
...

// Send message
$client->send($message);

Usage: Advanced Example

use albaraam\gcmapns\Message;
use albaraam\gcmapns\Client;

$message = new Message("Title","Body");

$message
	->setTitle("Title")
	->setBody("Body")
	->setPriority(5) // 5 or 10
	->setContentAvailable(true)
	->setDryRun(false)
	->setClickAction("") // same as Category
	->setCategory("") // same as ClickAction
	->setTitleLocKey("")
	->setTitleLocArgs("")
	->setBodyLocKey("")
	->setBodyLocArgs("")
	->setSound("sound.mp3")
	->setData(['foo'=>'bar']);


$message->android
	->setTo("ids")
	->setIcon("icon")
	->setCollapseKey(true)
	->setDelayWhileIdle(true)
	->setTimeToLive(3600)
	->setRestrictedPackageName("")
	->setTag("")
	->setColor("#333");

$message->ios
	->setTo("ids")
	->setLaunchImage("")
	->setBadge(3)
	->setActionLocKey("");

$client = new Client("google_api_key","path/to/pem/file",Client::IOS_ENVIRONMENT_SANDBOX);
$client->setIosPassphrase("passphrase");

$client->sendAndroid($message)) // send for android devices only
$client->sendIOS($message)) // send for ios devices only
// $client->send($message)) // send for both ios & android devices
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].