1

I want to do an app like Bump, where touching two iPhone I can detect them, does anybody know how can I detect the phisical bump of the iPhone?

Thanks a lot!

James Sumners
  • 14,485
  • 10
  • 59
  • 77

2 Answers2

5

Use a combination of accelerometer events, geolocation and time.

  1. Detect a physical bump in your app. Use the accelerometer to detect motion and sudden stopping of that motion.
  2. Upload the bump event to your central server. A bump event includes geolocation and time.
  3. On the central server determine if there is a matching bump event with similar attributes: time and location. If there are conflicts, such as in a crowd at a conference, simply ask the users to bump again.
  4. If there is a matching unique bump event, notify both clients that a bump has occurred and match them up for further processing.

Also, see How does "bump" technology work?

Community
  • 1
  • 1
Peter Cetinski
  • 2,328
  • 14
  • 8
2

While I also started out looking to do this myself, honestly using the Bump API was quick and painless...and it just worked. I would highly recommend that you check it out before trying to "roll your own"...

Darren Ehlers
  • 633
  • 6
  • 16