SKTSettings Class Reference

Inherits from NSObject
Declared in SKTSettings.h

+ settingsWithAppId:

Initializes a settings object with the given app id.

+ (instancetype)settingsWithAppId:(NSString *)appId

Parameters

appId

A valid app id retrieved from the Smooch web portal.

Declared In

SKTSettings.h

+ settingsWithAppId:andAuthCode:

Initializes a settings object with the given app id and auth code.

+ (instancetype)settingsWithAppId:(NSString *)appId andAuthCode:(NSString *)authCode

Parameters

appId

A valid app id retrieved from the Smooch web portal.

authCode

A valid auth code generated from the Smooch API.

Declared In

SKTSettings.h

  appId

The app id corresponding to your application.

@property (nonatomic, copy) NSString *appId

Discussion

App id can be retrieved from the Smooch web portal

This value may only be set once, and must be set at init time.

Declared In

SKTSettings.h

  authCode

The auth code being used to authenticate as an existing user.

@property (nonatomic, copy) NSString *authCode

Discussion

Auth code can be retrieved from the Smooch API

This value may only be set once, and must be set at init time.

Declared In

SKTSettings.h

  region

The Smooch region for this account.

@property (nonatomic, copy) NSString *region

Discussion

Leave unspecified to use the default region (US). Set to “eu-1” to use the EU region.

Declared In

SKTSettings.h

  conversationAccentColor

The accent color for the conversation screen.

@property (nonatomic, strong) UIColor *conversationAccentColor

Discussion

Used as the color of user message bubbles, as well as the color of the send button and text input caret.

The default value is #00B0FF.

Declared In

SKTSettings.h

  conversationStatusBarStyle

The status bar style to use on the conversation screen.

@property UIStatusBarStyle conversationStatusBarStyle

Discussion

You should use this property if your app uses UIAppearance to style UINavigationBar, and your styling requires a specific status bar color.

The default value is UIStatusBarStyleDefault.

Declared In

SKTSettings.h

  allowedMenuItems

The items to display in the conversation menu

@property (nonatomic, strong, nullable) NSArray<NSString*> *allowedMenuItems

Discussion

Valid values are SKTMenuItemCamera, SKTMenuItemGallery, SKTMenuItemDocument and SKTMenuItemLocation

All options are displayed by default. Setting this value to nil or an empty array will hide the menu button

Declared In

SKTSettings.h

  allowOfflineUsage

Allow sending messages from the conversation view when offline

@property BOOL allowOfflineUsage

Discussion

Setting this to YES allows the user to send messages even when the device is offline. It also prevents an network error banner from showing when offline.

Note that messages that are sent while offline will fail to send and the message will display an option for the user to retry

Declared In

SKTSettings.h

  notificationDisplayTime

Maximum number of seconds to display in-app notifications before dismissing.

@property NSUInteger notificationDisplayTime

Discussion

Setting this value to 0 will cause notications to stay on-screen until the user acts on them.

The default value is 8.

Declared In

SKTSettings.h

  enableAppDelegateSwizzling

Whether or not to swizzle app delegate methods for handling push notifications.

@property BOOL enableAppDelegateSwizzling

Discussion

When set to YES, Smooch will swizzle the following methods of your UIApplicationDelegate in order to automatically handle push notification receiving and registering, as well as user notification handling.

  1. -application:didRegisterForRemoteNotificationsWithDeviceToken:
  2. -application:didFailToRegisterForRemoteNotificationsWithError:
  3. -application:didReceiveRemoteNotification:
  4. -application:didReceiveRemoteNotification:fetchCompletionHandler:
  5. -application:handleActionWithIdentifier:forRemoteNotification:withResponseInfo:completionHandler:

If set to NO, Smooch will not perform swizzling. It is up to the app to handle Smooch push notifications by doing the following:

  1. When a new push token is received in -application:didRegisterForRemoteNotificationsWithDeviceToken:, you must call Smooch +setPushToken.
  2. In your -application:didReceiveRemoteNotification: or -application:didReceiveRemoteNotification:fetchCompletionHandler: callback, you must call Smooch +handlePushNotification: with the passed userInfo dictionary.
  3. In your -application:handleActionWithIdentifier:forRemoteNotification:withResponseInfo:completionHandler: callback, you must call Smooch +handleUserNotificationActionWithIdentifier:withResponseInfo:completionHandler: with the correct parameters.

The default value is YES.

See Also

Declared In

SKTSettings.h

  enableUserNotificationCenterDelegateOverride

Whether or not to automatically replace the application’s UNUserNotificationCenterDelegate at init time.

@property BOOL enableUserNotificationCenterDelegateOverride

Discussion

For more information, see the +userNotificationCenterDelegate method of the Smooch class.

If set to NO, the application must forward calls from its own UNUserNotificationCenterDelegate to Smooch to ensure proper handling of notifications on iOS 10.

The default value is YES.

See Also

Declared In

SKTSettings.h

  requestPushPermissionOnFirstMessage

Whether or not to request user notification privileges after the user sends their first message.

@property BOOL requestPushPermissionOnFirstMessage

Discussion

If your app has a preferred time to request user notification privileges, set this to NO.

If set to NO, the application must make sure to register the Smooch user notification category settings. For more information, see the +userNotificationCategories method of the Smooch class.

The default value is YES.

See Also

Declared In

SKTSettings.h

  authenticationDelegate

Delegate that will be notified of authentication related events

@property (nullable) id<SKTAuthenticationDelegate> authenticationDelegate

Discussion

This delegate is useful if your app uses expiring tokens for your users. This way you can renew an invalid jwt when needed without having to call +login:jwt:completionHandler. May be nil

This value may only be set once, and must be set at init time.

Declared In

SKTSettings.h