Using SBSettings Toggles to Turn Things On or Off

喜夏-厌秋 提交于 2019-12-03 10:14:58

My idea is similar to your original idea, I try to hook up to each toggle.dylib of SBSetting to turn on/off 3G, Wi-Fi, MyFi. However, I could only make it work for 3G toggle. I could not figure out how to make it work for MyFi toggle too. what version of MyFi did you use?

by the way, I also tested other toggle such as location, data, they all worked. As I checked the source code, of location toggle, it just simply changes the property of locationd.plist file while for WiFi toggle case, it requires to utilize the private framework SBWiFimanager, so that maybe the problem. When you use SB framework, you need to have springboard context. Therefore, if you call toggle's method from an app, it does not have springboard context. So think it is the reason while WiFi, and Airplane toggle do not work.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!