Search code examples
iosapp-store-connectgeojsongeofencing

How to push my app icon on the lock screen when nearby some locations?


My app is a mobile-to-store app. I've got 28K stores out there and I'd like to take advantage of the geofencing technology embedded in iOS.

I'm not sure though how to do it. I just need my app icon to be push on the lock screen whenever the user come nearby one of my point of sales.

I see one can upload a region file (.geojson) in the iTunes Connect main screen. But beside providing this file, do I need to support routing in my code with code as follows?

- (BOOL)application:(UIApplication *)application
           openURL:(NSURL *)url
           sourceApplication:(NSString *)sourceApplication
           annotation:(id)annotation {
   if ([MKDirectionsRequest isDirectionsRequestURL:url]) {
      MKDirectionsRequest* directionsInfo = [[MKDirectionsRequest alloc] initWithContentsOfURL:url];
      // TO DO: Plot and display the route using the
      //   source and destination properties of directionsInfo.
      return YES;
   }
   else {
    // Handle other URL types...
   }
    return NO;
}

Solution

  • Routing coverage is for navigation apps. It is not what you need.

    There are two ways to have your icon appear on the lock screen.

    The first is in response to Apple noting that you are in a location where other people have used your app - you have no control over this.

    The second is in response to region monitoring - if your app has registered region(s) to monitor then the app icon will be displayed when the device is "inside" one of the regions - but there is a system wide limit of about 20 concurrent regions that can be monitored.

    I would suggest that you enable significant location change monitoring in your app. When your app determines that it is near one of your locations it can then register region monitoring for the appropriate region - this should result in your app icon being displayed on the lock screen.

    When you move out of the region your app should unregister the monitoring for that region.