notifications ready fx11

This commit is contained in:
merdan 2022-11-23 12:08:08 +05:00
parent f6293d801b
commit f9b22db99e
3 changed files with 7 additions and 13 deletions

View File

@ -71,4 +71,6 @@ GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET= GITHUB_CLIENT_SECRET=
GITHUB_CALLBACK_URL=https://yourhost.com/customer/social-login/github/callback GITHUB_CALLBACK_URL=https://yourhost.com/customer/social-login/github/callback
INTEGRATION_SECRET= INTEGRATION_SECRET=
HTTP_MANAGER_ADDRESS= HTTP_MANAGER_ADDRESS=
PUSH_URL=https://fcm.googleapis.com/fcm/send
PUSH_TOKEN=

View File

@ -2,7 +2,7 @@
return [ return [
'push' => [ 'push' => [
'url'=> env('PUSH_URL', ' https://fcm.googleapis.com/fcm/send'), 'url'=> env('PUSH_URL', 'https://fcm.googleapis.com/fcm/send'),
'token' => env('PUSH_TOKEN','key=AAAA9LHgcmM:APA91bHkC0wGvNhfoD6UlzUsSilSnhAghY27PNpCwbte4AG0zN2LTnbxVtgcU4q5hwPUfcJuAiL00Ioh2XCEasDW6GYs9IZR4MbbholyASABU6aoQjq95aGpuwci-z_oD2-p1m7COwcO') 'token' => env('PUSH_TOKEN','key=AAAA7ROeMAE:APA91bE8K-6JcRqsNE_ix5zIywgYyuEF59PFitVjEL1nailAN1i49nYDiyZJXRjUzQxVnJW89z2rRuwaRqI1rgMKTMN0J3LDvjVDPLZcvbJpPGfo2ySCgZ_8zD5WP9tTp-ITm-Sr3wmF')
] ]
]; ];

View File

@ -2,7 +2,6 @@
namespace Sarga\Admin\Http; namespace Sarga\Admin\Http;
use Carbon\Carbon;
use Illuminate\Support\Facades\Http; use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
@ -10,14 +9,10 @@ class Firebase
{ {
public $data; public $data;
public $priority;
public $notification; public $notification;
public $to;
public function __construct(protected $to,$content,protected $priority = 'high')
public function __construct($to,$content,$priority = 'high')
{ {
$this->data = [ $this->data = [
'click_action' => 'FLUTTER_NOTIFICATION_CLICK', 'click_action' => 'FLUTTER_NOTIFICATION_CLICK',
@ -30,10 +25,6 @@ class Firebase
'body' =>$content['content'] 'body' =>$content['content']
]; ];
$this->to = $to;
$this->priority = $priority;
} }
public function send(){ public function send(){
@ -52,5 +43,6 @@ class Firebase
Log::error($response); Log::error($response);
$response->throw(); $response->throw();
} }
Log::info($response->body());
} }
} }