Apptentive

@interface Apptentive : NSObject <UNUserNotificationCenterDelegate>

Apptentive is a singleton which is used as the main point of entry for the Apptentive service.

Configuration

Before calling any other methods on the shared Apptentive instance, register you app key and signature:

ApptentiveConfiguration *configuration = [ApptentiveConfiguration configurationWithApptentiveKey:@"your APP key here" apptentiveSignature:@"your APP signature here"];
[Apptentive registerWithConfiguration:configuration];

Engaging Events

The Ratings Prompt and other Apptentive interactions are targeted to certain Apptentive events. For example, you could decide to show the Ratings Prompt after an event named user_completed_level has been engaged. You can later reconfigure the Ratings Prompt interaction to instead show after engaging user_logged_in.

You would add calls at these points to optionally engage with the user:

[[Apptentive sharedConnection] engage:@"completed_level" fromViewController:viewController];

See the readme for more information.

Notifications

ApptentiveMessageCenterUnreadCountChangedNotification

Sent when the number of unread messages changes. The notification object is undefined. The userInfo dictionary contains a count key, the value of which is the number of unread messages.

ApptentiveAppRatingFlowUserAgreedToRateAppNotification

Sent when the user has agreed to rate the application.

ApptentiveSurveySentNotification

Sent when a survey is submitted by the user. The userInfo dictionary will have a key named ApptentiveSurveyIDKey, with a value of the id of the survey that was sent.

  • The shared singleton of Apptentive.

    Declaration

    Objective-C

    + (nonnull instancetype)sharedConnection;

    Swift

    class func sharedConnection() -> Self
  • Alias for sharedConnection

    Declaration

    Objective-C

    @property (readonly, nonatomic, class) Apptentive *_Nonnull shared;

    Swift

    class var shared: Apptentive { get }
  • Initializes Apptentive instance with a given configuration

    Declaration

    Objective-C

    + (void)registerWithConfiguration:
        (nonnull ApptentiveConfiguration *)configuration;

    Swift

    class func register(with configuration: ApptentiveConfiguration)
  • The key copied from the configuration object.

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSString *_Nonnull apptentiveKey;

    Swift

    var apptentiveKey: String { get }
  • The signature copied from the configuration object.

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSString *_Nonnull apptentiveSignature;

    Swift

    var apptentiveSignature: String { get }
  • The app’s iTunes App ID.

    You can find this in iTunes Connect, and is the numeric Apple ID shown on your app details page.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) NSString *appID;

    Swift

    var appID: String? { get set }
  • An object conforming to the ApptentiveDelegate protocol. If a nil value is passed for the view controller into methods such as -engage:fromViewController, the SDK will request a view controller from the delegate from which to present an interaction.

    Deprecation Note: when a suitable view controller is not available for presenting interactions, the system will now use a new window to present Apptentive UI.

    Declaration

    Objective-C

    @property (readwrite, nonatomic) id<ApptentiveDelegate> _Nullable delegate;

    Swift

    weak var delegate: ApptentiveDelegate? { get set }
  • Shows interaction UI, if applicable, related to a given event.

    For example, if you have an upgrade message to display on app launch, you might call with event label set to @"app.launch" here, along with the view controller an upgrade message might be displayed from.

    Declaration

    Objective-C

    - (void)engage:(nonnull NSString *)event
        fromViewController:(UIViewController *_Nullable)viewController;

    Swift

    func engage(event: String, from viewController: UIViewController?)

    Parameters

    event

    A string representing the name of the event.

    viewController

    A view controller Apptentive UI may be presented from. If nil, a view controller should be provided by the delegate.

  • Shows interaction UI, if applicable, related to a given event.

    For example, if you have an upgrade message to display on app launch, you might call with event label set to @"app.launch" here, along with the view controller an upgrade message might be displayed from.

    Declaration

    Objective-C

    - (void)engage:(nonnull NSString *)event
        fromViewController:(UIViewController *_Nullable)viewController
                completion:(void (^_Nullable)(BOOL))completion;

    Swift

    func engage(event: String, from viewController: UIViewController?, completion: ((Bool) -> Void)? = nil)

    Parameters

    event

    A string representing the name of the event.

    viewController

    A view controller Apptentive UI may be presented from. If nil, a view controller should be provided by the delegate.

    completion

    A completion callback

  • Shows interaction UI, if applicable, related to a given event, and attaches the specified custom data to the event.

    Declaration

    Objective-C

    - (void)engage:(nonnull NSString *)event
            withCustomData:(nullable NSDictionary *)customData
        fromViewController:(UIViewController *_Nullable)viewController;

    Swift

    func engage(event: String, withCustomData customData: [AnyHashable : Any]?, from viewController: UIViewController?)

    Parameters

    event

    A string representing the name of the event.

    customData

    A dictionary of key/value pairs to be associated with the event. Keys and values should conform to standards of NSJSONSerialization’s isValidJSONObject:.

    viewController

    A view controller Apptentive UI may be presented from. If nil, a view controller should be provided by the delegate.

  • Shows interaction UI, if applicable, related to a given event, and attaches the specified custom data to the event.

    Declaration

    Objective-C

    - (void)engage:(nonnull NSString *)event
            withCustomData:(nullable NSDictionary *)customData
        fromViewController:(UIViewController *_Nullable)viewController
                completion:(void (^_Nullable)(BOOL))completion;

    Swift

    func engage(event: String, withCustomData customData: [AnyHashable : Any]?, from viewController: UIViewController?, completion: ((Bool) -> Void)? = nil)

    Parameters

    event

    A string representing the name of the event.

    customData

    A dictionary of key/value pairs to be associated with the event. Keys and values should conform to standards of NSJSONSerialization’s isValidJSONObject:.

    viewController

    A view controller Apptentive UI may be presented from. If nil, a view controller should be provided by the delegate.

    completion

    A completion callback

  • Shows interaction UI, if applicable, related to a given event. Attaches the specified custom data to the event along with the specified extended data.

    Declaration

    Objective-C

    - (void)engage:(nonnull NSString *)event
            withCustomData:(nullable NSDictionary *)customData
          withExtendedData:(nullable NSArray<NSDictionary *> *)extendedData
        fromViewController:(UIViewController *_Nullable)viewController;

    Swift

    func engage(event: String, withCustomData customData: [AnyHashable : Any]?, withExtendedData extendedData: [[AnyHashable : Any]]?, from viewController: UIViewController?)

    Parameters

    event

    A string representing the name of the event.

    customData

    A dictionary of key/value pairs to be associated with the event. Keys and values should conform to standards of NSJSONSerialization’s isValidJSONObject:.

    extendedData

    An array of dictionaries with specific Apptentive formatting. For example, [Apptentive extendedDataDate:[NSDate date]].

    viewController

    A view controller Apptentive UI may be presented from. If nil, a view controller should be provided by the delegate.

  • Shows interaction UI, if applicable, related to a given event. Attaches the specified custom data to the event along with the specified extended data.

    Declaration

    Objective-C

    - (void)engage:(nonnull NSString *)event
            withCustomData:(nullable NSDictionary *)customData
          withExtendedData:(nullable NSArray<NSDictionary *> *)extendedData
        fromViewController:(UIViewController *_Nullable)viewController
                completion:(void (^_Nullable)(BOOL))completion;

    Swift

    func engage(event: String, withCustomData customData: [AnyHashable : Any]?, withExtendedData extendedData: [[AnyHashable : Any]]?, from viewController: UIViewController?, completion: ((Bool) -> Void)? = nil)

    Parameters

    event

    A string representing the name of the event.

    customData

    A dictionary of key/value pairs to be associated with the event. Keys and values should conform to standards of NSJSONSerialization’s isValidJSONObject:.

    extendedData

    An array of dictionaries with specific Apptentive formatting. For example, [Apptentive extendedDataDate:[NSDate date]].

    viewController

    A view controller Apptentive UI may be presented from. If nil, a view controller should be provided by the delegate.

  • Asynchronously checks whether the given event will cause an Interaction to be shown.

    For example, callback would be invoked with YES parameter if a survey is ready to be shown the next time you engage your survey-targeted event. You can use this method to hide a Show Survey button in your app if there is no survey to take.

    Declaration

    Objective-C

    - (void)queryCanShowInteractionForEvent:(nonnull NSString *)event
                                 completion:(nonnull void (^)(BOOL))completion;

    Swift

    func queryCanShowInteraction(forEvent event: String, completion: @escaping (Bool) -> Void)

    Parameters

    event

    A string representing the name of the event.

    completion

    Completion callback

  • Used to specify a point in time in an event’s extended data.

    Declaration

    Objective-C

    + (nonnull NSDictionary *)extendedDataDate:(nonnull NSDate *)date;

    Swift

    class func extendedData(date: Date) -> [AnyHashable : Any]

    Parameters

    date

    A date and time to be included in an event’s extended data.

    Return Value

    An extended data dictionary representing a point in time, to be included in an event’s extended data.

  • Used to specify a geographic coordinate in an event’s extended data.

    Declaration

    Objective-C

    + (nonnull NSDictionary *)extendedDataLocationForLatitude:(double)latitude
                                                    longitude:(double)longitude;

    Swift

    class func extendedData(latitude: Double, longitude: Double) -> [AnyHashable : Any]

    Parameters

    latitude

    A location’s latitude coordinate.

    longitude

    A location’s longitude coordinate.

    Return Value

    An extended data dictionary representing a geographic coordinate, to be included in an event’s extended data.

  • Used to specify a commercial transaction (incorporating multiple items) in an event’s extended data.

    Declaration

    Objective-C

    + (nonnull NSDictionary *)
    extendedDataCommerceWithTransactionID:(nullable NSString *)transactionID
                              affiliation:(nullable NSString *)affiliation
                                  revenue:(nullable NSNumber *)revenue
                                 shipping:(nullable NSNumber *)shipping
                                      tax:(nullable NSNumber *)tax
                                 currency:(nullable NSString *)currency
                            commerceItems:
                                (nullable NSArray<NSDictionary *> *)commerceItems;

    Swift

    class func extendedData(transactionID: String?, affiliation: String?, revenue: NSNumber?, shipping: NSNumber?, tax: NSNumber?, currency: String?, commerceItems: [[AnyHashable : Any]]?) -> [AnyHashable : Any]

    Parameters

    transactionID

    The transaction’s ID.

    affiliation

    The store or affiliation from which this transaction occurred.

    revenue

    The transaction’s revenue.

    shipping

    The transaction’s shipping cost.

    tax

    Tax on the transaction.

    currency

    Currency for revenue/shipping/tax values.

    commerceItems

    An array of commerce items contained in the transaction. Create commerce items with [Apptentive extendedDataCommerceItemWithItemID:name:category:price:quantity:currency:].

    Return Value

    An extended data dictionary representing a commerce transaction, to be included in an event’s extended data.

  • Used to specify a commercial transaction (consisting of a single item) in an event’s extended data.

    Declaration

    Objective-C

    + (nonnull NSDictionary *)
    extendedDataCommerceItemWithItemID:(nullable NSString *)itemID
                                  name:(nullable NSString *)name
                              category:(nullable NSString *)category
                                 price:(nullable NSNumber *)price
                              quantity:(nullable NSNumber *)quantity
                              currency:(nullable NSString *)currency;

    Swift

    class func extendedData(itemID: String?, name: String?, category: String?, price: NSNumber?, quantity: NSNumber?, currency: String?) -> [AnyHashable : Any]

    Parameters

    itemID

    The transaction item’s ID.

    name

    The transaction item’s name.

    category

    The transaction item’s category.

    price

    The individual item price.

    quantity

    The number of units purchased.

    currency

    Currency for price.

    Return Value

    An extended data dictionary representing a single item in a commerce transaction, to be included in an event’s extended data.

  • Asynchronously determines if Message Center will be displayed when presentMessageCenterFromViewController: is called.

    If app has not yet synced with Apptentive, you will be unable to display Message Center. Use queryCanShowMessageCenterWithCompletion: to determine if Message Center is ready to be displayed. If Message Center is not ready you could, for example, hide the Message Center button in your interface. *

    Declaration

    Objective-C

    - (void)queryCanShowMessageCenterWithCompletion:
        (nonnull void (^)(BOOL))completion;

    Swift

    func queryCanShowMessageCenter(completion: @escaping (Bool) -> Void)
  • Presents Message Center modally from the specified view controller.

    If the SDK has yet to sync with the Apptentive server, this method returns NO and displays a We’re attempting to connect view in place of Message Center.

    Declaration

    Objective-C

    - (void)presentMessageCenterFromViewController:
        (nullable UIViewController *)viewController;

    Swift

    func presentMessageCenter(from viewController: UIViewController?)

    Parameters

    viewController

    The view controller from which to present Message Center.

  • Presents Message Center modally from the specified view controller.

    If the SDK has yet to sync with the Apptentive server, this method returns NO and displays a We’re attempting to connect view in place of Message Center.

    Declaration

    Objective-C

    - (void)presentMessageCenterFromViewController:
                (nullable UIViewController *)viewController
                                        completion:
                                            (void (^_Nullable)(BOOL))completion;

    Swift

    func presentMessageCenter(from viewController: UIViewController?, completion: ((Bool) -> Void)? = nil)

    Parameters

    viewController

    The view controller from which to present Message Center.

    completion

    Completion callback.

  • Presents Message Center from a given view controller with custom data.

    If the SDK has yet to sync with the Apptentive server, this method returns NO and displays a We’re attempting to connect view in place of Message Center.

    Declaration

    Objective-C

    - (void)presentMessageCenterFromViewController:
                (nullable UIViewController *)viewController
                                    withCustomData:
                                        (nullable NSDictionary *)customData;

    Swift

    func presentMessageCenter(from viewController: UIViewController?, withCustomData customData: [AnyHashable : Any]?)

    Parameters

    viewController

    The view controller from which to present Message Center.

    customData

    A dictionary of key/value pairs to be associated with any messages sent via Message Center.

  • Presents Message Center from a given view controller with custom data.

    If the SDK has yet to sync with the Apptentive server, this method returns NO and displays a We’re attempting to connect view in place of Message Center.

    Declaration

    Objective-C

    - (void)
    presentMessageCenterFromViewController:
        (nullable UIViewController *)viewController
                            withCustomData:(nullable NSDictionary *)customData
                                completion:(void (^_Nullable)(BOOL))completion;

    Swift

    func presentMessageCenter(from viewController: UIViewController?, withCustomData customData: [AnyHashable : Any]?, completion: ((Bool) -> Void)? = nil)

    Parameters

    viewController

    The view controller from which to present Message Center.

    customData

    A dictionary of key/value pairs to be associated with any messages sent via Message Center.

    completion

    Completion callback.

  • Dismisses Message Center.

    Note

    Under normal circumstances, Message Center will be dismissed by the user tapping the Close button, so it is not necessary to call this method.

    Declaration

    Objective-C

    - (void)dismissMessageCenterAnimated:(BOOL)animated
                              completion:(nullable void (^)(void))completion;

    Swift

    func dismissMessageCenter(animated: Bool, completion: (() -> Void)? = nil)

    Parameters

    animated

    YES to animate the dismissal, otherwise NO.

    completion

    A block called at the conclusion of the message center being dismissed.

  • Returns the current number of unread messages in Message Center.

    These are the messages sent via the Apptentive website to this user.

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSUInteger unreadMessageCount;

    Swift

    var unreadMessageCount: UInt { get }

    Return Value

    The number of unread messages.

  • Returns a badge than can be used as a UITableViewCell accessoryView to indicate the current number of unread messages.

    To keep this value updated, your view controller will must register for ApptentiveMessageCenterUnreadCountChangedNotification and reload the table view cell when a notification is received.

    Declaration

    Objective-C

    - (nonnull UIView *)unreadMessageCountAccessoryView:(BOOL)apptentiveHeart;

    Swift

    func unreadMessageCountAccessoryView(apptentiveHeart: Bool) -> UIView

    Parameters

    apptentiveHeart

    A Boolean value indicating whether to include a heart logo adjacent to the number.

    Return Value

    A badge view suitable for use as a table view cell accessory view.

  • Open your app’s page on the App Store or Mac App Store.

    This method can be used to power, for example, a Rate this app button in your settings screen. openAppStore opens the app store directly, without the normal Apptentive Ratings Prompt.

    Declaration

    Objective-C

    - (void)openAppStore;

    Swift

    func openAppStore()
  • Register for Push Notifications with the given service provider.

    Uses the deviceToken from application:didRegisterForRemoteNotificationsWithDeviceToken:

    Only one Push Notification Integration can be added at a time. Setting a Push Notification Integration removes all previously set Push Notification Integrations.

    To enable background fetching of Message Center messages upon receiving a remote notification, add remote-notification as a UIBackgroundModes value in your app’s Info.plist.

    Declaration

    Objective-C

    - (void)setPushNotificationIntegration:(ApptentivePushProvider)pushProvider
                           withDeviceToken:(nonnull NSData *)deviceToken;

    Swift

    func setPushProvider(_ pushProvider: ApptentivePushProvider, deviceToken: Data)

    Parameters

    pushProvider

    The Push Notification provider with which to register.

    deviceToken

    The device token used to send Remote Notifications. *

  • Forwards a push notification from your application delegate to Apptentive.

    Apptentive will attempt to fetch Messages Center messages in the background when the notification is received.

    To enable background fetching of Message Center messages upon receiving a remote notification, add remote-notification as a UIBackgroundModes value in your app’s Info.plist.

    The completionHandler block will be called when the message fetch is completed. To ensure that messages can be retrieved, please do not call the completionHandler block yourself if the notification was sent by Apptentive.

    If the notification was not sent by Apptentive, the parent app is responsible for calling the completionHandler block.

    Declaration

    Objective-C

    - (BOOL)didReceiveRemoteNotification:(nonnull NSDictionary *)userInfo
                  fetchCompletionHandler:
                      (nonnull void (^)(UIBackgroundFetchResult))completionHandler;

    Swift

    func didReceiveRemoteNotification(_ userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) -> Bool

    Parameters

    userInfo

    The userInfo dictionary of the notification.

    completionHandler

    The block to execute when the message fetch operation is complete.

    Return Value

    YES if the notification was sent by Apptentive, NO otherwise.

  • Forwards a push notification from your application delegate to Apptentive.

    Deprecated. The value passed to fromViewController is ignored. Use -didReceveRemoteNotification:fetchCompletionHandler instead.

    Declaration

    Objective-C

    - (BOOL)didReceiveRemoteNotification:(nonnull NSDictionary *)userInfo
                      fromViewController:(nonnull UIViewController *)viewController
                  fetchCompletionHandler:
                      (nonnull void (^)(UIBackgroundFetchResult))completionHandler;

    Swift

    func didReceiveRemoteNotification(_ userInfo: [AnyHashable : Any], from viewController: UIViewController, fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) -> Bool

    Parameters

    userInfo

    The userInfo dictionary of the notification.

    viewController

    The view controller Message Center may be presented from.

    completionHandler

    The block to execute when the message fetch operation is complete.

    Return Value

    YES if the notification was sent by Apptentive, NO otherwise.

  • Forwards a push notification from your application delegate to Apptentive Connect.

    Deprecated. The value passed to fromViewController is ignored. Use -didReceiveRemoteNotification:fetchCompletionHandler: instead.

    Declaration

    Objective-C

    - (BOOL)didReceiveRemoteNotification:(nonnull NSDictionary *)userInfo
                      fromViewController:(nonnull UIViewController *)viewController;

    Swift

    func didReceiveRemoteNotification(_ userInfo: [AnyHashable : Any], from viewController: UIViewController) -> Bool

    Parameters

    userInfo

    The userInfo dictionary of the notification.

    viewController

    The view controller Message Center may be presented from.

    Return Value

    YES if the notification was sent by Apptentive, NO otherwise.

  • Undocumented

    Declaration

    Objective-C

    - (BOOL)didReceiveLocalNotification:(UILocalNotification *)notification fromViewController:(UIViewController *)viewController NS_SWIFT_NAME(didReceiveLocalNotification(_:from:));

    Swift

    func didReceiveLocalNotification(_ notification: UILocalNotification, from viewController: UIViewController) -> Bool
  • Forwards a user notification from your user notification center delegate to Apptentive. In the event that this method returns NO, your code must call the completion handler.

    Declaration

    Objective-C

    - (BOOL)
    didReceveUserNotificationResponse:(nonnull UNNotificationResponse *)response
                   fromViewController:(nullable UIViewController *)viewController
                withCompletionHandler:(nonnull void (^)(void))completionHandler;

    Swift

    func didReceveUserNotificationResponse(_ response: UNNotificationResponse, from viewController: UIViewController?, withCompletionHandler completionHandler: @escaping () -> Void) -> Bool

    Parameters

    response

    The notification response

    viewController

    The view controller to present Message Center from. If absent, Message Center will be presented in a new window.

    completionHandler

    The completion handler that will be called if the notification was sent by Apptentive.

    Return Value

    YES if the notification was sent by Apptentive, NO otherwise.

  • Forwards a user notification from your user notification center delegate to Apptentive. In the event that this method returns NO, your code must call the completion handler.

    Declaration

    Objective-C

    - (BOOL)
    didReceveUserNotificationResponse:(nonnull UNNotificationResponse *)response
                withCompletionHandler:(nonnull void (^)(void))completionHandler;

    Swift

    func didReceveUserNotificationResponse(_ response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) -> Bool

    Parameters

    response

    The notification response

    completionHandler

    The completion handler that will be called if the notification was sent by Apptentive

    Return Value

    YES if the notification was sent by Apptentive, NO otherwise.

  • Tells the system to display an alert, if appropriate, for a notification. In the event that this method returns NO, your code must call the completion handler.

    Declaration

    Objective-C

    - (BOOL)willPresentNotification:(nonnull UNNotification *)notification
              withCompletionHandler:
                  (nonnull void (^)(UNNotificationPresentationOptions))
                      completionHandler;

    Swift

    func willPresent(_ notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) -> Bool

    Parameters

    notification

    The notification

    completionHandler

    The completion handler that will be called if the notification was sent by Apptentive

    Return Value

    YES if the notification was sent by Apptentive, NO otherwise.

  • Attaches text to the user’s feedback. This method should be called from the main thread only.

    This will appear in your online Apptentive dashboard, but will not appear in Message Center on the device.

    Declaration

    Objective-C

    - (void)sendAttachmentText:(nonnull NSString *)text;

    Swift

    func sendAttachment(_ text: String)

    Parameters

    text

    The text to attach to the user’s feedback as a file.

  • Attaches an image the user’s feedback. This method should be called from the main thread only.

    This will appear in your online Apptentive dashboard, but will not appear in Message Center on the device.

    Declaration

    Objective-C

    - (void)sendAttachmentImage:(nonnull UIImage *)image;

    Swift

    func sendAttachment(_ image: UIImage)

    Parameters

    image

    The image to attach to the user’s feedback as a file.

  • Attaches an arbitrary file to the user’s feedback. This method should be called from the main thread only.

    This will appear in your online Apptentive dashboard, but will not appear in Message Center on the device.

    Declaration

    Objective-C

    - (void)sendAttachmentFile:(nonnull NSData *)fileData
                  withMimeType:(nonnull NSString *)mimeType;

    Swift

    func sendAttachment(_ fileData: Data, mimeType: String)

    Parameters

    fileData

    The contents of the file as data.

    mimeType

    The MIME type of the file data.

  • The name of the app user when communicating with Apptentive.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) NSString *personName;

    Swift

    var personName: String? { get set }
  • The email address of the app user in form fields and communicating with Apptentive.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) NSString *personEmailAddress;

    Swift

    var personEmailAddress: String? { get set }
  • Removes custom data associated with the current person.

    Will remove data, if any, associated with the current person with the key key.

    Declaration

    Objective-C

    - (void)removeCustomPersonDataWithKey:(nonnull NSString *)key;

    Swift

    func removeCustomPersonData(withKey key: String)

    Parameters

    key

    The key of the data.

  • Removes custom data associated with the current device.

    Will remove data, if any, associated with the current device with the key key.

    Declaration

    Objective-C

    - (void)removeCustomDeviceDataWithKey:(nonnull NSString *)key;

    Swift

    func removeCustomDeviceData(withKey key: String)

    Parameters

    key

    The key of the data.

  • Adds custom text data associated with the current device.

    Adds an additional data field to any feedback sent. This will show up in the device data in the conversation on your Apptentive dashboard.

    Declaration

    Objective-C

    - (void)addCustomDeviceDataString:(nonnull NSString *)string
                              withKey:(nonnull NSString *)key;

    Swift

    func addCustomDeviceData(_ string: String, withKey key: String)

    Parameters

    string

    Custom data of type NSString.

    key

    A key to associate the data with.

  • Adds custom numeric data associated with the current device.

    Adds an additional data field to any feedback sent. This will show up in the device data in the conversation on your Apptentive dashboard.

    Declaration

    Objective-C

    - (void)addCustomDeviceDataNumber:(nonnull NSNumber *)number
                              withKey:(nonnull NSString *)key;

    Swift

    func addCustomDeviceData(_ number: NSNumber, withKey key: String)

    Parameters

    number

    Custom data of type NSNumber.

    key

    A key to associate the data with.

  • Adds custom Boolean data associated with the current device.

    Adds an additional data field to any feedback sent. This will show up in the device data in the conversation on your Apptentive dashboard.

    Declaration

    Objective-C

    - (void)addCustomDeviceDataBool:(BOOL)boolValue withKey:(nonnull NSString *)key;

    Swift

    func addCustomDeviceData(_ boolValue: Bool, withKey key: String)

    Parameters

    boolValue

    Custom data of type BOOL.

    key

    A key to associate the data with.

  • Adds custom text data associated with the current person.

    Adds an additional data field to any feedback sent. This will show up in the person data in the conversation on your Apptentive dashboard.

    Declaration

    Objective-C

    - (void)addCustomPersonDataString:(nonnull NSString *)string
                              withKey:(nonnull NSString *)key;

    Swift

    func addCustomPersonData(_ string: String, withKey key: String)

    Parameters

    string

    Custom data of type NSString.

    key

    A key to associate the data with.

  • Adds custom numeric data associated with the current person.

    Adds an additional data field to any feedback sent. This will show up in the person data in the conversation on your Apptentive dashboard.

    Declaration

    Objective-C

    - (void)addCustomPersonDataNumber:(nonnull NSNumber *)number
                              withKey:(nonnull NSString *)key;

    Swift

    func addCustomPersonData(_ number: NSNumber, withKey key: String)

    Parameters

    number

    Custom data of type NSNumber.

    key

    A key to associate the data with.

  • Adds custom Boolean data associated with the current person.

    Adds an additional data field to any feedback sent. This will show up in the person data in the conversation on your Apptentive dashboard.

    Declaration

    Objective-C

    - (void)addCustomPersonDataBool:(BOOL)boolValue withKey:(nonnull NSString *)key;

    Swift

    func addCustomPersonData(_ boolValue: Bool, withKey key: String)

    Parameters

    boolValue

    Custom data of type BOOL.

    key

    A key to associate the data with.

  • Dismisses any currently-visible interactions.

    Note

    This method is for internal use and is subject to change.

    Declaration

    Objective-C

    - (void)dismissAllInteractions:(BOOL)animated;

    Swift

    func dismissAllInteractions(animated: Bool)

    Parameters

    animated

    Whether to animate the dismissal.

  • Logs the specified user in, using the value of the proof parameter to ensure that the login attempt is authorized.

    Declaration

    Objective-C

    - (void)logInWithToken:(nonnull NSString *)token
                completion:(nonnull void (^)(BOOL, NSError *_Nonnull))completion;

    Swift

    func logIn(withToken token: String, completion: @escaping (Bool, Error) -> Void)

    Parameters

    token

    An authorization token.

    completion

    A block that is called when the login attempt succeeds or fails.

  • Ends the current user session. The user session will be persisted in a logged-out state so that it can be resumed using the logIn: method.

    Declaration

    Objective-C

    - (void)logOut;

    Swift

    func logOut()
  • A block that is called when a logged-in conversation’s request fails due to a problem with the user’s JWT.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic)
        ApptentiveAuthenticationFailureCallback _Nonnull authenticationFailureCallback;

    Swift

    var authenticationFailureCallback: ApptentiveAuthenticationFailureCallback { get set }