Thanks in advance.
I used push notification service in my application.If the app is running in background i am able get the alert view, but the app is in active state it is not displaying alert. Is there any way to display alert. Actually to display alert i am creating an alert in - (void)application:(UIApplicati开发者_开发知识库on *)application didReceiveRemoteNotification:(NSDictionary *)userInfo method. But there is a problam with this alert i.e., of the app is running in background we will get remote alert at the same time we will get this alert also. So is there any way to find if the app is in active state or in background while receiving remote notification using didReceiveRemoteNotification method.A simple solution I can think of is to make use of applicationDidBecomeActive: and applicationDidEnterBackground:. Declare a property in your app delegate and set it properly in those two methods. Then you can do anything you want based on this property, like [[[UIApplication sharedApplication] delegate] isInBackground].
精彩评论