Park Mobile: How to Deliver the Best Technical Solutions for Big Projects?

In 2015 Factorial Complexity team has released the set of iOS travelling applications for National Park Service aimed to help visitors get the most of their experience. After 2 years of active use, gathered feedback and the worldwide changes in design trends, the customer decided to go with the improved 2nd version of the app - Park Mobile. Thus, we had a new challenge coming on and would like to share the most interesting features of the application and provide you an insight of some of the useful technical solutions that were used during the development process.

In fact, it all started with the creation of Park Browser which allows to switch between different national parks of the USA inside one application. Due to its complex approach, Park Browser using Configuration.plist defines the content and settings for each park that removes the necessity to write the separate code for nearly 20 already included parks and the new ones coming further. A script written by one of our developers helps easily create a separate application for a particular park target that can be uploaded to the store.

So let’s take a look inside Park Mobile application and distinguish the most interesting features and technical tricks.

Park Content

To start with, let’s talk about the way the park’s content is defined. Though all Park Mobile parks are unique, they use the same codepath. Each of them is a lightweight single target project that includes ParkMobile static library with this codepath. Everything that is shown in the app is determined by four letters park code (ex. GOGA for Golden Gate, YELL for Yellowstone) with additional overrides through Configuration.plist for a concrete park. This means that content that’s shown in the app can be changed/created on a server without a need to recompile the application. App is divided by ‘flows’ that allows to inject a new ‘flow’ easily. Using this flexibility we’ve added ‘ParkBrowser’ project that helps to look through the available parks in runtime.

Content shown in Golden Gate Park:

Content shown in Grand Teton Park:

Onboarding

Developers often underestimate the presence of Onboarding screens, but we know that they are responsible, firstly, for the primary impression of the app and, secondly, for getting the user a brief introduction inside the purpose of the app and some of its main features. We have implemented flexible architecture for onboarding flow. All background mountains, their position and content pages can be dynamically adjusted on a server side.

Onboarding example:

Map Clustering

As Park Mobile uses Mapbox service for Map integration, we had to write the clustering algorithm for map annotations by ourselves because at the moment Mapbox doesn’t has a built-in solution. It was implemented from scratch using ‘linked array list’ to reduce the memory fragmentation and to support add/remove operations in constant amount of time. Generally, clusters are calculated in ~0.02 seconds.

Clustering examples:

Tasks Sequencer

Tasks Sequencer is a special architecture to load images sequentially everywhere with additional rules (showing a placeholder if the images didn’t load in a reasonable amount of time, pre-starting image load, updating the placeholder if image is finally loaded).

Home screen example:

IEM

The IEM was cloned from the 1st version of Park Mobile. This feature allows user to navigate through indoor exhibits using device bluetooth which relies on the installed bkons all over the park’s perimeter.

IEM Example:

Augmented Reality

This feature was also re-implemented using the ParkMobile v1. Each sites collection (the list of the sites grouped by a certain characteristic) supports this feature. It uses iPhone camera and shows site pins on the top of these sites, so user can easily tell in which direction he needs to go to reach a particular point of interest.

AR Example:

Geofencing

What is more, we have implemented the architecture for geofencing. Its main goal is to monitor the sites, user presence in the park and notify user about these events. iOS doesn’t allow to monitor more than 20 regions of interests simultaneously per application, so monitored regions change as user moves through a park.

Geofencing Architecture:

PMGeofenceRegionInfo is a protocol that contains information about region and is adopted by PMGeofenceRegion class.

PMGeofenceService receives regions to monitor, encapsulates all communication with CoreLocation framework, updates regions to monitor as user moves and notifies observers about user presence in the park, region enter/exit.

PMGeofenceControllerSettings contains several settings for PMGeofenceController: configurable time interval between geofence callouts and time interval between geofence callouts for the same site.

PMGeofenceController works at a higher level and encapsulates communication with PMGeofenceService. It works in terms of PMGeofenceMonitoringContext which contains a list of sites to monitor and PMGeofenceControllerSettings. User can push/pop these contexts, but only one context can be active at given time. UI component observes PMGeofenceController and shows appropriate alerts to user.

PMGeofenceMonitoringContext is an active entity and can update sites list and PMGeofenceController will make changes accordingly.

Geofencing example (red annotations mean that this region is currently monitored by geofence service):

You can take a look at the apps that were created as a part of Park Browser here:

We have really enjoyed working with Park Mobile team and it felt like we are on the same page with the customer throughout the entire project. The constant feedback during the meetings helped us to create a reliable communication between the two parties, so that any of the ideas and improvement suggestions that came to one’s mind have always found their implementation after a reasoned discussion.

We hope that you found this post interesting and had a chance to download the applications from the AppStore to make your trips to the USA national parks even more pleasurable and fascinating using the numerous technical solutions that can boost your experience as a visitor.

You can also contact us if you have any questions regarding Park Mobile via info@factorialcomplexity.com

Yuri Romanchenko iOS Developer at Factorial Complexity