OMCSettings Class Reference
Inherits from | NSObject |
---|---|
Declared in | OMCSettings.h |
+ settingsWithAppId:
Initializes a settings object with the given app id.
+ (instancetype)settingsWithAppId:(NSString *)appId
Parameters
appId |
A valid app id retrieved from the Bots web portal. |
---|
Declared In
OMCSettings.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 Bots web portal. |
---|---|
authCode |
A valid auth code generated from the Bots API. |
Declared In
OMCSettings.h
appId
The app id corresponding to your application.
@property (nonatomic, copy) NSString *appId
Discussion
App id can be retrieved from the Bots web portal
This value may only be set once, and must be set at init time.
Declared In
OMCSettings.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 Bots API
This value may only be set once, and must be set at init time.
Declared In
OMCSettings.h
region
The Bots 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
OMCSettings.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
OMCSettings.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
OMCSettings.h
allowedMenuItems
The items to display in the conversation menu
@property (nonatomic, strong, nullable) NSArray<NSString*> *allowedMenuItems
Discussion
Valid values are OMCMenuItemCamera, OMCMenuItemGallery, OMCMenuItemDocument and OMCMenuItemLocation
All options are displayed by default. Setting this value to nil or an empty array will hide the menu button
Declared In
OMCSettings.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
OMCSettings.h
enableAppDelegateSwizzling
Whether or not to swizzle app delegate methods for handling push notifications.
@property BOOL enableAppDelegateSwizzling
Discussion
When set to YES, Bots will swizzle the following methods of your UIApplicationDelegate in order to automatically handle push notification receiving and registering, as well as user notification handling.
- -application:didRegisterForRemoteNotificationsWithDeviceToken:
- -application:didFailToRegisterForRemoteNotificationsWithError:
- -application:didReceiveRemoteNotification:
- -application:didReceiveRemoteNotification:fetchCompletionHandler:
- -application:handleActionWithIdentifier:forRemoteNotification:withResponseInfo:completionHandler:
If set to NO, Bots will not perform swizzling. It is up to the app to handle Bots push notifications by doing the following:
- When a new push token is received in -application:didRegisterForRemoteNotificationsWithDeviceToken:, you must call Bots +setPushToken.
- In your -application:didReceiveRemoteNotification: or -application:didReceiveRemoteNotification:fetchCompletionHandler: callback, you must call Bots +handlePushNotification: with the passed userInfo dictionary.
- In your -application:handleActionWithIdentifier:forRemoteNotification:withResponseInfo:completionHandler: callback, you must call Bots +handleUserNotificationActionWithIdentifier:withResponseInfo:completionHandler: with the correct parameters.
The default value is YES.
See Also
Declared In
OMCSettings.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 Bots class.
If set to NO, the application must forward calls from its own UNUserNotificationCenterDelegate to Bots to ensure proper handling of notifications on iOS 10.
The default value is YES.
See Also
Declared In
OMCSettings.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 Bots user notification category settings. For more information, see the +userNotificationCategories method of the Bots class.
The default value is YES.
See Also
Declared In
OMCSettings.h