Skip to main content

Posts

Showing posts with the label push

Catch push notification"s message if the user tapes "close” in the alert

I'm developing an app, I'm using push notifications, I'm sending pushes from an asp.net application and everything is ok, but there is a problem when I want to catch the notification message in the xcode. I know to catch that information I have to use this method - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo But it works just when the user tapes "view" in the alert or when the app is in foreground. I need to save the message in to my core data DB everytime, but I can't do that if the user tapes "close" in the alert. Are there any way to get a solution for my problem? Thanks.

Iphone Push Notification Wrong Device Token

Finally,I found out the sandbox tokens,which were mixed with the production tokens,and I update the code,receive the error response from apple,when post a sandbox token to apple,the next tokens all failed....While the push msg was "$payload['aps'] = array('content-available' => 1); ",apple will push the msg ,but the device will not show this msg,when I find the wrong one,I delete it,and retest. There is an amusing problem of apple push notification service: when I generate a post notification for my device and send to apple's server,for a while,my device will receive the notification. But if I first post a notification by a wrong devicetoken,then post a right notification to my device,my device will be responseless,just like the push notification was eaten by apple? What wrong with this? I use php code for push service,here is the most important part: $payload['aps'] = array('content-available' => 1); while ($line = mysql_fetc