Launch an app upon certain external trigger In iOS 6 and with the iPhone 5 is there any way (even if it is a 3rd party app) to do the follwing things?

1) Lanch a certian application when

a) I pass a geo-fence (e.g. arrive home)

b) I get logged in to a WiFi hotspot with a certain SSID

c) the device is plugged to a power source

2) Close a certain application when

a) I pass a geo-fence (e.g. leave home)

b) GPS/Geo/Location is turned off

c) WiFi is turned 

d) I get logged out from a WiFI hotspot with a certain SSID

e) the device is unplugged from a power source
U.S. Patent No. 8,254,902, otherwise known as "Apparatus and methods for enforcement of policies upon a wireless device," was granted in late-August, and would allow phone policies to be set to "chang[e] one or more functional or operational aspects of a wireless device [...] upon the occurrence of a certain event."

Apple was awarded this patent over the summer. They are looking at ways to disable features like the camera when in range of a certain AP, for example a AP near a locker room or bathroom or at concert and so on.....

Hopefully third party apps can find a way to take advantage of this as well.

Apple Location Software

Link above explains it in much more detail.