iphone dev showing date and time in Push notification - php

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.

Related

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.

What are the cases where a registration ID of GCM changes?

I am developing a web push notification system using Google Cloud Messaging (only web). I am using a GCM registration id to send the push notification in an Android device.
Can anybody tell me if there are any cases or scenarios that the GCM registration id will be changed for a device?
FYI, I would like to share my current knowledge:
The GCM registration id will be changed if the application is updated or re-installed.
If the device OS is updated.
My system design is as follows:
First, I register the registration id of the device in my database ?
(This is the only one time my client access my site and be able to get the registration ID and where I save it).
Then, I send a notification after a month or later (it depends, maybe even after 3 months).
Here are my questions:
If the device OS was updated in during that duration, does the device id change?
If the Chrome browser is updated or reinstalled, does the device registration id change?
If the registration id does change (because of one of the reasons above), how can I send a push notification to the desired device?
Appreciate the help. Thanks in advance.

Apple Pushnotification Issue

I am new for apple push notification. I am currently working on ios app with chat funcationality. For this app, web-services are built in PHP.
There is a functionality, when user send a chat message to another user that time we send a push notification through PHP that web-service to message receiver user.
Notification working fine that I have checked.
Now issue is, sometimes push notification works fine but sometime its not.
So I want to know when ios push notification fails to send.
I have put write to log and log shows notification sent successfully.
Thanks in advance :)
You can use the Feedback service to get information about failed push notifications via APN:
https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/CommunicatingWIthAPS.html#//apple_ref/doc/uid/TP40008194-CH101-SW3
Looks like the link doesn't anchor to the section - so you will need to search for the entry
:( sry.
Hope that helps

How to send email in accordance with the time we set in PHP

i want to ask something.
Maybe I will explain the scenario first :
When someone buy an item from my online shop and then they checkout, I send them email about what they buy.
After 1 hour they buy, i want to make some notification for them using email and send to them they must confirm the payment and every 3 hour the same email will be send to them and that email will be send just 3 time in one day. Example: they buy some item at 12.00, at 13.00
the system will automatically send notification to them to confirm the payment,at 16.00 and 19.00 system will send the same email notification again.
If in one day they don't confirm the payment, system not send the notification again and cancel the order or if they already confirm the payment before deadline, system not send the notification again.
How can i achieve the solution for a question 2 and 3?
Thank you so much for your response and solution..
If your xampp is on Windows, you can use windows-schedulers to call a particular script (PHP script in your case, preferably by an URL), which checks the birthdays of all the users and sends them mail accordingly.
If your xampp is on Linux/Unix/etc, you can use cron-jobs, and rest is same!
There is also a third way, a third-party scheduler or say online-cron, which will remotely call yours script (php-page).
**Example:**
If you are doing the cron-settings of OS yourself, you can still let the configure as to whom to email in your system, rather than OS.
Now regarding the time settings, you can make the CRON call your script every our, and you php script will check the appropriate time, and fire the mails!
Refrence Send mail to different customer on their birthday

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.

Categories