Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible Using Postman ? #7

Open
shoppingdev-tech opened this issue Mar 11, 2021 · 6 comments
Open

Possible Using Postman ? #7

shoppingdev-tech opened this issue Mar 11, 2021 · 6 comments

Comments

@shoppingdev-tech
Copy link

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
Copy link
Author

shoppingdev-tech commented Mar 11, 2021

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;
}

@PatilShreyas
Copy link
Owner

Yes it's possible

@shoppingdev-tech
Copy link
Author

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

@shoppingdev-tech
Copy link
Author

any changes from my code ? @PatilShreyas

@shoppingdev-tech
Copy link
Author

bhai please answer dede @PatilShreyas

@PatilShreyas
Copy link
Owner

PatilShreyas commented Mar 11, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants