Closed waitaamon closed 6 years ago
Please explain more what's going wrong..
thanks. am saving the token in users table as column 'expo_token' in my controller am retrieving the user and sending a notification $user->notify( new SendDriverRequest($requestData));
in my notification class am sending the notification using
use App\Models\Corporate\CorporateRequests; use Illuminate\Bus\Queueable; use NotificationChannels\ExpoPushNotifications\ExpoChannel; use NotificationChannels\ExpoPushNotifications\ExpoMessage; use Illuminate\Notifications\Notification; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Notifications\Messages\MailMessage;
class SendDriverRequest extends Notification { use Queueable; /**
@var CorporateRequests */ public $request;
/**
@internal param CorporateRequests $requests */ public function __construct(CorporateRequests $request) { // $this->request = $request; }
/**
@return array */ public function via($notifiable) { return [ExpoChannel::class]; }
/**
@return ExpoMessage */ public function toExpoPush($notifiable) { return ExpoMessage::create() ->badge(1) ->enableSound() ->body("Your account was approved!");
} /**
What's the exception thrown? did you subscribe the user with Expo::subscribe()?
in my controller am running $driver->notify( new SendDriverRequest($requestData));
my notification class looks like this