Download the PHP package kobir/larapush-notification without Composer

On this page you can find all versions of the php package kobir/larapush-notification. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package larapush-notification

Laravel Push Notification

Simple Laravel package for sending push notification to mobile devices (android, ios) using fcm http v1.

Requirements

Installation

Use composer to download and install the package and its dependencies.

if you are facing dependency version conflict related issues please run

The package will automatically register its service provider.

To publish the package's configuration file run the following command

Configuration

After publishing the configuration, you can find the 'larapushnotification.php' as well as 'fcmCertificates' empty directory into the config folder.

The default configuration parameters for FCM are :

You can dynamically update those values or adding new ones calling the method setConfig like so:

To generate a credentials fcm-admin-sdk json file for your service account:

Usage

To instantiate the Push Notification class

By default it will use fcm as Push Service provider or you can pass service name if you want as like...

Now you may use any method that you need. Please see the all methods list.

setNotification

setNotification method use to set the notification basic parameters, which you pass the values through parameter as an array.

Syntax

setData

setData method use to set the additional message parameters like id, type sound click_action etc.., which you pass the values through parameter as an array.

Syntax

setProjectId

setProjectId method use to set the Firebase Project ID of your App as a string.

Syntax

setJsonCredential

setJsonCredential method use to set the path of credentials json file of your App.

Syntax

setConfig

setConfig method sets the Push service configuration, which you pass the name through parameter as an array.

Syntax

setUrl

setUrl method sets the Push service url, which you pass the url through parameter as a string.

Syntax

Not update the url unless it's really necessary.

setDevicesToken

setDevicesToken method use to set the devices' tokens, which you pass the token through parameter either array for multiple tokens or string if single token.

Syntax

send

send method is responsible for sending the push notification.

Syntax

getFeedback

getFeedback method return the full notification response after sending a notification.

Syntax

getFailedDeviceTokens

getFailedDeviceTokens method return the all devices' tokens that couldn't receive the notification or failed. Further you can make logic to your backend code for that device tokens.

Syntax

sendByTopic

sendByTopic method use to send notification by topic. It also accepts the topic condition. more details here

If isCondition is true, $topic will be treated as an expression

Syntax

addDeviceTokenToTopic

addDeviceTokenToTopic method use to add device into a topic. To add a new topic you need a unique topic name & all devices would you want to add this topic.

Syntax

removeDeviceTokenFromTopic

removeDeviceTokenFromTopic method use to remove devices from a topic.

Syntax

getTopicInfo

getTopicInfo method use to get all topics name associate with the provided device token.

Syntax

setTopicAddUrl

setTopicAddUrl method sets the topic add url, which you pass the url through parameter as a string.

Syntax

Not update the url unless it's really necessary.

setTopicRemoveUrl

setTopicRemoveUrl method sets the topic remove url, which you pass the url through parameter as a string.

Syntax

Not update the url unless it's really necessary.

setTopicInfoUrl

setTopicInfoUrl method sets the topic info url, which you pass the url through parameter as a string.

Syntax

Not update the url unless it's really necessary.

Usage samples

This is the basic data-set for notification. Here send() method used for sending push notification.

Additional Payload

You can also pass the additional payload data by using setData() method

Get Notification Feedback

If you want get the failed device tokens use getFailedDeviceTokens() method as ...

If you want send the notification to only 1 device, you may pass the value as string.

Send Notification by Topic

or with using a condition:

Add Device Tokens into Topic

Remove Device Tokens from Topic

Get Topic Information

If you want to get how many topic associated with a device token then call this getTopicInfo() method with device_token parameter.

Contribution

Submitting issues and pull requests for bugs or new feature(s) requests are always welcome.


All versions of larapush-notification with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2|^7.3|^7.4|^8.0|^8.1|^8.2
google/apiclient Version ^2.14.0|2.15.0
guzzlehttp/guzzle Version ^6.3|^7.0|^7.2
illuminate/support Version ^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
illuminate/notifications Version ^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package kobir/larapush-notification contains the following files

Loading the files please wait ....