ios - 当我的 wifi 连接到我的 iPhone 手机时打开一些链接
<p><p>当 wifi 连接到 iPhone 手机时我们需要。我们需要在浏览器中自动打开 app-story。即我们有 4 个 wifi 的 Himansu、点击、投票、热点。我们需要当 wifi 连接人类连接后重定向到下面的链接</p>
<p> <a href="https://itunes.apple.com/in/app/facebook/id284882215?mt=8" rel="noreferrer noopener nofollow">https://itunes.apple.com/in/app/facebook/id284882215?mt=8</a> </p>
<p>请给我任何想法。首先告诉我这可能与否</p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>使用苹果提供的代码 <a href="http://developer.apple.com/library/ios/samplecode/Reachability/index.html" rel="noreferrer noopener nofollow">here</a> </p>
<pre><code>Reachability *reach = ;
;
NetworkStatus status = ;
if(status == NotReachable)
{
//No internet
}
else if (status == ReachableViaWiFi)
{
//WiFi
[ openURL:];
}
else if (status == ReachableViaWWAN)
{
//3G
[ openURL:];
}
</code></pre>
<p><strong>获取 Wifi 网络名称</strong></p>
<p><strong>第 1 步:</strong></p>
<p>导入框架<code>#import <SystemConfiguration/CaptiveNetwork.h></code></p>
<p><strong>步骤-2</strong></p>
<pre><code>implement the method in
CFArrayRef myArray = CNCopySupportedInterfaces();
CFDictionaryRef myDict = CNCopyCurrentNetworkInfo(CFArrayGetValueAtIndex(myArray, 0));
NSLog(@"Connected at:%@",myDict);
NSDictionary *myDictionary = (__bridge_transfer NSDictionary*)myDict;
NSString *SSID = ;
NSLog(@"bssid is %@", SSID);
// your console output is just like
SSID = "Eqra'aOrange";
</code></pre>
<p><strong>步骤 - 3</strong></p>
<pre><code>now you check your condition
if ()
{
// customize your code
}
else
{
// do your stuff
}
</code></pre></p>
<p style="font-size: 20px;">关于ios - 当我的 wifi 连接到我的 iPhone 手机时打开一些链接,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/31203829/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/31203829/
</a>
</p>
页:
[1]