Skip to main content

Posts

Showing posts with the label notifications

Android how to show notification on screen

I've been working on push notifications and I am able to implement it and display it on status bar, the problem I am facing is that I want to display it even if the phone is lock, Under the lock screen where it says ("drag to unlock"), I have seen notifications like that but cant find any example to that.

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

iPhone: Notification Center Trouble

I wrote an app that allows the user to enter data in a UITextField, and one of them allows them to enter in a specific date. I'm trying to have an alert appear in the iPhones Notification Center when the date is 15 hours away, even when the app is not running at all. EDIT: New code- - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { UILocalNotification *localNotif = [[UILocalNotification alloc] init]; NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateFormat:@"MMdd"]; NSDate *eventDate=[dateFormatter dateFromString:eventDateField.text]; localNotif.fireDate = [eventDate dateByAddingTimeInterval:-15*60*60]; localNotif.timeZone = [NSTimeZone defaultTimeZone]; localNotif.alertBody = @"Event Tomorrow!"; localNotif.alertAction = @"Show me"; localNotif.soundName = UILocalNotificationDefaultSoundName; localNotif.applicationIconBadgeNumber = 0; [[UIApplication