All Projects → pusher → push-notifications-php

pusher / push-notifications-php

Licence: MIT License
Pusher Beams PHP Server SDK

Programming Languages

PHP
23972 projects - #3 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to push-notifications-php

spontit-api-python-wrapper
Send functional, flexible push notifications to iOS, Android, and desktop devices (without your own app or website).
Stars: ✭ 35 (+12.9%)
Mutual labels:  pusher, push-notifications
food-delivery-ios-app
A food delivery application built using Swift for iOS. The application uses Pushers notifications feature to send push notifications to mobile devices.
Stars: ✭ 36 (+16.13%)
Mutual labels:  pusher, push-notifications
Webhook.site
⚓️ Easily test HTTP webhooks with this handy tool that displays requests instantly.
Stars: ✭ 2,842 (+9067.74%)
Mutual labels:  pusher, push-notifications
hms-push-serverdemo-csharp
C# sample code encapsulates APIs of the HUAWEI Push Kit server. It provides many sample programs for your reference or usage.
Stars: ✭ 25 (-19.35%)
Mutual labels:  push-notifications
vuex-chat
Real time chat with Laravel, Vue js, Vuex, Echo and pusher
Stars: ✭ 16 (-48.39%)
Mutual labels:  pusher
OneClip
Share your clipboard with people nearby. No Setup, No Signup.
Stars: ✭ 45 (+45.16%)
Mutual labels:  pusher
webpush-example
A basic push notifications app built on Laravel and Vanilla Javascript.
Stars: ✭ 26 (-16.13%)
Mutual labels:  push-notifications
laravel-web-push
Laravel package for sending out push notifications
Stars: ✭ 14 (-54.84%)
Mutual labels:  push-notifications
aioapns
An efficient APNs Client Library for Python/asyncio
Stars: ✭ 60 (+93.55%)
Mutual labels:  push-notifications
pushercoins
A React.js PWA with realtime features accompanying the tutorial on the Pusher blog.
Stars: ✭ 66 (+112.9%)
Mutual labels:  pusher
abp-push
Push Notification System for ASP.NET Boilerplate
Stars: ✭ 16 (-48.39%)
Mutual labels:  push-notifications
SEPA
Get notifications about changes in your SPARQL endpoint.
Stars: ✭ 21 (-32.26%)
Mutual labels:  push-notifications
apns2
Node client for connecting to Apple's Push Notification Service using the new HTTP/2 protocol with JSON web tokens
Stars: ✭ 66 (+112.9%)
Mutual labels:  push-notifications
perfecty-push-wp
WordPress plugin for self-hosted Web Push Notifications ⚡️
Stars: ✭ 32 (+3.23%)
Mutual labels:  push-notifications
Gunfish
No description or website provided.
Stars: ✭ 35 (+12.9%)
Mutual labels:  push-notifications
xinge
腾讯信鸽push Golang lib
Stars: ✭ 25 (-19.35%)
Mutual labels:  push-notifications
andpush
Android Push Notification in Ruby: The fastest client for FCM (Firebase Cloud Messaging)
Stars: ✭ 83 (+167.74%)
Mutual labels:  push-notifications
apiservices
.NET API services - Managed Push Notifications, Email Engine (Templates, loading, & sending), & Localization Abstractions
Stars: ✭ 25 (-19.35%)
Mutual labels:  push-notifications
livecoding-frontend-projects
Repositório com projetos Front-End
Stars: ✭ 70 (+125.81%)
Mutual labels:  pusher
mod push appserver
Simple and extendable appserver for XMPP pushes (aka. XEP-0357)
Stars: ✭ 24 (-22.58%)
Mutual labels:  push-notifications

Build Status

PHP SDK for Pusher Beams

PHP server library for publishing notifications through Pusher Beams.

Check https://docs.pusher.com/beams/reference/server-sdk-php for more information.

NOTE: This library requires a PHP version of 5.6 or greater

Installation

Get Composer, then get the pusher/pusher-push-notifications Composer package:

$ composer require pusher/pusher-push-notifications

This SDK depends on the JSON PHP module.

Use

Configuring the SDK for your instance

<?php
require __DIR__ . '/vendor/autoload.php';

$pushNotifications = new \Pusher\PushNotifications\PushNotifications(array(
  "instanceId" => "YOUR_INSTANCE_ID_HERE",
  "secretKey" => "YOUR_SECRET_HERE",
));

Publishing to Device Interests

You can broadcast notifications to groups of subscribed devices using Device Interests:

$publishResponse = $pushNotifications->publishToInterests(
  ["donuts"],
  [
    "apns" => [
      "aps" => [
        "alert" => "Hello!",
      ],
    ],
    "fcm" => [
      "notification" => [
        "title" => "Hello!",
        "body" => "Hello, world!",
      ],
    ],
  ]
);

echo("Published with Publish ID: " . $publishResponse->publishId . "\n");

Publishing to Device Interests along with data

You can broadcast notifications with some data to groups of subscribed devices using Device Interests:

$publishResponse = $pushNotifications->publishToInterests(
  ["donuts"],
  [
    "apns" => [
      "aps" => [
        "alert" => "Hello!",
      ],
    ],
    "fcm" => [
      "notification" => [
        "title" => "Hello!",
        "body" => "Hello, world!",
      ],
      "data" => [
         "name" => "adam",
         "type" => "user",
      ],
    ],
  ]
);

echo("Published with Publish ID: " . $publishResponse->publishId . "\n");

Publishing to Authenticated Users

Securely send notifications to individual users of your application using Authenticated Users:

$publishResponse = $pushNotifications->publishToUsers(
  ["user-0001"],
  [
    "apns" => [
      "aps" => [
        "alert" => "Hello!",
      ],
    ],
    "fcm" => [
      "notification" => [
        "title" => "Hello!",
        "body" => "Hello, world!",
      ],
    ],
  ]
);

echo("Published with Publish ID: " . $publishResponse->publishId . "\n");
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].