使用iOS应用程序连接到WiFi,GUI用户请求不是以编程方式

时间:2023-01-25 22:21:27

Since adding WiFi Network Programmatically in iOS is nearly impossible without jailbreaking the Iphone :(

由于在没有越狱Iphone的情况下在iOS中以编程方式添加WiFi网络几乎是不可能的:(

Is it possible to make an application to provide wifi password hidden in stars ******** and ask the user to click on a button in app and connect to wifi network with the hidden password?,

是否有可能使应用程序提供隐藏在星星********中的wifi密码并要求用户点击应用程序中的按钮并使用隐藏密码连接到wifi网络?

What i mean is: the idea: Application provides the wifi password without user seeing the plain text password, but can click a button to open an Intent(dialog or something with the password provided and press connect manually) to connect to WiFi with the hidden WiFi password ( GUI User Request NOT Programmatically )

我的意思是:想法:应用程序提供wifi密码而无需用户看到纯文本密码,但可以单击按钮打开一个Intent(对话框或提供密码的东西,并手动连接)连接到隐藏的WiFi WiFi密码(GUI用户请求不以编程方式)

Is it possible to do that in SWIFT or Objective-C without jailbreaking the iphone?

是否可以在SWIFT或Objective-C中实现这一点而不必越狱iphone?

2 个解决方案

#1


5  

Hello @Tarık Seyceri You have to use MultipeerConnectivity for GUI wifi connection.

Hello @TarıkSeyceri你必须使用MultipeerConnectivity进行GUI wifi连接。

Step1:- import MultipeerConnectivity

第1步: - 导入MultipeerConnectivity

step2:

   var browser : MCBrowserViewController!

   var assistant : MCAdvertiserAssistant!

   var session : MCSession!

   var peerID: MCPeerID!

step3:

    Add  MCBrowserViewControllerDelegate, MCSessionDelegate

step4:

    self.peerID = MCPeerID(displayName: UIDevice.current.name)

    self.session = MCSession(peer: peerID)

    self.session.delegate = self


    self.browser = MCBrowserViewController(serviceType:serviceType,
                                           session:self.session)

    self.browser.delegate = self;

    self.assistant = MCAdvertiserAssistant(serviceType:serviceType,
                                           discoveryInfo:nil, 
                                                session:self.session)


    self.assistant.start()

step5: Next use session delegate methods.

step5:接下来使用session delegate方法。

I think it's helpfull

我认为这很有帮助

#2


1  

Yes, it is possible.

对的,这是可能的。

You must register your app as a HotSpot Helper to get access to the required API within the NetworkExtension framework.

您必须将您的应用程序注册为HotSpot Helper才能访问NetworkExtension框架中所需的API。

Take a look at NetworkExtension.NEHotspotHelper and the Hotspot Network Subsystem Guide

请查看NetworkExtension.NEHotspotHelper和Hotspot Network Subsystem Guide

For future questions, please provide some code showing what you have tried so far. This makes it easier for others to provide a helpful solution and it's easier for other people looking for a the same solution.

对于将来的问题,请提供一些代码,说明您到目前为止所尝试的内容。这使得其他人更容易提供有用的解决方案,并且对于寻找相同解决方案的其他人来说更容易。

#1


5  

Hello @Tarık Seyceri You have to use MultipeerConnectivity for GUI wifi connection.

Hello @TarıkSeyceri你必须使用MultipeerConnectivity进行GUI wifi连接。

Step1:- import MultipeerConnectivity

第1步: - 导入MultipeerConnectivity

step2:

   var browser : MCBrowserViewController!

   var assistant : MCAdvertiserAssistant!

   var session : MCSession!

   var peerID: MCPeerID!

step3:

    Add  MCBrowserViewControllerDelegate, MCSessionDelegate

step4:

    self.peerID = MCPeerID(displayName: UIDevice.current.name)

    self.session = MCSession(peer: peerID)

    self.session.delegate = self


    self.browser = MCBrowserViewController(serviceType:serviceType,
                                           session:self.session)

    self.browser.delegate = self;

    self.assistant = MCAdvertiserAssistant(serviceType:serviceType,
                                           discoveryInfo:nil, 
                                                session:self.session)


    self.assistant.start()

step5: Next use session delegate methods.

step5:接下来使用session delegate方法。

I think it's helpfull

我认为这很有帮助

#2


1  

Yes, it is possible.

对的,这是可能的。

You must register your app as a HotSpot Helper to get access to the required API within the NetworkExtension framework.

您必须将您的应用程序注册为HotSpot Helper才能访问NetworkExtension框架中所需的API。

Take a look at NetworkExtension.NEHotspotHelper and the Hotspot Network Subsystem Guide

请查看NetworkExtension.NEHotspotHelper和Hotspot Network Subsystem Guide

For future questions, please provide some code showing what you have tried so far. This makes it easier for others to provide a helpful solution and it's easier for other people looking for a the same solution.

对于将来的问题,请提供一些代码,说明您到目前为止所尝试的内容。这使得其他人更容易提供有用的解决方案,并且对于寻找相同解决方案的其他人来说更容易。