Vikas Singh
Vikas Singh

Reputation: 1791

Shake iPhone to open my app. Possible?

Is it possible to shake the iphone when the home screen is displayed and make my app open?

for eg : triggering

(void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event to open my app. Is it possible in ios5 using public sdk?

I am more interested in the technical aspects than the usability so please, if you think that's a horrible idea or you want to ask me what would I do such a thing, then I would say thanks but I understand that!

I dont want to hack into OS, use a jailbroken phone...but more curious to know can an app in itself have the complete logic to achieve the same?

EDIT

I accepted the answer "not possible" but then got another answer/comment from @skippy saying it might be possibel so I am going back to figuring it out mode. Will update accepted answer accordingly!

Upvotes: 2

Views: 2637

Answers (3)

theWalker
theWalker

Reputation: 2020

I think it's possible, but complicated.
The first app run in background (read about required background modes).
This app must call the second app in case of shake.

It's strange behaviour, read about:
Launch an app from within another

Upvotes: 1

Maksim
Maksim

Reputation: 2052

Unfortunately no. You can handle shake-style events only when your application is already running.

Upvotes: 6

anon
anon

Reputation:

This is not possible. Even if it was its not a good idea, think about what would happen if two apps could do this...

Upvotes: 7

Related Questions