06-30-2010, 03:18 PM
#1 (permalink )
Registered Member
Join Date: Feb 2010
Posts: 102
Handling remote notifications when opening the app from the background?
Hey guys,
There is no documentation on how to handle a remote notification when the application is running in the background (iOS4).
It seems like there is no way to know that the application entered the foreground from a remote notification.
Does anyone know more on the subject?
07-01-2010, 04:08 AM
#2 (permalink )
Registered Member
Join Date: Nov 2009
Posts: 36
I would like to hear about that, too. My users are complaining that the icon badge never gets removed on their iOS 4 device - is this working as designed or a bug?
They have to close the app manually to get rid of the badge - is there something I can do to remove the badge, when the app goes to background?
07-01-2010, 01:52 PM
#3 (permalink )
Registered Member
Join Date: Feb 2010
Posts: 102
Quote:
Originally Posted by
rapidrabbit
I would like to hear about that, too. My users are complaining that the icon badge never gets removed on their iOS 4 device - is this working as designed or a bug?
They have to close the app manually to get rid of the badge - is there something I can do to remove the badge, when the app goes to background?
Just set the badge to 0 in
Code:
- (void)applicationWillEnterForeground:(UIApplication *)application
07-08-2010, 12:45 PM
#4 (permalink )
Registered Member
Join Date: Feb 2010
Posts: 102
Does anyone have any insight on this? It's ridiculous. You can't tell that the app entered the foreground via push/local notification.
08-01-2010, 07:43 PM
#5 (permalink )
Registered Member
Join Date: Feb 2010
Posts: 102
Does anyone know if there are any developments on this front?
08-23-2010, 08:06 PM
#6 (permalink )
Registered Member
Join Date: Feb 2010
Posts: 102
Has anyone shed any light on this?
08-23-2010, 11:54 PM
#7 (permalink )
Emphasizing Fundamentals
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
I'm unclear about the problem. If you are handling the notification, doesn't that mean you are in the foreground?
09-16-2010, 01:59 PM
#8 (permalink )
Registered Member
Join Date: Feb 2010
Posts: 102
Quote:
Originally Posted by
BrianSlick
I'm unclear about the problem. If you are handling the notification, doesn't that mean you are in the foreground?
If your app is in the background and you receive a push notification and the user taps "View", it brings the application to the foreground.
When that happens, only applicationDidEnterForeground is called, and there is no way to access the payload of the push notification.
Before multitasking, it would call applicationDidFinishLaunchingWithOptions and that would include the remote notification information.
Am I missing something here?
09-16-2010, 02:06 PM
#9 (permalink )
Emphasizing Fundamentals
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
Only other relevant method I see is application: didReceiveRemoteNotification:
09-16-2010, 05:04 PM
#10 (permalink )
Registered Member
Join Date: Feb 2010
Posts: 102
Quote:
Originally Posted by
BrianSlick
Only other relevant method I see is application: didReceiveRemoteNotification:
Yeah, and I verified, that does not get called when the app is in the background.
So, what I'm saying is, remote notifications don't work with multitasking, which is a mega, mega fail.
It's really broken our app :/
Thanks for taking a look, though!
09-16-2010, 06:07 PM
#11 (permalink )
Emphasizing Fundamentals
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
You probably should post in the Apple developer forums.
08-14-2011, 01:20 AM
#12 (permalink )
Registered Member
Join Date: Jun 2009
Posts: 7
Apple Docs
I don't know if something isn't functioning as intended, but this Apple document:
Local and Push Notification Programming Guide
Says this:
Quote:
In iOS, you can determine whether an application is launched as a result of the user tapping the action button or whether the notification was delivered to the already-running application by examining the application state. In the delegate’s implementation of the application:didReceiveRemoteNotification: or application:didReceiveLocalNotification: method, get the value of the applicationState property and evaluate it. If the value is UIApplicationStateInactive, the user tapped the action button; if the value is UIApplicationStateActive, the application was frontmost when it received the notification.
So, [UIApplication applicationState] is the important property. The document discusses payload, too.
I just tested on my 4.3.3 device, and application:didReceiveRemoteNotification most definitely is getting called for me.
02-04-2012, 04:21 AM
#13 (permalink )
Registered Member
Join Date: Mar 2011
Posts: 1
Quote:
Originally Posted by
n8r0n
I don't know if something isn't functioning as intended, but this Apple document:
Local and Push Notification Programming Guide
Says this:
So, [UIApplication applicationState] is the important property. The document discusses payload, too.
I just tested on my 4.3.3 device, and application:didReceiveRemoteNotification most definitely is getting called for me.
I'm sorry for gravedigging this post.
I have the same problem proposed here:
- open app
- put it in background
- receive a remote notification
- tap on icon of the app
- nothing showing
IF i tap directly on the notification i get all working great, but if i tap on the app icon nothing will be shown about my notification.
Is there a solution to this? Thank you.
02-26-2012, 03:53 PM
#14 (permalink )
Registered Member
Join Date: Oct 2010
Posts: 46
Quote:
Originally Posted by
NoCode
I'm sorry for gravedigging this post.
I have the same problem proposed here:
- open app
- put it in background
- receive a remote notification
- tap on icon of the app
- nothing showing
IF i tap directly on the notification i get all working great, but if i tap on the app icon nothing will be shown about my notification.
Is there a solution to this? Thank you.
I really need this too. Bump. How can the app still register the notification even though the notificaton wasnt pressed?
02-26-2012, 04:23 PM
#15 (permalink )
Emphasizing Fundamentals
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
If the app was in the background at the time, and the user did not choose to view it within your app, then at next launch your app should talk to the server to find out about any missing notifications. It's not something the app can do alone.
02-26-2012, 06:09 PM
#16 (permalink )
Registered Member
Join Date: Oct 2010
Posts: 46
..
Ok, got it. It introduces need for more server-side management, but it is probably healty anyways.
Thread Tools
Display Modes
Linear Mode
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
» Advertisements
» Stats
Members: 175,657
Threads: 94,118
Posts: 402,892
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jenniead38