博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
【ISO】【2011-3-20】【IOS 应用中弹出WiFi 提示框的方法】【转】
阅读量:4481 次
发布时间:2019-06-08

本文共 1182 字,大约阅读时间需要 3 分钟。

如果 iOS 程序中用到了 WiFi,想有 WiFi 提示,只需要在 .plist 文件中加入如下 Key/Value 即可:

  1. 键名:Application uses Wi-Fi 值:YES
  2. 键名:SBUsesNetwork 值:3

示例代码:(在项目 .plist 做如下类似更改)

<?xml version=”1.0″ encoding=”UTF-8″?>

<!DOCTYPE plist PUBLIC “-//Apple//DTD PLIST 1.0//EN” “http://www.apple.com/DTDs/PropertyList-1.0.dtd”>

<plist version=”1.0″>

<dict>

<key>CFBundleDevelopmentRegion</key>

<string>English</string>

<key>CFBundleDisplayName</key>

<string>${PRODUCT_NAME}</string>

<key>CFBundleExecutable</key>

<string>${EXECUTABLE_NAME}</string>

<key>CFBundleIconFile</key>

<string></string>

<key>CFBundleIdentifier</key>

<string>com.yourcompany.${PRODUCT_NAME:rfc1034identifier}</string>

<key>CFBundleInfoDictionaryVersion</key>

<string>6.0</string>

<key>CFBundleName</key>

<string>${PRODUCT_NAME}</string>

<key>CFBundlePackageType</key>

<string>APPL</string>

<key>CFBundleSignature</key>

<string>????</string>

<key>CFBundleVersion</key>

<string>1.0</string>

<key>LSRequiresIPhoneOS</key>

<true/>

<key>NSMainNibFile</key>

<string>MainWindow</string>

<key>UIRequiresPersistentWiFi</key>

<true/>

<key>SBUsesNetwork</key>

<string>3</string>

</dict>

</plist>

转载于:https://www.cnblogs.com/zyqm00/archive/2012/03/20/2407776.html

你可能感兴趣的文章
Ansible用于网络设备管理 part 3 使用NAPALM成品库
查看>>
抽象类和接口的区别以及jdk1.8之后接口里面可以实现方法
查看>>
shell命令之一天一见:awk
查看>>
[转]利用JitPack发布自己项目让别人可以在dependencies中compile的简单方法
查看>>
core dump
查看>>
java-枚举一些字典信息的例子
查看>>
temp-存储过程 以前的
查看>>
IT增值服务-客户案例(三):合肥薪火科技,Java和P2P网络借贷系统开发指导
查看>>
Ubuntu下SVN服务器安装和配置
查看>>
Bloom filter
查看>>
并查集最小生成树复习
查看>>
Java虚拟机性能管理神器 - VisualVM(5) 监控远程主机上的JAVA应用程序【转】
查看>>
WebGIS最佳实践-3 为GeoServer编写漂亮的Style
查看>>
(八) Docker Commit
查看>>
const学习(续)
查看>>
Python批量扫描服务器指定端口状态
查看>>
SQL批量插入、修改
查看>>
ThinkPHP控制器、路由、模板和系统常量
查看>>
Postgresql死锁的处理
查看>>
ubuntu配置多网,网关不起作用的问题
查看>>