Remote push notification doesn't wake up app

Discussion in 'iOS Programming' started by nepoty, Jul 14, 2015.

  1. nepoty macrumors newbie

    nepoty

    Joined:
    Jul 14, 2015
    #1
    We use remote push notification with content available key set to 1 which , from
    apple documentation, it has to wake up the app, but it doesn't work properly, sometimes
    the app doesn't wake up.
    We use this mechanism to send device location to our server.
    Why remote push notification doesn't wake up my app all the time ?
     
  2. DennisBlah macrumors 6502

    DennisBlah

    Joined:
    Dec 5, 2013
    Location:
    The Netherlands
    #2
    Have you actually hooked up
    Code:
    - (void)application:(UIApplication *)applicationdidReceiveRemoteNotification:(NSDictionary *)userInfofetchCompletionHandler:(void (^)(UIBackgroundFetchResultresult))handler {
    NSLog(@"awaken in background");
    }
    

    You should receive the nslog in your debugger if your app is in the background

    Sorry you mentioned 'sometimes' this is because pushnotifications are not guarenteed to be delivered, also this background mode is guarenteed to work at least once in 24 hours.
     

Share This Page