賞金將在 5 天后到期。此問題的答案有資格獲得 50聲望賞金。 Vidhyanand正在尋找一個規范的答案:
以編程方式交流個人熱點。
我正在尋找一種使用 Swift 或 Objective-C 在 iOS 中以編程方式啟用個人熱點的方法,但沒有看到任何 API 或實作該目標的方法。
我的問題是,甚至有可能做到這一點?
蘋果允許嗎?
同樣根據 Apple Developer Documentation HotSpot Helper,我們可以實作哪些控制?
Hotspot Communication
Hotspot helpers can use these APIs to communicate with the hotspot even when Wi-Fi is not the default route.
func bind(to: NEHotspotHelperCommand)
Binds a URL request to the network interface associated with the hotspot helper command instance.
In-Provider Networking
Network APIs for use by all types of NetworkExtension providers and by hotspot helpers.
uj5u.com熱心網友回復:
這是不可能的。來自 Apple 的論壇:
沒有辦法以編程方式執行此操作。您可以使用 獲取 iOS 設備當前的 Wi-Fi 網路 SSID
CNCopyCurrentNetworkInfo,但無法獲取相應的憑據。
如果 iOS 確實允許這樣做,這將是隱私和安全風險。也沒有私有 API 可以做到這一點。正如 Pushkraj Lanjekar 所說,
您可以
Settings從應用程式中打開設備視圖。
無法以編程方式控制iOS 設備上的個人熱點。但是,此 Apple 論壇鏈接可能會有所幫助;https://developer.apple.com/forums/thread/113933。
uj5u.com熱心網友回復:
Apple 不提供任何 API 來打開/關閉個人熱點。相反,您不能通過代碼更改任何用戶設定。您可以Settings從應用程式中打開設備視圖。
Apple 的隱私政策不允許您這樣做。
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/526323.html
