当 wifi 连接到 iPhone 手机时我们需要。我们需要在浏览器中自动打开 app-story。即我们有 4 个 wifi 的 Himansu、点击、投票、热点。我们需要当 wifi 连接人类连接后重定向到下面的链接
https://itunes.apple.com/in/app/facebook/id284882215?mt=8
请给我任何想法。首先告诉我这可能与否
Best Answer-推荐答案 strong>
使用苹果提供的代码 here
Reachability *reach = [Reachability reachabilityForInternetConnection];
[reach startNotifier];
NetworkStatus status = [reach currentReachabilityStatus];
if(status == NotReachable)
{
//No internet
}
else if (status == ReachableViaWiFi)
{
//WiFi
[[UIApplication sharedApplication] openURL:[NSURL URLWithString"https://itunes.apple.com/in/app/facebook/id284882215?mt=8"]];
}
else if (status == ReachableViaWWAN)
{
//3G
[[UIApplication sharedApplication] openURL:[NSURL URLWithString"https://itunes.apple.com/in/app/facebook/id284882215?mt=8"]];
}
获取 Wifi 网络名称
第 1 步:
导入框架#import
步骤-2
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 = [myDictionary objectForKey"SSID"];
NSLog(@"bssid is %@", SSID);
// your console output is just like
SSID = "Eqra'aOrange";
步骤 - 3
now you check your condition
if ([SSID isEqualToString"Himansu"])
{
// customize your code
}
else
{
// do your stuff
}
关于ios - 当我的 wifi 连接到我的 iPhone 手机时打开一些链接,我们在Stack Overflow上找到一个类似的问题:
https://stackoverflow.com/questions/31203829/
|