BlazeHostingAppContextManagerProtocol
Protocol defining methods for managing a hosting app's context.
This protocol allows storing, retrieving, updating, and deleting key-value pairs in the hosting application's context. It provides a way to manage shared data within the SDK.
Methods
getValue
Retrieves the value associated with the given key.
Parameters:
- key: The key for which to retrieve the value.
Returns:
- The associated value, or
nilif no value exists for the key.
func getValue(forKey key: String) -> Any?getContext
Retrieves the entire context as a dictionary.
Returns:
- A dictionary representing the current context.
func getContext() -> [String: Any]setValue
Stores a value for the specified key in the context.
Parameters:
- key: The key under which to store the value.
- value: The value to store. Passing
nilremoves the key.
Returns:
- The associated value, or
nilif no value exists for the key.
func setValue(_ value: Any?, forKey key: String)setContext
Replaces the entire context with a new dictionary.
Parameters:
- context: A dictionary containing key-value pairs to set as the new context.
func setContext(_ context: [String: Any])deleteValue
Deletes the value associated with the given key.
Parameters:
- key: The key whose value should be removed.
func deleteValue(forKey key: String)Updated about 2 months ago
Did this page help you?
