Download the PHP package uzdevid/yii2-fcm without Composer

On this page you can find all versions of the php package uzdevid/yii2-fcm. 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 yii2-fcm

Yii2 Firebase Cloud Messaging

Yii2 frameworki uchun Firebase Cloud Messaging orqali push xabar yuborish va veb saytda qabul qilish uchun kengaytma.

Eslatma: Ushbu kengaytma, Cloud Messaging API (Legacy) dan foydalanadi.

Avvalam bor firebase saytidan ro'yhatdan o'tishingiz va loyiha yaratishingiz lozim. So'ng, yangi loyihangizning sozlamalaridan "Cloud Messaging" bo'limiga kirib, Cloud Messaging API (Legacy) ni faollashtirish kerak bo'ladi.

Faollashtirganingizdan so'ng Server key beriladi. Ushbu Keyni keyinroq config/web.php fayliga yozish kerak bo'ladi.


O'rnatish

yoki

yoki composer.json fayliga ushbu qatorni qo'shing


Sozlash

config/web.php

`

Push habar yuborish

Eslatma: Push habar qabul qiluvchi qurilmaning tokenini mijoz (veb, mobil, ...) ilovalari serverga yuborishi kerak bo'ladi.

Eslatma: Yuqorida foydalanilgan notify() metodida xatolik yuz bersa Exception va BadRequestHttpException istisnolarini larni qaytarishi mumkin.

Shular bilan server tomonidan qilinadigan ishlar tugadi.


Veb saytda push habar qabul qilish

Eslatma: Push habarlarni qabul qilish va uni ustida qandaydir amal bajarish faqat mijoz tarafida amalga oshiriladi. Hozirgi holatda mijoz bu veb sayt.

Eslatma: Push habarlar foydalanuvchiga ko'rsatilishi uchun Operatsion tizim (Windows, Android, ...) brauzerga ruxsat bergan bo'lishi va brauzer ham veb saytga ruxsat bergan bo'lishi hamda veb sayt https holatida ishlashi shart.

Firebase loyihangizning bosh sahifasida veb ilova yaratishingiz lozim. Ilova yaratilganidan so'ng, Sizga mijoz tarafni sozlash uchun kerakli ma'lumotlar beriladi.

1. Sozlash

Yuqorida berilgan ma'lumotlarni config/params.php fayliga yozishingiz kerak.

yoki <head> tegi ichiga quyidagi konstantani yozishingiz kerak.

Eslatma: vapidKey parametrini olish uchun Web Push Certificate yaratishingiz kerak bo'ladi. Web Push Certificates (Project settings/Cloud Messaging/Web configuration) bo'limida yaratib olishingiz mumkin.


2. Fayllarni ulash

layouts/main.php - faylingizga (yoki boshqa umumiy layout fayliga) ushbu qatorni qo'shing. Ushbu qator sahifaga kerakli bo'lgan js fayllarini ulaydi.

3. Qurilma tokenini qabul qilish va serverga yuborish

<head> tegi ichiga quyidagi javascript funksiyani yarating va serverga yuborish uchun kodni yozing. Ushbu funksiya qurilma tokeni qabul qilinganda kengaytma tomonidan ishga tushuriladi

4. Push habarni sahifada qabul qilish

<head> tegi ichiga quyidagi javascript kodni yozing. Ushbu funksiya yangi push habar kelganida kengaytma tomonidan ishga tushuriladi. payload - serverdan yuborilgan ma'lumotlar

onNotify() funksiyasi foydalanuvchi veb sahifada faol bo'lgan vaqti kelgan push habarni ko'rsatish uchun kerak bo'ladi.

5. Brauzer faol bo'lmagan vaqti push habarlarni qabul qilish

web papkasi ichiga firebase-messaging-sw.js faylini yarating va quyidagi kodni yozing.

web/firebase-messaging-sw.js

Ushbu kod faylni brauzeringiz Service worker sifatida faollashtiradi. Tekshirib ko'rishingiz uchun ctrl+shift+i tugmalarini bosing va Application/Service workers bo'limiga o'ting.


6. Tekshirish

Barchasini sozlab bo'lganingizdan so'ng, server yoki curl, postman yoki boshqa yo'llar orqali push habar yuborib tekshirib ko'rishingiz mumkin.



All versions of yii2-fcm with dependencies

PHP Build Version
Package Version
Requires yiisoft/yii2 Version ~2.0.0
ext-curl Version *
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 uzdevid/yii2-fcm contains the following files

Loading the files please wait ....