Cancel pending push notification - php

I am sending push notification via APN from my server.
lets say, there is an event at 3 PM so for this at 1 PM i am sending the push notification to all of my users from my server that there is an event at 3 PM. Now, if some devices are offline (not connected to internet) then they will not receive the push notification right away instead they will get the notification when connected to the internet. So if user connects to the internet at 5 PM then there is no use of receiving the push notification at that time.
So my question is, can we cancel/stop this push notifications being sent after particular time?
Thanks in advance!!

You can send an expiration date, so the push notification will be discarded.
https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/CommunicatingWIthAPS.html

Related

Unable to send push notification after 1 minute

I am facing one weird issue in Laravel Job/Scheduler. In my backend, I have created one functionality using which the admin can schedule push notification and send it to all users. So let say I have created one notification that sends a notification to all users at 2:00 AM. So at 2:00 AM one entry added to the Jobs table and start sending a push notification. but it will send push notifications for only 1 minute. After 1 minute it is stopping the push notification send process. I have more than 1k users on the notification list. But it is sending push notifications to only 50 user approx. I have used a scheduler for handling jobs.
Please help me. I have tried all possible ways from my end to identify the issue.

Push notification timing

When I am using https://github.com/olucurious/PyFCM then I am not able to send push notification to other person with time
We need to send push notification to other person with 1 hours. How can I send push notification with time for 1 hours not all time.

How to display each push notification separately on android device using GCM

I am sending push notification to my phonegap app from server. Its getting delivered successfully, but the problem is if I send multiple notifications old one get overrides.
For example
at 10:00 AM -
Notification 1 Received
at 10:01 AM
Notification 2 Received
in this Notification 1 Received get overwrite by second message. But I want to show both messages as they important.
I googled it and found solution on stackoverflow for same.
GCM message is getting overridden?
but its for android, and I am using phonegap and php to send notification,
is there any way to assign that we can retain both messages on user screen.
Thanks in advance.
Your issue is with the payload data you are sending with PHP.
From the documentation at https://developers.google.com/cloud-messaging/http-server-ref#notification-payload-support
tag: Indicates whether each notification message results in a new entry on the notification center on Android. If not set, each request creates a new notification. If set, and a notification with the same tag is already being shown, the new notification replaces the existing one in notification center.
One option is to treat tag as a uniqid, as long as you do not really need to go back and update some unread notifications. If you do need to update a notification, choose an id that works in your case.

Apple push notification with php

Hi i have a PHP script to send push notifications to devices through apple push notification server. I want to know is there any way of setting apple push notification with a certain time that apple sends the push notification to device when the time happens.
Thanks.
No. The notification will be pushed to the device as soon as possible. You can see all the possible parameters you can send here. If you want to schedule it for a certain time, you'll have to do that on your server and push it to Apple at that time.

iphone dev showing date and time in Push notification

I have implemented ray wenderlich's tutorials on Apple push notification, now i want to display the date and time on push notification alert, the time that notification has been sent, i know that there is no child property of alert which can hold date and time, so plz. guide me that is there any way to do it (we are sending notification from server side through a php written cms), i want to display date and time at the top right of the notification alert against the sender name, plz. guide thanx and Regards Saad.
The time when you receive notification may be used to be shown at the right side.
But it is not reliable way, as user can skip any notification. iPhone framework adds icon badge based on value sent in notification.
What you can do is, you can check that value and if it is greater than 0, you can connect to your server by yourself and download the pending notification against that specific user.

Categories