有没有办法在iOS中以编程方式打开和关闭wifi? [英] Is there a way to toggle wifi on and off programatically in iOS?

查看:460
本文介绍了有没有办法在iOS中以编程方式打开和关闭wifi?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用此链接上的代码完成蓝牙操作:
有没有办法在iOS中以编程方式打开和关闭蓝牙和/或wifi?

I done it for Bluetooth using the code on this link: Is there a way to toggle bluetooth and/or wifi on and off programmatically in iOS?

但我无法弄清楚如何为Wifi做同样的事情。你如何打开/关闭Wifi?有可能吗?

But I couldn't figure out how to do the same for Wifi. How do you switch the Wifi on/off? Is it possible ?

推荐答案

在iOs 2.x中,您可以使用一些私有API来执行此操作,但它不起作用iOS4.x,5.x。希望Apple公开用于管理Wifi的API,现在它仅用于设置apple app。

In iOs 2.x you can use some private API to do this, however it does not work in iOS4.x, 5.x. Hope that Apple will public the API for manage Wifi, now it is only used by Setting apple app.

这篇关于有没有办法在iOS中以编程方式打开和关闭wifi?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆