FCM-OnDeviceNotificationScheduler icon indicating copy to clipboard operation
FCM-OnDeviceNotificationScheduler copied to clipboard

Possible Using Postman ?

Open shoppingdev-tech opened this issue 3 years ago • 6 comments

i'm working on alarm Api, here i need to send notification on Perticuler time it is not working ? it is possible Using Api ?

shoppingdev-tech avatar Mar 11 '21 13:03 shoppingdev-tech

Here is my code to send push notification

public function sendPushNotification($fcm_token, $title, $message, $time) {
    $notification = array('title' => $title, 'text' => $message, 'sound' => 'default', 'badge' => '1', 'isScheduled' => 'true',
        "scheduledTime" => $time);
    $msg = array('to' => $fcm_token, 'notification' => $notification, 'priority' => 'high');
    $server_key = env("SERVER_KEY");
    $headers = array(
        "Authorization: key= $server_key",
        "Content-Type: application/json"
    );
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, 'https://fcm.googleapis.com/fcm/send');
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($msg));
    $result = curl_exec($ch);
    curl_close($ch);
    return $result;
}

shoppingdev-tech avatar Mar 11 '21 13:03 shoppingdev-tech

Yes it's possible

PatilShreyas avatar Mar 11 '21 13:03 PatilShreyas

i'm adding alarm using postman but not showing in local on particular time. its show direct when I run api

shoppingdev-tech avatar Mar 11 '21 13:03 shoppingdev-tech

any changes from my code ? @PatilShreyas

shoppingdev-tech avatar Mar 11 '21 13:03 shoppingdev-tech

bhai please answer dede @PatilShreyas

shoppingdev-tech avatar Mar 11 '21 13:03 shoppingdev-tech

Did you tested the current implementation using POSTMan first? If you do so, you can be sure about its implementation from the Android side as well

PatilShreyas avatar Mar 11 '21 13:03 PatilShreyas