PHPackages                             redu/sns-push - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. redu/sns-push

ActiveProject[API Development](/categories/api)

redu/sns-push
=============

API Wrapper for Amazon SNS PHP SDK

61.3k1[2 issues](https://github.com/ReduGroup/sns-push/issues)[1 PRs](https://github.com/ReduGroup/sns-push/pulls)PHP

Since Oct 18Pushed 8y ago2 watchersCompare

[ Source](https://github.com/ReduGroup/sns-push)[ Packagist](https://packagist.org/packages/redu/sns-push)[ RSS](/packages/redu-sns-push/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

SNS Push (for AWS SNS API)
==========================

[](#sns-push-for-aws-sns-api)

> This package provides a bunch of helper methods to aid interacting with the Amazon (AWS) SNS API.

[![Packagist](https://camo.githubusercontent.com/e293c75d4116745d42c100b60badca9b8f2089b14fddbd7304b16a537603037c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f726564752d736e732d2d707573682d627269676874677265656e2e737667)](https://packagist.org/packages/redu/sns-push)

SNS Push is a simple SNS SDK wrapper with a collection of methods to aid in interacting with the AWS SNS API. It works directly with Laravel or can be used as a standalone PHP package.

Prerequisites
=============

[](#prerequisites)

SupportsVersionPHP7.0Platformsios/androidInstalling
==========

[](#installing)

You need to use Composer to install SNS Push into your project:

```
composer require redu/sns-push

```

Configuring (Laravel)
---------------------

[](#configuring-laravel)

Now you have to include `SNSPushServiceProvider` in your `config/app.php`:

```
'providers' => [
    /*
     * Package Service Providers...
     */
    SNSPush\SNSPushServiceProvider::class,
]
```

Add 'sns' config keys to the `config/services.php`

```
'sns' => [
    'account_id' => env('SNS_ACCOUNT_ID', ''),
    'access_key' => env('SNS_ACCESS_KEY', ''),
    'secret_key' => env('SNS_SECRET_KEY', ''),
    'scheme' => env('SNS_SCHEME', 'https'),
    'region' => env('SNS_REGION', 'eu-west-1'),
    'platform_applications' => [
        'ios' => '',
        'android' => ''
    ]
],
```

Other PHP Framework (not Laravel) Setup
---------------------------------------

[](#other-php-framework-not-laravel-setup)

You should include the Composer `autoload.php` file if not already loaded:

```
require __DIR__ . '/vendor/autoload.php';
```

Instantiate the SNSPush class with the following required config values:

- account\_id
- access\_key
- secret\_key
- platform\_applications

Also configurable:

- region \[default: eu-west-1\]
- api\_version \[default: 2010-03-31\]
- scheme \[default: https\]

```
$sns = new SNSPush([
    'account_id' => '', // Required
    'access_key' => '', // Required
    'secret_key' => '', // Required
    'scheme' => 'http', // Defaults to https
    'platform_applications' => [ // Required
        'ios' => '...',
        'android' => '...'
    ]
]);
```

Add Device to Application
-------------------------

[](#add-device-to-application)

Add a device to a platform application (ios/android) by passing the device token and application key to `addDevice()`.

```
$sns->addDevice(', 'ios');
```

Remove Device from Application
------------------------------

[](#remove-device-from-application)

Remove a device from AWS SNS by passing the Endpoint ARN to `removeDevice()`.

```
$sns->removeDevice('');
```

Subscribe Device to Topic
-------------------------

[](#subscribe-device-to-topic)

Subscribe a device to a Topic by passing the Endpoint Arn and Topic Arn to `subscribeDeviceToTopic()`.

```
$sns->subscribeDeviceToTopic('', '');
```

Remove Device from Topic
------------------------

[](#remove-device-from-topic)

Remove a device from a Topic by passing the Subscription Arn to `removeDeviceFromTopic()`.

```
$sns->removeDeviceFromTopic('');
```

Sending Push Notifications
--------------------------

[](#sending-push-notifications)

SNS Push supports sending notifications to both Topic Endpoint or directly to an Endpoint ARN (Device).

### Send to Device

[](#send-to-device)

```
$message = 'Push notification message.';

$sns->sendPushNotificationToDevice(
    '',
    $message
);
```

You can also optionally send a custom payload along with the message.

```
$sns->sendPushNotificationToDevice('', $message, [
    'payload' => [
        'id' => 9
    ]
]);
```

The message structure is sent as JSON and will be properly formatted per device. This is a requirement if sending to multiple platforms and/or sending a custom payload.

If you are only sending a simple message to a single platform and would like to save on bytes you can set the message structure to a string.

```
$sns->sendPushNotificationToDevice('', $message, [
    'message_structure' => 'string'
]);
```

### Send to Topic

[](#send-to-topic)

```
$message = 'Push notification message.';

$sns->send->sendPushNotificationToTopic(
    '',
    $message
);
```

Similarly, you can set the message structure and payload.

To do
-----

[](#to-do)

- Support more endpoints
- Test, test, test... (still in early development, use with caution)

Licence
-------

[](#licence)

[MIT License](https://github.com/ReduGroup/sns-push/blob/master/LICENSE.md) © Redu Group Ltd

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 62.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/34c5baab589f50669499827db6de8a94fa1ed5fc1a13c16fd0704f1360b7e7f1?d=identicon)[redumike](/maintainers/redumike)

---

Top Contributors

[![jrhenderson1988](https://avatars.githubusercontent.com/u/8791010?v=4)](https://github.com/jrhenderson1988 "jrhenderson1988 (5 commits)")[![mforcer](https://avatars.githubusercontent.com/u/850149?v=4)](https://github.com/mforcer "mforcer (3 commits)")

---

Tags

aws-snsendpoint-arnlaravelphpsnssnsapi

### Embed Badge

![Health badge](/badges/redu-sns-push/health.svg)

```
[![Health](https://phpackages.com/badges/redu-sns-push/health.svg)](https://phpackages.com/packages/redu-sns-push)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
