Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you programmatically toggle Do Not Disturb mode in iOS 8 (w/ Swift)?

Tags:

ios

swift

ios8

Doing some research on this, it looks like you couldn't toggle Do Not Disturb mode in iOS 6 or 7. Wondering if you can do it in iOS 8. I can't find anything in Apple's docs

Any help would be great. Thanks!

like image 638
Zack Shapiro Avatar asked Jan 16 '15 02:01

Zack Shapiro


2 Answers

This functionality would be outside of the sandbox that Apple puts each application in. Contact between apps and contact outside of the sandbox is very restricted. One example that Apple lets you get away with is turning on the flashlight, but like AirPlane mode, Do Not Disturb (should be) is restricted. Here is some more information on the the sandbox.

like image 119
Brian Tracy Avatar answered Nov 10 '22 04:11

Brian Tracy


Although the correct answer is "no at the moment you cannot", saying it is because of sandboxing is misleadings. Most of the things you do on iOS when you use Apple provided SDKs are basically Apple sanctioned circumventions of the sandbox.

The correct answer is, no you cannot because Apple does not allow it and has not yet published and SDK to allow this.

like image 30
Ali Avatar answered Nov 10 '22 05:11

Ali