<?php

namespace App\Console\Commands\Test;

use App\Packages\Friend\Models\FriendRelation;
use App\Packages\User\Models\User;
use App\Packages\User\Notifications\TypesNotification;
use App\Packages\User\Service\PushNotificationService;
use FCM;
use Illuminate\Console\Command;
use Illuminate\Support\Collection;
use LaravelFCM\Message\OptionsBuilder;
use LaravelFCM\Message\PayloadDataBuilder;
use LaravelFCM\Message\PayloadNotificationBuilder;

/**
 * Class PhoneCommand
 * @package App\Console\Commands
 */
class NotificationCommand extends Command
{
    protected $signature = 'notif:test';

    public function handle()
    {

        dd(TypesNotification::$types);

//        $text = TypesNotification::$messages[1];
//        $token = "d5evRcO-Lks:APA91bEnh4koG6miRWqn7tEiBBHpDlqeXUV5pMCMRw09P-R2MvcGtDJJNY-dK3QogfnJGmgBZgSoOLYrPHN_O2wpSSDvUmL6T_V6mTrcfvHIsUrMLyg8K3-ezhb2hj_ouShYwXIQEFzH";
//        $builderData = ['user_id' => 1, 'owner_id' => 2];
//
//        $optionBuilder = new OptionsBuilder();
//        $optionBuilder->setTimeToLive(60*20);
//
//        $notificationBuilder = new PayloadNotificationBuilder('TimeCaps');
//        $notificationBuilder
//            ->setBody($text)
//            ->setSound('default');
//
//        $dataBuilder = new PayloadDataBuilder();
//        $dataBuilder->addData($builderData);
//
//        $option = $optionBuilder->build();
//        $notification = $notificationBuilder->build();
//        $data = $dataBuilder->build();
//
//        $downstreamResponse = FCM::sendTo(
//            $token,
//            $option,
//            $notification,
//            $data
//        );
//
//        dd($downstreamResponse);

    }
}













