Unable to get SSID of Wifi ios 12
I am unable to get wifi SSID (unique key for wifi). I have seen many answers but nothing works for me .
Most common answer I found was to enable ,In Xcode, under
Targets -> Capabilities -> Access WiFi Information -> Enable it to
ON
My Xcode version is 10.1 ,There is no option there for Access WiFi Information .So i turned on Wireless Accessory Configuration
My code is
extension UIDevice {
public var SSID: String?{
get {
guard let interfaces = CNCopySupportedInterfaces() as? [String] else { return nil }
let key = kCNNetworkInfoKeySSID as String
for interface in interfaces {
guard let interfaceInfo = CNCopyCurrentNetworkInfo(interface as CFString) as NSDictionary? else { continue }
return interfaceInfo[key] as? String
}
return nil
}
}
}
My swift version is 4.2 and build target version is 12.1 . I am very new to IOS development .Please let me know ,what I am doing Wrong .How can i make it right .
ios wifi ios12 swift4.2
add a comment |
I am unable to get wifi SSID (unique key for wifi). I have seen many answers but nothing works for me .
Most common answer I found was to enable ,In Xcode, under
Targets -> Capabilities -> Access WiFi Information -> Enable it to
ON
My Xcode version is 10.1 ,There is no option there for Access WiFi Information .So i turned on Wireless Accessory Configuration
My code is
extension UIDevice {
public var SSID: String?{
get {
guard let interfaces = CNCopySupportedInterfaces() as? [String] else { return nil }
let key = kCNNetworkInfoKeySSID as String
for interface in interfaces {
guard let interfaceInfo = CNCopyCurrentNetworkInfo(interface as CFString) as NSDictionary? else { continue }
return interfaceInfo[key] as? String
}
return nil
}
}
}
My swift version is 4.2 and build target version is 12.1 . I am very new to IOS development .Please let me know ,what I am doing Wrong .How can i make it right .
ios wifi ios12 swift4.2
add a comment |
I am unable to get wifi SSID (unique key for wifi). I have seen many answers but nothing works for me .
Most common answer I found was to enable ,In Xcode, under
Targets -> Capabilities -> Access WiFi Information -> Enable it to
ON
My Xcode version is 10.1 ,There is no option there for Access WiFi Information .So i turned on Wireless Accessory Configuration
My code is
extension UIDevice {
public var SSID: String?{
get {
guard let interfaces = CNCopySupportedInterfaces() as? [String] else { return nil }
let key = kCNNetworkInfoKeySSID as String
for interface in interfaces {
guard let interfaceInfo = CNCopyCurrentNetworkInfo(interface as CFString) as NSDictionary? else { continue }
return interfaceInfo[key] as? String
}
return nil
}
}
}
My swift version is 4.2 and build target version is 12.1 . I am very new to IOS development .Please let me know ,what I am doing Wrong .How can i make it right .
ios wifi ios12 swift4.2
I am unable to get wifi SSID (unique key for wifi). I have seen many answers but nothing works for me .
Most common answer I found was to enable ,In Xcode, under
Targets -> Capabilities -> Access WiFi Information -> Enable it to
ON
My Xcode version is 10.1 ,There is no option there for Access WiFi Information .So i turned on Wireless Accessory Configuration
My code is
extension UIDevice {
public var SSID: String?{
get {
guard let interfaces = CNCopySupportedInterfaces() as? [String] else { return nil }
let key = kCNNetworkInfoKeySSID as String
for interface in interfaces {
guard let interfaceInfo = CNCopyCurrentNetworkInfo(interface as CFString) as NSDictionary? else { continue }
return interfaceInfo[key] as? String
}
return nil
}
}
}
My swift version is 4.2 and build target version is 12.1 . I am very new to IOS development .Please let me know ,what I am doing Wrong .How can i make it right .
ios wifi ios12 swift4.2
ios wifi ios12 swift4.2
edited Dec 29 '18 at 7:40
PinkeshGjr
2,02821427
2,02821427
asked Dec 29 '18 at 6:08
Usman SaeedUsman Saeed
114
114
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
My Xcode version is 10.1 ,There is no option there for Access WiFi Information
Then there is something wrong either with your Xcode project, Xcode or your developer profile...
Make sure your project is update-to-date with the latest Xcode configuration (usually, I just build the project and check the warnings)
I dont have app-store account ,I just created new apple ID
As listed under Choosing a Membership/Benefits and resources, "Advanced App Capabilities" is not available to "Sign in with Apple ID" (or free developer accounts), this may explain why "Access WiFi Information" is not available to you
Thanks for replying . I have checked the Xcode version it is same as yours .not getting any warning about this also i have created new project , Access WiFi Information is not there
– Usman Saeed
Dec 29 '18 at 6:30
Do you have a paid developer account?
– MadProgrammer
Dec 29 '18 at 6:31
downloaded this xcode from appstore 2 weeks ago .. I dont have app-store account ,I just created new apple ID
– Usman Saeed
Dec 29 '18 at 6:32
So you don’t have a paid developer account then? This might be a restriction of the free accounts. You could login into developer.apple.com and check the app entitlements listed under identifiers -> App IDs
– MadProgrammer
Dec 29 '18 at 6:41
Thanks man you are right ,To have ssid info you need to have paid developer account
– Usman Saeed
Dec 31 '18 at 12:33
add a comment |
After enable Wireless Accessory Configuration
, Xcode generates the entitlements
which include Wireless Accessory Configuration
in your project.
print your interfaces
, it should include en0
CNCopyCurrentNetworkInfo
api description as follows:
Important
To use this function in iOS 12 and later, enable the Access WiFi Information capability for your app in Xcode. When you enable this capability, Xcode automatically adds the Access WiFi Information entitlement to your entitlements file and App ID.
mine works fine, make sure you have wifi connection on your iphone
, not simulator
.
I did print interface its include en0 , is SSID = en0 ?
– Usman Saeed
Dec 29 '18 at 6:44
debug thefor interface in interfaces
step by step, does CNCopyCurrentNetworkInfo return a dictionary? mine as follows: 3 elements ▿ 0 : 2 elements - key : SSIDDATA - value : <71697969 2d707269 76617465 2d706b69 28354729> ▿ 1 : 2 elements - key : BSSID - value : 74:ea:cb:d7:8c:2 ▿ 2 : 2 elements - key : SSID - value : qiyi-private-pki(5G)
– Ethan
Dec 29 '18 at 6:47
No its does not return as dictionary :
– Usman Saeed
Dec 29 '18 at 6:50
does your iphone have connected a valid wifi?
– Ethan
Dec 29 '18 at 6:51
its connected to my imac sharing wifi
– Usman Saeed
Dec 29 '18 at 6:52
|
show 12 more comments
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53967156%2funable-to-get-ssid-of-wifi-ios-12%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
My Xcode version is 10.1 ,There is no option there for Access WiFi Information
Then there is something wrong either with your Xcode project, Xcode or your developer profile...
Make sure your project is update-to-date with the latest Xcode configuration (usually, I just build the project and check the warnings)
I dont have app-store account ,I just created new apple ID
As listed under Choosing a Membership/Benefits and resources, "Advanced App Capabilities" is not available to "Sign in with Apple ID" (or free developer accounts), this may explain why "Access WiFi Information" is not available to you
Thanks for replying . I have checked the Xcode version it is same as yours .not getting any warning about this also i have created new project , Access WiFi Information is not there
– Usman Saeed
Dec 29 '18 at 6:30
Do you have a paid developer account?
– MadProgrammer
Dec 29 '18 at 6:31
downloaded this xcode from appstore 2 weeks ago .. I dont have app-store account ,I just created new apple ID
– Usman Saeed
Dec 29 '18 at 6:32
So you don’t have a paid developer account then? This might be a restriction of the free accounts. You could login into developer.apple.com and check the app entitlements listed under identifiers -> App IDs
– MadProgrammer
Dec 29 '18 at 6:41
Thanks man you are right ,To have ssid info you need to have paid developer account
– Usman Saeed
Dec 31 '18 at 12:33
add a comment |
My Xcode version is 10.1 ,There is no option there for Access WiFi Information
Then there is something wrong either with your Xcode project, Xcode or your developer profile...
Make sure your project is update-to-date with the latest Xcode configuration (usually, I just build the project and check the warnings)
I dont have app-store account ,I just created new apple ID
As listed under Choosing a Membership/Benefits and resources, "Advanced App Capabilities" is not available to "Sign in with Apple ID" (or free developer accounts), this may explain why "Access WiFi Information" is not available to you
Thanks for replying . I have checked the Xcode version it is same as yours .not getting any warning about this also i have created new project , Access WiFi Information is not there
– Usman Saeed
Dec 29 '18 at 6:30
Do you have a paid developer account?
– MadProgrammer
Dec 29 '18 at 6:31
downloaded this xcode from appstore 2 weeks ago .. I dont have app-store account ,I just created new apple ID
– Usman Saeed
Dec 29 '18 at 6:32
So you don’t have a paid developer account then? This might be a restriction of the free accounts. You could login into developer.apple.com and check the app entitlements listed under identifiers -> App IDs
– MadProgrammer
Dec 29 '18 at 6:41
Thanks man you are right ,To have ssid info you need to have paid developer account
– Usman Saeed
Dec 31 '18 at 12:33
add a comment |
My Xcode version is 10.1 ,There is no option there for Access WiFi Information
Then there is something wrong either with your Xcode project, Xcode or your developer profile...
Make sure your project is update-to-date with the latest Xcode configuration (usually, I just build the project and check the warnings)
I dont have app-store account ,I just created new apple ID
As listed under Choosing a Membership/Benefits and resources, "Advanced App Capabilities" is not available to "Sign in with Apple ID" (or free developer accounts), this may explain why "Access WiFi Information" is not available to you
My Xcode version is 10.1 ,There is no option there for Access WiFi Information
Then there is something wrong either with your Xcode project, Xcode or your developer profile...
Make sure your project is update-to-date with the latest Xcode configuration (usually, I just build the project and check the warnings)
I dont have app-store account ,I just created new apple ID
As listed under Choosing a Membership/Benefits and resources, "Advanced App Capabilities" is not available to "Sign in with Apple ID" (or free developer accounts), this may explain why "Access WiFi Information" is not available to you
edited Dec 31 '18 at 20:29
community wiki
3 revs
MadProgrammer
Thanks for replying . I have checked the Xcode version it is same as yours .not getting any warning about this also i have created new project , Access WiFi Information is not there
– Usman Saeed
Dec 29 '18 at 6:30
Do you have a paid developer account?
– MadProgrammer
Dec 29 '18 at 6:31
downloaded this xcode from appstore 2 weeks ago .. I dont have app-store account ,I just created new apple ID
– Usman Saeed
Dec 29 '18 at 6:32
So you don’t have a paid developer account then? This might be a restriction of the free accounts. You could login into developer.apple.com and check the app entitlements listed under identifiers -> App IDs
– MadProgrammer
Dec 29 '18 at 6:41
Thanks man you are right ,To have ssid info you need to have paid developer account
– Usman Saeed
Dec 31 '18 at 12:33
add a comment |
Thanks for replying . I have checked the Xcode version it is same as yours .not getting any warning about this also i have created new project , Access WiFi Information is not there
– Usman Saeed
Dec 29 '18 at 6:30
Do you have a paid developer account?
– MadProgrammer
Dec 29 '18 at 6:31
downloaded this xcode from appstore 2 weeks ago .. I dont have app-store account ,I just created new apple ID
– Usman Saeed
Dec 29 '18 at 6:32
So you don’t have a paid developer account then? This might be a restriction of the free accounts. You could login into developer.apple.com and check the app entitlements listed under identifiers -> App IDs
– MadProgrammer
Dec 29 '18 at 6:41
Thanks man you are right ,To have ssid info you need to have paid developer account
– Usman Saeed
Dec 31 '18 at 12:33
Thanks for replying . I have checked the Xcode version it is same as yours .not getting any warning about this also i have created new project , Access WiFi Information is not there
– Usman Saeed
Dec 29 '18 at 6:30
Thanks for replying . I have checked the Xcode version it is same as yours .not getting any warning about this also i have created new project , Access WiFi Information is not there
– Usman Saeed
Dec 29 '18 at 6:30
Do you have a paid developer account?
– MadProgrammer
Dec 29 '18 at 6:31
Do you have a paid developer account?
– MadProgrammer
Dec 29 '18 at 6:31
downloaded this xcode from appstore 2 weeks ago .. I dont have app-store account ,I just created new apple ID
– Usman Saeed
Dec 29 '18 at 6:32
downloaded this xcode from appstore 2 weeks ago .. I dont have app-store account ,I just created new apple ID
– Usman Saeed
Dec 29 '18 at 6:32
So you don’t have a paid developer account then? This might be a restriction of the free accounts. You could login into developer.apple.com and check the app entitlements listed under identifiers -> App IDs
– MadProgrammer
Dec 29 '18 at 6:41
So you don’t have a paid developer account then? This might be a restriction of the free accounts. You could login into developer.apple.com and check the app entitlements listed under identifiers -> App IDs
– MadProgrammer
Dec 29 '18 at 6:41
Thanks man you are right ,To have ssid info you need to have paid developer account
– Usman Saeed
Dec 31 '18 at 12:33
Thanks man you are right ,To have ssid info you need to have paid developer account
– Usman Saeed
Dec 31 '18 at 12:33
add a comment |
After enable Wireless Accessory Configuration
, Xcode generates the entitlements
which include Wireless Accessory Configuration
in your project.
print your interfaces
, it should include en0
CNCopyCurrentNetworkInfo
api description as follows:
Important
To use this function in iOS 12 and later, enable the Access WiFi Information capability for your app in Xcode. When you enable this capability, Xcode automatically adds the Access WiFi Information entitlement to your entitlements file and App ID.
mine works fine, make sure you have wifi connection on your iphone
, not simulator
.
I did print interface its include en0 , is SSID = en0 ?
– Usman Saeed
Dec 29 '18 at 6:44
debug thefor interface in interfaces
step by step, does CNCopyCurrentNetworkInfo return a dictionary? mine as follows: 3 elements ▿ 0 : 2 elements - key : SSIDDATA - value : <71697969 2d707269 76617465 2d706b69 28354729> ▿ 1 : 2 elements - key : BSSID - value : 74:ea:cb:d7:8c:2 ▿ 2 : 2 elements - key : SSID - value : qiyi-private-pki(5G)
– Ethan
Dec 29 '18 at 6:47
No its does not return as dictionary :
– Usman Saeed
Dec 29 '18 at 6:50
does your iphone have connected a valid wifi?
– Ethan
Dec 29 '18 at 6:51
its connected to my imac sharing wifi
– Usman Saeed
Dec 29 '18 at 6:52
|
show 12 more comments
After enable Wireless Accessory Configuration
, Xcode generates the entitlements
which include Wireless Accessory Configuration
in your project.
print your interfaces
, it should include en0
CNCopyCurrentNetworkInfo
api description as follows:
Important
To use this function in iOS 12 and later, enable the Access WiFi Information capability for your app in Xcode. When you enable this capability, Xcode automatically adds the Access WiFi Information entitlement to your entitlements file and App ID.
mine works fine, make sure you have wifi connection on your iphone
, not simulator
.
I did print interface its include en0 , is SSID = en0 ?
– Usman Saeed
Dec 29 '18 at 6:44
debug thefor interface in interfaces
step by step, does CNCopyCurrentNetworkInfo return a dictionary? mine as follows: 3 elements ▿ 0 : 2 elements - key : SSIDDATA - value : <71697969 2d707269 76617465 2d706b69 28354729> ▿ 1 : 2 elements - key : BSSID - value : 74:ea:cb:d7:8c:2 ▿ 2 : 2 elements - key : SSID - value : qiyi-private-pki(5G)
– Ethan
Dec 29 '18 at 6:47
No its does not return as dictionary :
– Usman Saeed
Dec 29 '18 at 6:50
does your iphone have connected a valid wifi?
– Ethan
Dec 29 '18 at 6:51
its connected to my imac sharing wifi
– Usman Saeed
Dec 29 '18 at 6:52
|
show 12 more comments
After enable Wireless Accessory Configuration
, Xcode generates the entitlements
which include Wireless Accessory Configuration
in your project.
print your interfaces
, it should include en0
CNCopyCurrentNetworkInfo
api description as follows:
Important
To use this function in iOS 12 and later, enable the Access WiFi Information capability for your app in Xcode. When you enable this capability, Xcode automatically adds the Access WiFi Information entitlement to your entitlements file and App ID.
mine works fine, make sure you have wifi connection on your iphone
, not simulator
.
After enable Wireless Accessory Configuration
, Xcode generates the entitlements
which include Wireless Accessory Configuration
in your project.
print your interfaces
, it should include en0
CNCopyCurrentNetworkInfo
api description as follows:
Important
To use this function in iOS 12 and later, enable the Access WiFi Information capability for your app in Xcode. When you enable this capability, Xcode automatically adds the Access WiFi Information entitlement to your entitlements file and App ID.
mine works fine, make sure you have wifi connection on your iphone
, not simulator
.
edited Dec 29 '18 at 6:42
answered Dec 29 '18 at 6:36
EthanEthan
34339
34339
I did print interface its include en0 , is SSID = en0 ?
– Usman Saeed
Dec 29 '18 at 6:44
debug thefor interface in interfaces
step by step, does CNCopyCurrentNetworkInfo return a dictionary? mine as follows: 3 elements ▿ 0 : 2 elements - key : SSIDDATA - value : <71697969 2d707269 76617465 2d706b69 28354729> ▿ 1 : 2 elements - key : BSSID - value : 74:ea:cb:d7:8c:2 ▿ 2 : 2 elements - key : SSID - value : qiyi-private-pki(5G)
– Ethan
Dec 29 '18 at 6:47
No its does not return as dictionary :
– Usman Saeed
Dec 29 '18 at 6:50
does your iphone have connected a valid wifi?
– Ethan
Dec 29 '18 at 6:51
its connected to my imac sharing wifi
– Usman Saeed
Dec 29 '18 at 6:52
|
show 12 more comments
I did print interface its include en0 , is SSID = en0 ?
– Usman Saeed
Dec 29 '18 at 6:44
debug thefor interface in interfaces
step by step, does CNCopyCurrentNetworkInfo return a dictionary? mine as follows: 3 elements ▿ 0 : 2 elements - key : SSIDDATA - value : <71697969 2d707269 76617465 2d706b69 28354729> ▿ 1 : 2 elements - key : BSSID - value : 74:ea:cb:d7:8c:2 ▿ 2 : 2 elements - key : SSID - value : qiyi-private-pki(5G)
– Ethan
Dec 29 '18 at 6:47
No its does not return as dictionary :
– Usman Saeed
Dec 29 '18 at 6:50
does your iphone have connected a valid wifi?
– Ethan
Dec 29 '18 at 6:51
its connected to my imac sharing wifi
– Usman Saeed
Dec 29 '18 at 6:52
I did print interface its include en0 , is SSID = en0 ?
– Usman Saeed
Dec 29 '18 at 6:44
I did print interface its include en0 , is SSID = en0 ?
– Usman Saeed
Dec 29 '18 at 6:44
debug the
for interface in interfaces
step by step, does CNCopyCurrentNetworkInfo return a dictionary? mine as follows: 3 elements ▿ 0 : 2 elements - key : SSIDDATA - value : <71697969 2d707269 76617465 2d706b69 28354729> ▿ 1 : 2 elements - key : BSSID - value : 74:ea:cb:d7:8c:2 ▿ 2 : 2 elements - key : SSID - value : qiyi-private-pki(5G)– Ethan
Dec 29 '18 at 6:47
debug the
for interface in interfaces
step by step, does CNCopyCurrentNetworkInfo return a dictionary? mine as follows: 3 elements ▿ 0 : 2 elements - key : SSIDDATA - value : <71697969 2d707269 76617465 2d706b69 28354729> ▿ 1 : 2 elements - key : BSSID - value : 74:ea:cb:d7:8c:2 ▿ 2 : 2 elements - key : SSID - value : qiyi-private-pki(5G)– Ethan
Dec 29 '18 at 6:47
No its does not return as dictionary :
– Usman Saeed
Dec 29 '18 at 6:50
No its does not return as dictionary :
– Usman Saeed
Dec 29 '18 at 6:50
does your iphone have connected a valid wifi?
– Ethan
Dec 29 '18 at 6:51
does your iphone have connected a valid wifi?
– Ethan
Dec 29 '18 at 6:51
its connected to my imac sharing wifi
– Usman Saeed
Dec 29 '18 at 6:52
its connected to my imac sharing wifi
– Usman Saeed
Dec 29 '18 at 6:52
|
show 12 more comments
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53967156%2funable-to-get-ssid-of-wifi-ios-12%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown