firebase-php: Click action on push notification not working
Describe the bug
I have installed this package on laravel 9 it works really awesome but the problem is when ever i send push notification and user click on it it does not go to the website, although i have added click_action in push notification option. please guide thanks
Installed packages
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"repositories": [
{
"type": "path",
"url": "./nova"
},
{
"type": "path",
"url": "./nova-components/Notifications"
}
],
"require": {
"php": "^8.1",
"ext-ftp": "*",
"appstract/laravel-options": "^5.3",
"blade-ui-kit/blade-heroicons": "^1.3",
"blade-ui-kit/blade-icons": "^1.3",
"bnt/notifications": "*",
"doctrine/dbal": "^3.4",
"guzzlehttp/guzzle": "^7.2",
"james-heinrich/getid3": "^1.9",
"joshcam/mysqli-database-class": "^2.9",
"kreait/firebase-php": "^7.1",
"laravel/cashier": "^14.5",
"laravel/framework": "^9.19",
"laravel/nova": "*",
"laravel/sanctum": "^3.0",
"laravel/scout": "^9.5",
"laravel/tinker": "^2.7",
"laravel/ui": "^v3.4.6",
"laravelista/comments": "dev-master",
"league/flysystem-aws-s3-v3": "^3.2",
"livewire/livewire": "^v2.10.7",
"madcoda/php-youtube-api": "^1.2",
"nicolab/php-ftp-client": "^2.0",
"norkunas/onesignal-php-api": "^2.9",
"pbmedia/laravel-ffmpeg": "^8.1",
"phpgangsta/googleauthenticator": "dev-master",
"pion/laravel-chunk-upload": "^1.5",
"platformcommunity/bunnycdn-storage": "^0.2.0",
"platformcommunity/flysystem-bunnycdn": "^3.0",
"predis/predis": "^2.1",
"spatie/nova-tags-field": "3.4.5"
},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.7",
"fakerphp/faker": "^1.9.1",
"laravel/pint": "^1.0",
"laravel/sail": "^1.0.1",
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^6.1",
"pestphp/pest": "^1.21",
"pestphp/pest-plugin-laravel": "^1.2",
"phpunit/phpunit": "^9.5.10",
"spatie/laravel-ignition": "^1.0"
},
"autoload": {
"files": [
"app/helpers.php"
],
"psr-4": {
"App\\": "app/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi",
"@php artisan vendor:publish --force --tag=livewire:assets --ansi"
],
"post-update-cmd": [
"@php artisan vendor:publish --tag=laravel-assets --ansi --force"
],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
]
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true,
"allow-plugins": {
"pestphp/pest-plugin": true
}
},
"minimum-stability": "dev",
"prefer-stable": true
}
PHP version and extensions
php 8.1
Steps to reproduce the issue.
# Insert the commands issued in the terminal if they are needed
# to reproduce the issue. Otherwise, delete this code block.
// Insert the PHP code to reproduce the issue. Please ensure that it is code that
// can be copy pasted to reproduce it.
Error message/Stack trace
click action on push notification not working
Additional information
thats all
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 1
- Comments: 24 (10 by maintainers)
I am not entirely certain, but it seems that the web push notification is functioning properly. When I click on the notification, it opens up the browser.
I’m happy that the library has helped you save time 🚀.
I can add a section to the Troubleshooting section, but please keep in mind that I’m just the unpaid maintainer of an unofficial library, I can’t anticipate every gotcha that’s missing even in the official documentation 😕.
I hope you can understand that’s why I have a problem with terms like “rectify” and “confirm that you’ve personally tested X” and sometimes react poorly to them - I do testing, but only on the server side.
@beshoo example works as expected. With how complex Firebase gets, this service is no exception, and seems to lead oneself into a maze. Thanks guys for the time invested.
Solved Use click_action as /