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

查看:128
本文介绍了有没有一种方法可以在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,现在该API仅由Setting apple应用程序使用.

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天全站免登陆