mkwsra's avatar

mkwsra liked a comment+100 XP

3mos ago

i have some questions..

How do I set up OneSignal in Laravel? What packages or libraries should I use?

is it possible to do via onesignal rest api?

currently i have tried this but failed?

OneSignalService

Route::get('/test', function () {
    $users = User::whereNotNull('onesignal_player_id')->get();

    $playerIds = $users->pluck('onesignal_player_id')->toArray();

    if (!empty($playerIds)) {
        $response = app(OneSignalService::class)->sendPush(
            "Hi there",
            "This is a test notification",
            $playerIds
        );
        dd($response);
    }
});

and i cant figure what type of token/id should i get/save from flutter? to user model?

Any guidance, code examples, or links to relevant documentation would be greatly appreciated!