Skip to content

bright/LocationPlayback

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LocationPlayback

[![CI Status](http://img.shields.io/travis/Daniel Makurat/LocationPlayback.svg?style=flat)](https://travis-ci.org/Daniel Makurat/LocationPlayback) Version License Platform

Why could you possibly need LocationPlayback? What problem does it solve?

Let’s assume that you are in a team that develops mobile app that is displaying some information to the user based on user location, speed, acceleration or time. In such a situations your system probably implements some rules that you would like to test automatically or at least semiautomatically. Let’s say that Bob is a tester (or project manger) with beta app installed on his phone. Let’s assume that the app should shows red box with alert message when user is close to a cinema on Tuesday’s evening between 8-10pm. Some day while testing the app Bob discovered a bug, red box havn't appeared so Bob reported a bug on Wednesday morning. Alice is a developer that was assigned to solve that problem. For Alice it's really hard to reproduce exactly the same situation as to do that she would need to wait 6 days (next Tuesday) assuming she lives in the same city as Bob. LocationPlayback is a lib that can solve such a problem for you.

Solution

Assuming LocationPlayback lib was integrated with the app. Now Bob is able to record every trip he is performing. If Bob finds a bug he can report that bug including trip that he recorded. Developer can see Bob's trip so he recreate the bug by playback recorded trip.

If trip is long you have ability to speed up the playback X times.

What LocationPlayback is responsible for?

  • Trip recording
  • Storing trips locally or on remote server
  • Browsing recorded trips
  • Executing playback of selected trip
  • Trip time (while playback is running)
  • Speed up the playback X times
  • Showing playback preview as a map added to window, map is draggable

What you need to do?

  • add LocationPlayback pod to your project by adding below's line to Podfile:
pod "LocationPlayback"

and execute pod install

  • call [[BILocationPlayback instance] show]; if you want to show LocationPlayback UI
  • call [[BILocationPlayback instance] showMiniMapPlayback]; if you want to show playback preview
  • call [[BILocationPlayback instance] getTripDate]; if you want to read current trip date
  • subscribe to events generated by location playback:

BILocationPlaybackTripUpdate_notification - BITripEntry * object is propageted with userInfo, [[BILocationPlayback instance] getTripEntryFromUserInfo: notification.userInfo], BITripEntry contains location, timestamp, speed, acceleration

BILocationPlaybackTripStarted_notification - BITrip * object is propageted with userInfo, [[BILocationPlayback instance] getTripFromUserInfo: notification.userInfo]

BILocationPlaybackTripEnded_notification - BITrip * object is propageted with userInfo, [[BILocationPlayback instance] getTripFromUserInfo: notification.userInfo]

Running 'Example' project

First make sure you have ruby and bundler gem installed. Then starting from root dir:

cd Example
bundle install
pod install
open LocationPlayback.xcworkspace

Storing trips

BITripRepository is a protocol that describes repository implementation. There are two implementations of repository available, one is local and second is remote. Local repository is called BITripLocalRepository, that repository stores trips into NSUserDefaults. Remote implementation of repository is called BIParseTripRepository and stores trips on parse.com service. To start using that remote repository you only need to create an app on parse.com service and provide mobile app with parse app id and client key. Below an example:

BIRegistryWithCloudRepository * repositoryBuilder = [[BIRegistryWithCloudRepository alloc] initWithApplicationId:@"__applicationId__" 
                                                                                                       clientKey:@"__clientId__"];
[[[BILocationPlayback instance] getConfiguration] setRegistry:repositoryBuilder];

Author

Daniel Makurat, daniel.makurat@gmail.com

License

LocationPlayback is available under the MIT license. See the LICENSE file for more info.

About

Record your trip, store and playback when you need!

Resources

License

Stars

Watchers

Forks

Packages

No packages published