askToShare()
Signals your app extension to run and process the request to share a network.
Declaration
func askToShare() async throws -> WINetworkSharingAskToShareStateDiscussion
Call this method to prompt your app extension to ask the person to share new networks. Your app extension can request network sharing in several ways:
The system indicates when a new network is available that a person can share with your accessory, if the person approves. Your app extension can check with your accessory to confirm whether it needs another network, and if so, call the API to present the request.
Your accessory communicates with your app extension directly and asks it to present a sharing request. This is useful if your accessory has problems connecting to a network.
Your container app calls this API to signal your app extension to ask the person for a network. This is useful if your app has a button the person can press to add a network to the accessory.
If the person authorizes the system to “Automatically Share” networks to your accessory, the system shares networks to your accessory without any prompting.
– Returns: The WINetworkSharingAskToShareState, indicating a response from the person.