Alymosul / laravel-exponent-push-notifications

Exponent push notifications driver for laravel 5
MIT License
144 stars 77 forks source link

Not sending notification #7

Closed waitaamon closed 6 years ago

waitaamon commented 6 years ago

in my controller am running $driver->notify( new SendDriverRequest($requestData));

my notification class looks like this

public function via($notifiable)
{
    return [ExpoChannel::class];
}

public function toExpoPush($notifiable)
{
    return ExpoMessage::create()
        ->badge(1)
        ->enableSound()
        ->body("Your account was approved!");

}
Alymosul commented 6 years ago

Please explain more what's going wrong..

waitaamon commented 6 years ago

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; /**

Alymosul commented 6 years ago

What's the exception thrown? did you subscribe the user with Expo::subscribe()?