Download the PHP package shawnlindstrom/expo-server-sdk-php without Composer
On this page you can find all versions of the php package shawnlindstrom/expo-server-sdk-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download shawnlindstrom/expo-server-sdk-php
More information about shawnlindstrom/expo-server-sdk-php
Files in shawnlindstrom/expo-server-sdk-php
Package expo-server-sdk-php
Short Description Server-side library for working with Expo using PHP
License MIT
Homepage https://github.com/shawnlindstrom/expo-server-sdk-php
Informations about the package expo-server-sdk-php
expo-server-sdk-php

Server-side library for working with Expo using PHP.
Fork Notice
This is a modernization fork of ctwillie/expo-server-sdk-php, maintained for ongoing support and modern PHP compatibility.
Focus: Ongoing maintenance, PHP 8.4+ compatibility, improved type safety, enhanced testing, and dependency updates while maintaining API compatibility.
Requirements: PHP 8.4 or higher and Guzzle 7.12.1 or higher within the Guzzle 7 major line
License: MIT (see LICENSE.md). Full credit to the original author and contributors.
If you encounter any issues or would like to contribute, please open an issue or submit a pull request!
Table of Contents
- [Testing](#testing) - [Installation](#installation) - [Use Cases](#use-cases) - [Composing a Message](#composing-a-message) - [Sending a Message](#sending-a-push-notification) - [Channel Subscriptions](#channel-subscriptions) - [Expo Responses](#expo-responses) - [Handling Unregistered Devices](#handling-unregistered-devices) - [Retrieving Push Receipts](#retrieving-push-receipts) - [Changelog](#changelog) - [Contributing](#contributing) - [License](#license)Testing
You can run the test suite via composer:
Installation
You can install the package via composer:
Use Cases
This package was written with two main use cases in mind.
- Sending push notification messages to one or more recipients, then you're done! The most obvious use case.
- And channel subscriptions, used to subscribe one or more tokens to a channel, then send push notifications to all tokens subscribed to that channel. Subscriptions are persisted until a token unsubscribes from a channel. Maybe unsubscribing upon the end users request.
Keep this in mind as you decide which is the best use case for your back end.
Composing a message
Compose a push notification message to send using options from the Expo docs.
Sending a push notification
Compose a message, then send it to one or more recipients.
Channel subscriptions
Subscribe tokens to a channel, then push notification messages to that channel. Subscriptions are persisted internally in a local file, so you don't have to worry about this yourself. Unsubscribe the token from the channel at any time to stop messages to that recipient.
:warning: If you are running multiple app servers: Be very careful here! Channel subscriptions are stored in an internal local file. Subscriptions will not be shared across multiple servers.
Expo responses
Get the data returned from successful responses from the Expo server.
Handling unregistered devices
Expo provides a macro for handling tokens that have DeviceNotRegistered error in the Expo response. You can register a callback before sending your messages to handle these unregistered tokens.
You only need to register the handler once as it will be applied to all Expo instances.
Retrieving push receipts
Retrieve the push receipts using the ticket ids from the Expo server.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
License
The MIT License (MIT). Please see License File for more information.
Credits
- Shawn Lindstrom - Maintainer
- Cedric Twillie - Original Author
- All Contributors