Web Push Php Library Example - Strict Origin When Cross Origin

Viewed 925
2 Answers

use

header('Access-Control-Allow-Origin: *'); or both
header('Content-type: application/json'); (if want to access your json post data )

**in your send_push_notification.php file at the top**
and also use "www." for your url "https://i-confident.com/.." cause i recently face issue in which i didnt add www. in my url and was not receiving post/get data in my targeted file.

First you need install php extension in my case:

sudo apt install php7.4-gmp

Also you need the checkout the branch:

git checkout v2.x

Then you should update your dependencies via composer:

composer update

And then it's should work I checked.

enter image description here

Related