Start the manager with a completion block that will be called when startup completes. This is used internally. To use an SDLPermissionManager, you should use the manager found on
- (void)startWithCompletionHandler: (nonnull void (^)(BOOL, NSError *_Nullable))completionHandler;
func start(completionHandler: @escaping (Bool, Error?) -> Void)
The block to be called when the manager’s setup is complete.
Stop the manager. This method is used internally.
Determine if an individual RPC is allowed for the current HMI level
- (BOOL)isRPCAllowed:(nonnull SDLPermissionRPCName)rpcName;
func isRPCAllowed(_ rpcName: String) -> Bool
The name of the RPC to be tested, for example, SDLShow
YES if the RPC is allowed at the current HMI level, NO if not
Determine if all RPCs are allowed for the current HMI level
- (SDLPermissionGroupStatus)groupStatusOfRPCs: (nonnull NSArray<SDLPermissionRPCName> *)rpcNames;
func groupStatus(ofRPCs rpcNames: [String]) -> SDLPermissionGroupStatus
The RPCs to check
AllAllowed if all of the permissions are allowed, AllDisallowed if all the permissions are disallowed, Any if some are allowed, and some are disallowed
Retrieve a dictionary with keys that are the passed in RPC names, and objects of an NSNumber
- (nonnull NSDictionary<SDLPermissionRPCName, NSNumber<SDLBool> *> *) statusOfRPCs:(nonnull NSArray<SDLPermissionRPCName> *)rpcNames;
func status(ofRPCs rpcNames: [String]) -> [String : NSNumber & SDLBool]
An array of RPC names to check
A dictionary specifying if the passed in RPC names are currently allowed or not
Add an observer for specified RPC names, with a callback that will be called whenever the value changes, as well as immediately with the current status.
This block will be captured by the SDLPermissionsManager, be sure to use weakself/strongself if you are referencing self within your observer block.
The observer may be called before this method returns, do not attempt to remove the observer from within the observer. That could send
nil to removeObserverForIdentifier:. If you want functionality like that, call groupStatusOfRPCs: instead.
- (nonnull SDLPermissionObserverIdentifier) addObserverForRPCs:(nonnull NSArray<SDLPermissionRPCName> *)rpcNames groupType:(SDLPermissionGroupType)groupType withHandler:(nonnull SDLPermissionsChangedHandler)handler;
func addObserver(forRPCs rpcNames: [String], groupType: SDLPermissionGroupType, withHandler handler: @escaping SDLPermissionsChangedHandler) -> UUID
The RPCs to be observed
Affects the times that the observer block will be called. If Any, any change to any RPC in rpcNames will cause the observer block to be called. If AllAllowed, the block will be called when: 1. Every RPC in rpcNames becomes allowed 2. The group of rpcNames goes from all being allowed to some or all being disallowed.
The block that will be called whenever permissions change.
An identifier that can be passed to removeObserverForIdentifer: to remove the observer
Remove every current observer
Remove block observers for the specified RPC
- (void)removeObserverForIdentifier: (nonnull SDLPermissionObserverIdentifier)identifier;
func removeObserver(forIdentifier identifier: UUID)
The identifier specifying which observer to remove