# AvMessagingSdk

Objective-C

    @interface AvMessagingSdk : NSObject

Swift

    class AvMessagingSdk : NSObject

@abstract The core class used for interacting with AvMessagingSdk. Provides methods to initialize, configure, and interact with the library.

- `+initWithSettings:completionHandler:`

  @abstract Initialize the AvMessagingSdk SDK with the provided settings.

  @discussion This may only be called once (preferably, in application:didFinishLaunchingWithOptions:).

  Use +settings to retrieve and modify the given settings object.

  See

  AVASettings

  #### Declaration

  Objective-C

      + (void)initWithSettings:(nonnull AVASettings *)settings
             completionHandler:(nullable void (^)(NSError *_Nullable,
                                                  NSDictionary *_Nullable))handler;

  Swift

      class func initWith(_ settings: AVASettings) async throws -> [AnyHashable : Any]

  #### Parameters

  `settings` | The settings to use.
  `handler` | An optional block to evaluate the result of the operation

- `+settings`

  @abstract Accessor method for the sdk settings.

  @discussion Use this object to update settings at run time.

  Note: Some settings may only be configured at init time. See the AVASettings class reference for more information.

  See

  AVASettings

  #### Declaration

  Objective-C

      + (nullable AVASettings *)settings;

  Swift

      class func settings() -> AVASettings?

  #### Return Value

  Settings object passed in +initWithSettings:completionHandler:, or nil if +initWithSettings:completionHandler: hasn’t been called yet.

- `+show`

  @abstract Presents the AvMessagingSdk conversation screen.

  @discussion Uses the top-most view controller of the `UIApplicationDelegate` as the presenting view controller.

  +initWithSettings:completionHandler: must have been called prior to calling this method.

  #### Declaration

  Objective-C

      + (void)show;

  Swift

      class func show()

- `+showConversationWithId:`

  @abstract Loads the conversation specified by the ID, and presents the AvMessagingSdk conversation screen

  @discussion Uses the top-most view controller of the `UIApplicationDelegate` as the presenting view controller.

  +initWithSettings:completionHandler: must have been called prior to calling this method.

  #### Declaration

  Objective-C

      + (void)showConversationWithId:(nonnull NSString *)conversationId;

  Swift

      class func showConversation(withId conversationId: String)

  #### Parameters

  `conversationId` | The ID of the conversation to load

- `+showWithStartingText:`

  @abstract Presents the AvMessagingSdk conversation screen with prefilled text in the message input.

  @discussion Uses the top-most view controller of the `UIApplicationDelegate` as the presenting view controller with prefilled text in the message input.

  +initWithSettings:completionHandler: must have been called prior to calling this method.

  #### Declaration

  Objective-C

      + (void)showWithStartingText:(nullable NSString *)startingText;

  Swift

      class func show(withStartingText startingText: String?)

- `+showConversationWithId:andStartingText:`

  @abstract Loads the conversation specified by the ID, and presents the AvMessagingSdk conversation screen with prefilled text in the message input.

  @discussion Uses the top-most view controller of the `UIApplicationDelegate` as the presenting view controller with prefilled text in the message input.

  +initWithSettings:completionHandler: must have been called prior to calling this method.

  #### Declaration

  Objective-C

      + (void)showConversationWithId:(nonnull NSString *)conversationId
                     andStartingText:(nullable NSString *)startingText;

  Swift

      class func showConversation(withId conversationId: String, andStartingText startingText: String?)

  #### Parameters

  `conversationId` | The ID of the conversation to load
  `startingText` | The text to prefill in the message input

- `+close`

  @abstract Dismisses the AvMessagingSdk conversation, if shown.

  @discussion Note: If a view controller was created and presented using `newConversationViewController`, calling this method will have no effect.

  +initWithSettings:completionHandler: must have been called prior to calling this method.

  #### Declaration

  Objective-C

      + (void)close;

  Swift

      class func close()

- `+destroy`

  @abstract Destroys the AvMessagingSdk SDK

  @discussion AvMessagingSdk is automatically terminated when the application exits. This method does not need to be called manually

  #### Declaration

  Objective-C

      + (void)destroy;

  Swift

      class func destroy()

- `+showConversationFromViewController:`

  @abstract Presents the AvMessagingSdk conversation screen, using the given view controller as presenting view controller.

  @discussion In most cases, it is better to use +show. If you need more fine-grained control over which view controller is used as presenting view controller, use this method instead.

  +initWithSettings:completionHandler: must have been called prior to calling this method.

  #### Declaration

  Objective-C

      + (void)showConversationFromViewController:(id)viewController;

  Swift

      class func showConversation(fromViewController viewController: Any!)

- `+showConversationWithId:fromViewController:`

  @abstract Loads the conversation specified by the ID, and presents the AvMessagingSdk conversation screen, using the given view controller as presenting view controller.

  @discussion In most cases, it is better to use +show. If you need more fine-grained control over which view controller is used as presenting view controller, use this method instead.

  +initWithSettings:completionHandler: must have been called prior to calling this method.

  #### Declaration

  Objective-C

      + (void)showConversationWithId:(nonnull NSString *)conversationId
                  fromViewController:(id)viewController;

  Swift

      class func showConversation(withId conversationId: String, fromViewController viewController: Any!)

  #### Parameters

  `conversationId` | The ID of the conversation to load
  `viewController` | The view controller to use as the presenting view controller

- `+showConversationFromViewController:withStartingText:`

  @abstract Presents the AvMessagingSdk conversation screen, using the given view controller as presenting view controller with prefilled text in the message input.

  @discussion In most cases, it is better to use +show. If you need more fine-grained control over which view controller is used as presenting view controller, use this method instead.

  +initWithSettings:completionHandler: must have been called prior to calling this method.

  #### Declaration

  Objective-C

      + (void)showConversationFromViewController:(id)viewController
                                withStartingText:(nullable NSString *)startingText;

  Swift

      class func showConversation(fromViewController viewController: Any!, withStartingText startingText: String?)

- `+showConversationWithId:fromViewController:andStartingText:`

  @abstract Loads the conversation specified by the ID, and presents the AvMessagingSdk conversation screen, using the given view controller as presenting view controller with prefilled text in the message input.

  @discussion In most cases, it is better to use +show. If you need more fine-grained control over which view controller is used as presenting view controller, use this method instead.

  +initWithSettings:completionHandler: must have been called prior to calling this method.

  #### Declaration

  Objective-C

      + (void)showConversationWithId:(nonnull NSString *)conversationId
                  fromViewController:(id)viewController
                     andStartingText:(nullable NSString *)startingText;

  Swift

      class func showConversation(withId conversationId: String, fromViewController viewController: Any!, andStartingText startingText: String?)

  #### Parameters

  `conversationId` | The ID of the conversation to load
  `viewController` | The view controller to use as the presenting view controller
  `startingText` | The text to prefill in the message input

- `+newConversationViewController`

  @abstract Creates and returns a AvMessagingSdk conversation view controller.

  @discussion You may use this view controller to embed the conversation in a navigation controller, to change the modal presentation style, or display it in any way you choose.

  A view controller created in this way is tied to the current user’s conversation at creation time. If the current user changes (i.e. by calling +login:jwt:completionHandler: or +logoutWithCompletionHandler:), the view controller is invalidated and must be recreated for the new user.

  Note: It is the responsibility of the caller to show, hide, and maintain a reference to this view controller. Calling `close` will not dismiss a view controller created in this way.

  #### Declaration

  Objective-C

      + (id)newConversationViewController;

  Swift

      class func newConversationViewController() -> Self!

  #### Return Value

  A new instance of the AvMessagingSdk conversation view controller class. Returns nil if +initWithSettings:completionHandler: hasn’t been called

- `+newConversationViewControllerWithId:completionHandler:`

  @abstract Creates and returns a AvMessagingSdk conversation view controller, loading the conversation specified by the ID

  @discussion You may use this view controller to embed the conversation in a navigation controller, to change the modal presentation style, or display it in any way you choose.

  Note: It is the responsibility of the caller to show, hide, and maintain a reference to this view controller. Calling `close` will not dismiss a view controller created in this way.

  #### Declaration

  Objective-C

      + (void)newConversationViewControllerWithId:(nonnull NSString *)conversationId
                                completionHandler:
                                    (nullable void (^)(NSError *_Nullable,
                                                       int *_Nullable))handler;

  Swift

      class func newConversationViewController(withId conversationId: String) async throws -> UnsafeMutablePointer<Int32>

  #### Parameters

  `conversationId` | The ID of the conversation to load
  `handler` | Completion handler which provides a UIViewController with the conversation loaded by the specified ID

- `+newConversationViewControllerWithStartingText:`

  @abstract Creates and returns a AvMessagingSdk conversation view controller with prefilled text in the message input.

  @discussion You may use this view controller to embed the conversation in a navigation controller, to change the modal presentation style, or display it in any way you choose. The message input will be prefilled with the given `startingText`

  A view controller created in this way is tied to the current user’s conversation at creation time. If the current user changes (i.e. by calling +login:jwt:completionHandler: or +logoutWithCompletionHandler:), the view controller is invalidated and must be recreated for the new user.

  Note: It is the responsibility of the caller to show, hide, and maintain a reference to this view controller. Calling `close` will not dismiss a view controller created in this way.

  #### Declaration

  Objective-C

      + (id)newConversationViewControllerWithStartingText:
          (nullable NSString *)startingText;

  Swift

      class func newConversationViewController(withStartingText startingText: String?) -> Self!

  #### Return Value

  A new instance of the AvMessagingSdk conversation view controller class. Returns nil if +initWithSettings:completionHandler: hasn’t been called

- `+newConversationViewControllerWithId:startingText:completionHandler:`

  @abstract Creates and returns a AvMessagingSdk conversation view controller with prefilled text in the message input, loading the conversation specified by the ID

  @discussion You may use this view controller to embed the conversation in a navigation controller, to change the modal presentation style, or display it in any way you choose. The message input will be prefilled with the given `startingText`

  Note: It is the responsibility of the caller to show, hide, and maintain a reference to this view controller. Calling `close` will not dismiss a view controller created in this way.

  #### Declaration

  Objective-C

      + (void)newConversationViewControllerWithId:(nonnull NSString *)conversationId
                                     startingText:(nullable NSString *)startingText
                                completionHandler:
                                    (nullable void (^)(NSError *_Nullable,
                                                       int *_Nullable))handler;

  Swift

      class func newConversationViewController(withId conversationId: String, startingText: String?) async throws -> UnsafeMutablePointer<Int32>

  #### Parameters

  `conversationId` | The ID of the conversation to load
  `startingText` | The text to prefill in the message input
  `handler` | Completion handler which provides a UIViewController with the conversation loaded by the specified ID

- `+showConversationList`

  @abstract Presents the AvMessagingSdk conversation list screen.

  @discussion Uses the top-most view controller of the `UIApplicationDelegate` as the presenting view controller.

  +initWithSettings:completionHandler: must have been called prior to calling this method.

  #### Declaration

  Objective-C

      + (void)showConversationList;

  Swift

      class func showConversationList()

- `+showConversationListWithoutCreateConversationButton`

  @abstract Presents the AvMessagingSdk conversation list screen without a create conversation button

  @discussion Uses the top-most view controller of the `UIApplicationDelegate` as the presenting view controller.

  +initWithSettings:completionHandler: must have been called prior to calling this method.

  #### Declaration

  Objective-C

      + (void)showConversationListWithoutCreateConversationButton;

  Swift

      class func showConversationListWithoutCreateConversationButton()

- `+closeConversationList`

  @abstract Dismisses the AvMessagingSdk conversation list, if shown.

  @discussion Note: If a view controller was created and presented using `newConversationViewController`, calling this method will have no effect.

  +initWithSettings:completionHandler: must have been called prior to calling this method.

  #### Declaration

  Objective-C

      + (void)closeConversationList;

  Swift

      class func closeConversationList()

- `+showConversationListFromViewController:`

  @abstract Presents the AvMessagingSdk conversation list screen, using the given view controller as presenting view controller.

  @discussion In most cases, it is better to use +show. If you need more fine-grained control over which view controller is used as presenting view controller, use this method instead.

  +initWithSettings:completionHandler: must have been called prior to calling this method.

  #### Declaration

  Objective-C

      + (void)showConversationListFromViewController:(id)viewController;

  Swift

      class func showConversationList(fromViewController viewController: Any!)

- `+showConversationListFromViewControllerWithoutCreateConversationButton:`

  @abstract Presents the AvMessagingSdk conversation list screen without a create conversation button, using the given view controller as presenting view controller.

  @discussion In most cases, it is better to use +show. If you need more fine-grained control over which view controller is used as presenting view controller, use this method instead.

  +initWithSettings:completionHandler: must have been called prior to calling this method.

  #### Declaration

  Objective-C

      + (void)showConversationListFromViewControllerWithoutCreateConversationButton:
          (id)viewController;

  Swift

      class func showConversationList(fromViewControllerWithoutCreateConversationButton viewController: Any!)

- `+newConversationListViewController`

  @abstract Creates and returns a AvMessagingSdk conversation list view controller.

  @discussion You may use this view controller to embed the conversation in a navigation controller, to change the modal presentation style, or display it in any way you choose.

  A view controller created in this way is tied to the current user’s conversation at creation time. If the current user changes (i.e. by calling +login:jwt:completionHandler: or +logoutWithCompletionHandler:), the view controller is invalidated and must be recreated for the new user.

  Note: It is the responsibility of the caller to show, hide, and maintain a reference to this view controller. Calling `close` will not dismiss a view controller created in this way.

  #### Declaration

  Objective-C

      + (id)newConversationListViewController;

  Swift

      class func newConversationListViewController() -> Self!

  #### Return Value

  A new instance of the AvMessagingSdk conversation view controller class. Returns nil if +initWithSettings:completionHandler: hasn’t been called

- `+newConversationListViewControllerWithoutCreateConversationButton`

  @abstract Creates and returns a AvMessagingSdk conversation list view controller without a create conversation button.

  @discussion You may use this view controller to embed the conversation in a navigation controller, to change the modal presentation style, or display it in any way you choose.

  A view controller created in this way is tied to the current user’s conversation at creation time. If the current user changes (i.e. by calling +login:jwt:completionHandler: or +logoutWithCompletionHandler:), the view controller is invalidated and must be recreated for the new user.

  Note: It is the responsibility of the caller to show, hide, and maintain a reference to this view controller. Calling `close` will not dismiss a view controller created in this way.

  #### Declaration

  Objective-C

      + (id)newConversationListViewControllerWithoutCreateConversationButton;

  Swift

      class func newConversationListViewControllerWithoutCreateConversationButton() -> Self!

  #### Return Value

  A new instance of the AvMessagingSdk conversation view controller class. Returns nil if +initWithSettings:completionHandler: hasn’t been called

- `+setConversationListDelegate:`

  @abstract Sets the conversation list delegate

  @discussion The conversation list delegate is used to respond to events relating to the conversation list

  See

  AVAConversationListDelegate

  #### Declaration

  Objective-C

      + (void)setConversationListDelegate:
          (nullable id<AVAConversationListDelegate>)delegate;

  Swift

      class func setConversationListDelegate(_ delegate: AVAConversationListDelegate?)

  #### Parameters

  `delegate` | Can we an object conforming to AVAConversationListDelegate, or NULL, which would remove any existing delegate

- `+setUserFirstName:lastName:`

  @abstract Sets the current user’s first and last name to be used as a display name when sending messages.

  @discussion This is a shortcut for -setFirstName and -setLastName on `[AVAUser currentUser]`

  See

  AVAUser

  #### Declaration

  Objective-C

      + (void)setUserFirstName:(nullable NSString *)firstName
                      lastName:(nullable NSString *)lastName;

  Swift

      class func setUserFirstName(_ firstName: String?, lastName: String?)

  #### Parameters

  `firstName` | The first name of the user
  `lastName` | The last name of the user

- `+conversation`

  @abstract Accessor method for the current conversation.

  See

  AVAConversation

  #### Declaration

  Objective-C

      + (nullable AVAConversation *)conversation;

  Swift

      class func conversation() -> AVAConversation?

  #### Return Value

  Current conversation, or nil if +initWithSettings:completionHandler: hasn’t been called yet.

- `+conversationById:completionHandler:`

  @abstract Get a conversationById. This is an asynchronous call and requires a callback to retrieve the result.

  +initWithSettings:completionHandler: must have been called prior to calling this method.

  See

  AVAConversation

  #### Declaration

  Objective-C

      + (void)conversationById:(nonnull NSString *)conversationId
             completionHandler:(nullable void (^)(NSError *_Nullable,
                                                  AVAConversation *_Nullable))handler;

  Swift

      class func conversation(byId conversationId: String) async throws -> AVAConversation

  #### Parameters

  `conversationId` | the conversationId

- `+login:jwt:completionHandler:`

  @abstract Logs in a new AvMessagingSdk user.

  @discussion You can either use this method to transition from logged out state to logged in, or to switch the currently logged in user to a different one.

  User login state is persisted across app launches. You must call +logoutWithCompletionHandler: to reset to anonymous mode.

  +initWithSettings:completionHandler: must have been called prior to calling this method.

  You may not call login while the conversation screen is shown. Doing so will result in a no-op.

  #### Declaration

  Objective-C

      + (void)login:(nonnull NSString *)externalId
                        jwt:(nonnull NSString *)jwt
          completionHandler:
              (nullable void (^)(NSError *_Nullable, NSDictionary *_Nullable))handler;

  Swift

      class func login(_ externalId: String, jwt: String) async throws -> [AnyHashable : Any]

  #### Parameters

  `externalId` | The distinct id of the user to login. Must not be nil.
  `jwt` | jwt used to prove the origin of the login request. Must not be nil.

- `+logoutWithCompletionHandler:`

  @abstract Logs out the current user.

  @discussion Calling this method while already in anonymous state has no effect.

  You may not call logout while the conversation screen is shown. Doing so will result in a no-op.

  #### Declaration

  Objective-C

      + (void)logoutWithCompletionHandler:
          (nullable void (^)(NSError *_Nullable,
                             NSDictionary *_Nullable))completionHandler;

  Swift

      class func logout() async throws -> [AnyHashable : Any]

- `+startConversationWithCompletionHandler:`

  @abstract Force-start a conversation for the current user

  @discussion Creates a user and conversation on the server, allowing the business to reach out proactively to the user via the public API.

  It is strongly recommended to only call this method in the case where a message is likely to be sent.

  This method is called automatically when starting a conversation via the -sendMessage: or -sendImage:withProgress:completion: methods, or when a user sends a message via the conversation view controller.

  @deprecated use + createConversationWithName:description:iconUrl:metadata:completionHandler instead

  #### Declaration

  Objective-C

      + (void)startConversationWithCompletionHandler:
          (nullable void (^)(NSError *_Nullable,
                             NSDictionary *_Nullable))completionHandler;

  Swift

      class func startConversation() async throws -> [AnyHashable : Any]

- `+createConversationWithName:description:iconUrl:avatarUrl:metadata:message:completionHandler:`

  @abstract Create a conversation for the current user, optionally sending a message of type text as part of the conversation creation

  @discussion Creates a user and conversation on the server, allowing the business to reach out proactively to the user via the public API.

  Creating a conversation via this method will count as an active user conversation (AUC) whether messages are exchanged or not, which may incur cost based on your plan. It is strongly recommended to only call this method in the case where a message is likely to be sent.

  This method is called automatically when starting a conversation via the -sendMessage: or -sendImage:withProgress:completion: methods, or when a user sends a message via the conversation view controller.

  Note: Only a single message of type text can be sent as part of conversation creation. Multiple messages, or other types (e.g files, attachments) will cause this method to return an error.

  #### Declaration

  Objective-C

      + (void)createConversationWithName:(nullable NSString *)displayName
                             description:(nullable NSString *)description
                                 iconUrl:(nullable NSString *)iconUrl
                               avatarUrl:(nullable NSString *)avatarUrl
                                metadata:(nullable NSDictionary *)metadata
                                 message:(nullable NSArray<AVAMessage *> *)message
                       completionHandler:(nullable void (^)(NSError *_Nullable,
                                                            NSDictionary *_Nullable))
                                             completionHandler;

  Swift

      class func createConversation(withName displayName: String?, description: String?, iconUrl: String?, avatarUrl: String?, metadata: [AnyHashable : Any]?, message: [AVAMessage]?) async throws -> [AnyHashable : Any]

  #### Parameters

  `displayName` | A user-friendly name to label the conversation in the list (max length 100 characters)
  `description` | A string describing the purpose of the conversation (max length 100 characters)
  `iconUrl` | An iconUrl to display in the conversation list
  `avatarUrl` | An avatarUrl that is associated with the current user
  `metadata` | A flat JSON Object that can only contain the following value types: string, number, boolean and null
  `message` | An array containing a single AVAMessage type, to be sent as part of conversation creation. Only a message of type text can be sent as part of conversation creation. Multiple messages, or other types (e.g files, attachments) will cause this method to return an error.
  `completionHandler` | An optional block to evaluate the result of the operation

- `+updateConversationById:withName:description:iconUrl:metadata:completionHandler:`

  @abstract Updates the specified conversation for the current user.

  +initWithSettings:completionHandler: must have been called prior to calling this method.

  If the displayName, description, iconUrl, and metadata parameters are all nil, this is a no-op.

  See

  AVAConversation

  #### Declaration

  Objective-C

      + (void)updateConversationById:(nonnull NSString *)conversationId
                            withName:(nullable NSString *)displayName
                         description:(nullable NSString *)description
                             iconUrl:(nullable NSString *)iconUrl
                            metadata:(nullable NSDictionary *)metadata
                   completionHandler:
                       (nullable void (^)(NSError *_Nullable,
                                          NSDictionary *_Nullable))completionHandler;

  Swift

      class func updateConversation(byId conversationId: String, withName displayName: String?, description: String?, iconUrl: String?, metadata: [AnyHashable : Any]?) async throws -> [AnyHashable : Any]

  #### Parameters

  `conversationId` | the conversationId
  `displayName` | A user-friendly name to label the conversation (max length 100 characters)
  `description` | A string describing the purpose of the conversation (max length 100 characters)
  `iconUrl` | An iconUrl to display in the conversation list
  `metadata` | A flat JSON Object that can only contain the following value types: string, number, boolean and null
  `completionHandler` | An optional block to evaluate the result of the operation

- `+setConversationInputDisplayed:`

  @abstract Toggles whether the input bar is displayed on the conversation view.

  @discussion For some use cases, it can be useful to remove the ability for the user to craft their own messages. For example, if your conversation flow relies solely on postback buttons or quick replies, you may not want to allow the user to send anything other than the presented options.

  Passing NO to this method will hide the input bar entirely, including the media button and the text area, thus preventing the user from sending messages themselves.

  This method may be called at any time, even when the conversation view is currently displayed.

  State is persisted across view controller launches.

  #### Declaration

  Objective-C

      + (void)setConversationInputDisplayed:(BOOL)displayed;

  Swift

      class func setConversationInputDisplayed(_ displayed: Bool)

- `+setPushToken:`

  @abstract Set the push notification token for this device.

  @discussion This method is called automatically if AVASettings.enableAppDelegateSwizzling is set to YES.

  See

  AVASettings

  #### Declaration

  Objective-C

      + (void)setPushToken:(nonnull NSData *)token;

  Swift

      class func setPushToken(_ token: Data)

- `+handlePushNotification:`

  @abstract Handle an incoming push notification.

  @discussion Call this method in your -application:didReceiveRemoteNotification: or -application:didReceiveRemoteNotification:fetchCompletionHandler: callback, passing the userInfo dictionary.

  If the push notification did not originate from AvMessagingSdk, this is a no-op.

  This method is called automatically if AVASettings.enableAppDelegateSwizzling is set to YES.

  See

  AVASettings

  #### Declaration

  Objective-C

      + (void)handlePushNotification:(nonnull NSDictionary *)userInfo;

  Swift

      class func handlePushNotification(_ userInfo: [AnyHashable : Any])

- `+userNotificationCenterDelegate`

  @abstract An object conforming to UNUserNotificationCenterDelegate protocol, used to handle notifications on iOS 10 and above.

  @discussion Implements both methods of UNUserNotificationCenterDelegate.

  By default this object will automatically be set as the UNUserNotificationCenter delegate at init time. AvMessagingSdk will maintain a reference to your app’s existing delegate (if applicable), and automatically forward any calls for notifications that did not originate from AvMessagingSdk.

  To disable automatic overriding, you must set AVASettings.enableUserNotificationCenterDelegateOverride to NO before calling +initWithSettings:completionHandler:. If you choose to do so, you must manually forward any relevant calls from your own delegate object. To check the origin of a notification, see the documentation for AVAPushNotificationIdentifier. For example:

  -(void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler { if(notification.request.content.userInfo[AVAPushNotificationIdentifier] != nil){ [[AvMessagingSdk userNotificationCenterDelegate] userNotificationCenter:center willPresentNotification:notification withCompletionHandler:completionHandler]; return; } }

  -(void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)())completionHandler { if(response.notification.request.content.userInfo[AVAPushNotificationIdentifier] != nil){ [[AvMessagingSdk userNotificationCenterDelegate] userNotificationCenter:center didReceiveNotificationResponse:response withCompletionHandler:completionHandler]; return; } }

  See

  AVASettings

  #### Declaration

  Objective-C

      + (nullable id<UNUserNotificationCenterDelegate>)userNotificationCenterDelegate;

  #### Return Value

  An object conforming to UNUserNotificationCenterDelegate protocol, or nil if +initWithSettings:completionHandler: hasn’t been called yet.

- `+handleUserNotificationActionWithIdentifier:forRemoteNotification:withResponseInfo:completionHandler:`

  @abstract Handle the user input from a reply type notification action.

  @discussion Call this method in your -application:handleActionWithIdentifier:forRemoteNotification:withResponseInfo:completionHandler:, passing the action identifier, userInfo dictionary, responseInfo dictionary, and completionHandler callback.

  This method will post a message on behalf of the user, with the contents of their inline reply. When the message upload completes (either in success or failure), the completion handler will be called.

  If the action identifier does not match AVAUserNotificationReplyActionIdentifier, the completion handler will be called immediately and the notification will be ignored.

  This method is called automatically if AVASettings.enableAppDelegateSwizzling is set to YES.

  See

  AVASettings

  #### Declaration

  Objective-C

      + (void)
          handleUserNotificationActionWithIdentifier:(nonnull NSString *)identifier
                               forRemoteNotification:(nonnull NSDictionary *)userInfo
                                    withResponseInfo:
                                        (nonnull NSDictionary *)responseInfo
                                   completionHandler:
                                       (nonnull void (^)(void))completionHandler;

  Swift

      class func handleUserNotificationAction(withIdentifier identifier: String, forRemoteNotification userInfo: [AnyHashable : Any], withResponseInfo responseInfo: [AnyHashable : Any]) async

- `+handleUserNotificationActionWithIdentifier:withResponseInfo:completionHandler:`

  @abstract Handle the user input from a reply type notification action.

  @discussion Call this method in your -application:handleActionWithIdentifier:forRemoteNotification:withResponseInfo:completionHandler:, passing the action identifier, responseInfo dictionary, and completionHandler callback.

  This method will post a message on behalf of the user, with the contents of their inline reply. When the message upload completes (either in success or failure), the completion handler will be called.

  If the action identifier does not match AVAUserNotificationReplyActionIdentifier, the completion handler will be called immediately and the notification will be ignored.

  This method is called automatically if AVASettings.enableAppDelegateSwizzling is set to YES.

  See

  AVASettings @deprecated use +handleActionWithIdentifier:forRemoteNotification:withResponseInfo:completionHandler: instead.

  #### Declaration

  Objective-C

      + (void)handleUserNotificationActionWithIdentifier:
                  (nonnull NSString *)identifier
                                        withResponseInfo:
                                            (nonnull NSDictionary *)responseInfo
                                       completionHandler:
                                           (nonnull void (^)(void))completionHandler;

  Swift

      class func handleUserNotificationAction(withIdentifier identifier: String, withResponseInfo responseInfo: [AnyHashable : Any]) async

- `+userNotificationCategories`

  @abstract A set of categories used for handling and displaying AvMessagingSdk user notification actions.

  @discussion On iOS 8, returns an empty set. On iOS 9, returns a set of UIUserNotificationCategory objects, to be used with `UIUserNotificationSettings` +settingsForTypes:categories: On iOS 10, returns a set of UNNotificationCategory objects, to be used with `UNUserNotificationCenter` -setNotificationCategories:

  Categories are registered automatically if AVASettings.requestPushPermissionOnFirstMessage is set to YES. If automatic registration is disabled, you must make sure to include the AvMessagingSdk categories in your calls to the above mentioned methods.

  See

  AVASettings

  #### Declaration

  Objective-C

      + (nonnull NSSet *)userNotificationCategories;

  Swift

      class func userNotificationCategories() -> Set<AnyHashable>

- `+loadConversation:completionHandler:`

  @abstract Loads a conversation by its ID and sets it as the active conversation for the current session.

  @discussion When called, subscribes the current device for push notifications on the passed conversationId, and sets the SDK to send and receive messages for that conversation going forward. Does not unsubscribe for notification on previously loaded conversations.

  If the conversation is already set to the passed ID, this call is a no-op.

  #### Declaration

  Objective-C

      + (void)loadConversation:(nonnull NSString *)conversationId
             completionHandler:
                 (nullable void (^)(NSError *_Nullable,
                                    NSDictionary *_Nullable))completionHandler;

  Swift

      class func loadConversation(_ conversationId: String) async throws -> [AnyHashable : Any]

- `+getConversations:`

  @abstract Returns a list of conversations from storage.

  @discussion Returns a list of AVAConversation objects from storage.

  #### Declaration

  Objective-C

      + (void)getConversations:
          (nonnull void (^)(NSError *_Nullable, NSArray *_Nullable))completionHandler;

  Swift

      class func conversations() async throws -> [Any]

- `+updateConversationDelegate:`

  Deprecated

  Use `setConversationDelegate` instead.

  @abstract Updating the conversation delegate

  @discussion when called, a new delegate is set

  #### Declaration

  Objective-C

      + (void)updateConversationDelegate:
          (nonnull id<AVAConversationDelegate>)delegate;

  Swift

      class func update(_ delegate: AVAConversationDelegate)

- `+setConversationDelegate:`

  @abstract Set a conversation delegate may be used to receive callbacks when important changes happen in the conversation.

  @discussion In a single conversation scenario, this delegate will be used for the single conversation. In a multi-conversation scenario, this delegate can be used to receive callbacks for changes in all conversations.

  #### Declaration

  Objective-C

      + (void)setConversationDelegate:(nonnull id<AVAConversationDelegate>)delegate;

  Swift

      class func setConversationDelegate(delegate: AVAConversationDelegate)

  #### Parameters

  `delegate` | A conversation delegate conforming to `AVAConversationDelegate`.

- `+getMoreConversations:`

  @abstract Loads a list of conversations

  @discussion Retrives the next 10 conversations from the server, and stores them.

  #### Declaration

  Objective-C

      + (void)getMoreConversations:
          (nonnull void (^)(NSError *_Nullable))completionHandler;

  Swift

      class func moreConversations() async throws

- `+hasMoreConversations`

  @abstract A boolean representing if the server has more conversations to load for the user, to support pagination.

  @discussion When called, returns a boolean indicating if the server has more conversations to load for the user.

  #### Declaration

  Objective-C

      + (BOOL)hasMoreConversations;

  Swift

      class func hasMoreConversations() -> Bool

© 2022 . All rights reserved. (Last updated: 2022-06-30)

Generated by jazzy ♪♫ v0.14.2, a Realm project.