diff --git a/.env.example b/.env.example index bc8a2f3bc..b2e74c9da 100644 --- a/.env.example +++ b/.env.example @@ -71,4 +71,6 @@ GITHUB_CLIENT_ID= GITHUB_CLIENT_SECRET= GITHUB_CALLBACK_URL=https://yourhost.com/customer/social-login/github/callback INTEGRATION_SECRET= -HTTP_MANAGER_ADDRESS= \ No newline at end of file +HTTP_MANAGER_ADDRESS= +PUSH_URL=https://fcm.googleapis.com/fcm/send +PUSH_TOKEN= \ No newline at end of file diff --git a/packages/Sarga/Admin/src/Config/push.php b/packages/Sarga/Admin/src/Config/push.php index 752838847..55aaf29cd 100644 --- a/packages/Sarga/Admin/src/Config/push.php +++ b/packages/Sarga/Admin/src/Config/push.php @@ -2,7 +2,7 @@ return [ 'push' => [ - 'url'=> env('PUSH_URL', ' https://fcm.googleapis.com/fcm/send'), - 'token' => env('PUSH_TOKEN','key=AAAA9LHgcmM:APA91bHkC0wGvNhfoD6UlzUsSilSnhAghY27PNpCwbte4AG0zN2LTnbxVtgcU4q5hwPUfcJuAiL00Ioh2XCEasDW6GYs9IZR4MbbholyASABU6aoQjq95aGpuwci-z_oD2-p1m7COwcO') + 'url'=> env('PUSH_URL', 'https://fcm.googleapis.com/fcm/send'), + 'token' => env('PUSH_TOKEN','key=AAAA7ROeMAE:APA91bE8K-6JcRqsNE_ix5zIywgYyuEF59PFitVjEL1nailAN1i49nYDiyZJXRjUzQxVnJW89z2rRuwaRqI1rgMKTMN0J3LDvjVDPLZcvbJpPGfo2ySCgZ_8zD5WP9tTp-ITm-Sr3wmF') ] ]; diff --git a/packages/Sarga/Admin/src/Http/Firebase.php b/packages/Sarga/Admin/src/Http/Firebase.php index 5d40986ab..b8b2459f5 100644 --- a/packages/Sarga/Admin/src/Http/Firebase.php +++ b/packages/Sarga/Admin/src/Http/Firebase.php @@ -2,7 +2,6 @@ namespace Sarga\Admin\Http; -use Carbon\Carbon; use Illuminate\Support\Facades\Http; use Illuminate\Support\Facades\Log; @@ -10,14 +9,10 @@ class Firebase { public $data; - public $priority; - public $notification; - public $to; - - public function __construct($to,$content,$priority = 'high') + public function __construct(protected $to,$content,protected $priority = 'high') { $this->data = [ 'click_action' => 'FLUTTER_NOTIFICATION_CLICK', @@ -30,10 +25,6 @@ class Firebase 'body' =>$content['content'] ]; - $this->to = $to; - - $this->priority = $priority; - } public function send(){ @@ -52,5 +43,6 @@ class Firebase Log::error($response); $response->throw(); } + Log::info($response->body()); } } \ No newline at end of file