how to lock Iphone by programmatically [duplicate]

2019-03-02 06:57发布

This question already has an answer here:

Is there is any option to lock the Iphone by Software Code. Currently I am working in Flex 4 . I couldn't get any idea about this work. actually my Iphone covered by thick panel , it's very difficult to press the lock button . so I planned to create a shortcut for lock Iphone by coding. Kindly give me some Idea about this task, using Flex 4 or other Languages also is okay. thanks in advance.

3条回答
啃猪蹄的小仙女
2楼-- · 2019-03-02 07:40

If you want to do this so, Apple never approve this, your app must be jailbreak. you can do this by calling Private framework on your project. you can use GraphicsServices.framework. note , this GraphicsServices.framework is a private framework. Apple never accept your app. By calling GSEventLockDevice() method you can lock your Iphone Device easily. This GSEventLockDevice() resides in the GSEvent.h. hope this one helps .

查看更多
不美不萌又怎样
3楼-- · 2019-03-02 07:43

You can not do this using flex or the iOS SDK. You can, however, enable AssistiveTouch by going into Settings -> General -> Accessibility -> AssistiveTouch which will put a little button on your screen that when tapped will allow you to lock your device

查看更多
可以哭但决不认输i
4楼-- · 2019-03-02 07:53

You can't do this on a device that isn't jailbroken- Apple won't let you. Even if you did figure out a way to somehow do this, it would never pass the submission process. If you are developing for jailbroken devices, it's another story, but for the App Store, what you want is impossible.

查看更多
登录 后发表回答