(Scott): It was my new years resolution last year to not use my phone when I was at a meal with other people. The frustrating part was that none of my friends would abide by this rule and I often found myself in a group of 6 people, 5 of which were on their phone.

What it does

We built a system that uses QR codes to get everyone to put you and your friends into a lobby. Once the lobby is started, no one can exit the app until the timer runs out or they lose the bet.

How we built it

  1. Setup Facebook Login
  2. Setup Users and user creation in Firebase
  3. Implemented creating and joining Rooms
  4. Implemented starting a room
  5. Implemented the checks for the app going into the background
  6. Implemented the timer
  7. Implemented the final results screen

Challenges we ran into

Apple doesn't provide an API to tell if the phone's locked vs the app going into background. Disabling app backgrounding on the other hand terminates the app too quickly, and using background tasks to send the firebase update while our app is being backgrounded.

Accomplishments that we're proud of

Getting firebase to synchronize multiple device transitions, working around the fact Apple doesn't provide an API to detect the difference between locking the phone and switching apps, and scanning QR codes

What we learned

Apple API's can be surprisingly lacking, Objective-C/Swift bridging headers are headache inducing, and synchronizing devices across Firebase works really well

What's next for Unplug

Keeping track of who lost a bet (longterm), integrating payments directly into the app itself, better UI design

Share this project: