0

I want to implement push notification like Yo when the app is already running.

I already wrote some codes for it but i found that it is not possible to show notification view when the app is already running.

How can I implement the notification view like local notification on the top not like alertview.

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))handler {

    if (application.applicationState == UIApplicationStateActive) {
         hogehoge...
    }

    if (application.applicationState == UIApplicationStateInactive) {
    }

    if(application.applicationState == UIApplicationStateBackground) {
    } }
user3225917
  • 2,991
  • 2
  • 13
  • 17
  • possible duplicate of [iOS - Push notification alert is not shown when the app is running](http://stackoverflow.com/questions/7965417/ios-push-notification-alert-is-not-shown-when-the-app-is-running) – Ryan Jul 11 '14 at 02:15
  • its not because the solution is using alertview – user3225917 Jul 11 '14 at 02:19

1 Answers1

1

I think this question has been asked many times, but the bottom line is that since your app is already running, you just handle push notifications a different way. You can show a custom notification view, or an alert view, etc. I know you don't want to show an alert view, so you could just create a custom view that appears as you'd like it to.

Here is another question along the same lines as yours:

iOS - Push notification alert is not shown when the app is running

Community
  • 1
  • 1
joelg
  • 1,094
  • 9
  • 19