pub unsafe trait OSSystemExtensionRequestDelegate: NSObjectProtocol {
// Provided methods
unsafe fn request_actionForReplacingExtension_withExtension(
&self,
request: &OSSystemExtensionRequest,
existing: &OSSystemExtensionProperties,
ext: &OSSystemExtensionProperties,
) -> OSSystemExtensionReplacementAction
where Self: Sized + Message { ... }
unsafe fn requestNeedsUserApproval(
&self,
request: &OSSystemExtensionRequest,
)
where Self: Sized + Message { ... }
unsafe fn request_didFinishWithResult(
&self,
request: &OSSystemExtensionRequest,
result: OSSystemExtensionRequestResult,
)
where Self: Sized + Message { ... }
unsafe fn request_didFailWithError(
&self,
request: &OSSystemExtensionRequest,
error: &NSError,
)
where Self: Sized + Message { ... }
unsafe fn request_foundProperties(
&self,
request: &OSSystemExtensionRequest,
properties: &NSArray<OSSystemExtensionProperties>,
)
where Self: Sized + Message { ... }
}
Expand description
Provided Methods§
Sourceunsafe fn request_actionForReplacingExtension_withExtension(
&self,
request: &OSSystemExtensionRequest,
existing: &OSSystemExtensionProperties,
ext: &OSSystemExtensionProperties,
) -> OSSystemExtensionReplacementAction
unsafe fn request_actionForReplacingExtension_withExtension( &self, request: &OSSystemExtensionRequest, existing: &OSSystemExtensionProperties, ext: &OSSystemExtensionProperties, ) -> OSSystemExtensionReplacementAction
Called when the target extension bundle identifier is already activated.
The delegate will receive this callback when an activation request encounters an existing extension with the same team and bundle identifiers but with different version identifiers. The delegate must make a decision on whether or not to replace the existing extension.
Parameter request
: The request that encountered the conflict
Parameter existing
: The NSBundle of the existing extension
Parameter ext
: The NSBundle of the extension matching the bundle identifier of the request
Returns: A replacement action indicating the desired outcome of the conflict
Note: This method is invoked if the CFBundleVersion
or CFBundleShortVersionString
identifiers of the target and existing extension differ.
If the local system has System Extension developer mode enabled, this callback will always fire when an existing extension is found, regardless of version identifiers.
Returning OSSystemExtensionReplacementActionAbortRequest will trigger a callback
to request:didFailWithError:
with the OSSystemExtensionErrorRequestCanceled
error code.
Sourceunsafe fn requestNeedsUserApproval(&self, request: &OSSystemExtensionRequest)
unsafe fn requestNeedsUserApproval(&self, request: &OSSystemExtensionRequest)
Called when the target extension requires user approval to be activated.
Activating an extension may require explicit user approval in order to proceed. For example, this can occur when the user has never previously approved this extension. If approval is necessary, this callback will be triggered and the activation request will remain pending until user approves, or until the application exits.
Sourceunsafe fn request_didFinishWithResult(
&self,
request: &OSSystemExtensionRequest,
result: OSSystemExtensionRequestResult,
)
unsafe fn request_didFinishWithResult( &self, request: &OSSystemExtensionRequest, result: OSSystemExtensionRequestResult, )
Called when the target extension request has completed.
Successful results can come with additional information regarding the manner in which they were completed. See the OSSystemExtensionRequestResult documentation for more information.
Parameter result
: Additional result information from the completed request.
Note: If the request completes with the OSSystemExtensionRequestWillCompleteAfterReboot
result, then the extension will not be active until after the next reboot. Upon
reboot, a given extension will be in the state dictated by the most recently
processed request.
Sourceunsafe fn request_didFailWithError(
&self,
request: &OSSystemExtensionRequest,
error: &NSError,
)
unsafe fn request_didFailWithError( &self, request: &OSSystemExtensionRequest, error: &NSError, )
Called when the target extension request failed.
Sourceunsafe fn request_foundProperties(
&self,
request: &OSSystemExtensionRequest,
properties: &NSArray<OSSystemExtensionProperties>,
)
unsafe fn request_foundProperties( &self, request: &OSSystemExtensionRequest, properties: &NSArray<OSSystemExtensionProperties>, )
Called request for properties has completed.
Parameter properties
: Returns an array of OSSystemExtensionProperties matching the
requested bundle identifier.