Inherits from NSObject
Declared in QBSettings.h

Overview

QBSettings class interface. Class for framework setup.

Tasks

Class Methods

apiEndpoint

+ (nullable NSString *)apiEndpoint
Discussion

Returns Api Endpoint for current zone

Return Value

NSString value of Api Endpoint

Declared In

QBSettings.h

chatEndpoint

+ (NSString *)chatEndpoint
Discussion

Get server’s Chat endpoint

Note: you have to prepend http or https prefix

Return Value

Current server’s Chat endpoint

Declared In

QBSettings.h

currentServiceZone

+ (QBConnectionZoneType)currentServiceZone
Discussion

Return current Service Zone

Note: serviceZone - Service Zone. One from QBConnectionZoneType. Default - QBConnectionZoneTypeAutomatic

Declared In

QBSettings.h

disableFileLogging

+ (void)disableFileLogging
Discussion

Disable logging to file

Declared In

QBSettings.h

disableXMPPLogging

+ (void)disableXMPPLogging
Discussion

Disable full XMPP Framework logging to console.

Declared In

QBSettings.h

enableFileLoggingWithMaximumFileSize:

+ (void)enableFileLoggingWithMaximumFileSize:(unsigned long long)maximumFileSize
Discussion

Enable log to file The approximate maximum size to allow log files to grow. If a log file is larger than this value after a log statement is appended, then the log file is rolled.

Parameters

maximumFileSize

maximum file size in bytes, for example: 1024 * 1024 * 10 = 10Mb

Declared In

QBSettings.h

enableXMPPLogging

+ (void)enableXMPPLogging
Discussion

Enable full XMPP Framework logging to console. By default is disabled.

Declared In

QBSettings.h

isChatDNSLookupCacheEnabled

+ (BOOL)isChatDNSLookupCacheEnabled
Discussion

Get Chat DNS lookup cache enabled state

Warning: Deprecated in 2.7.6.

Return Value

YES if cache is enabled, NO if cache is disabled.

Declared In

QBSettings.h

isNetworkIndicatorVisible

+ (BOOL)isNetworkIndicatorVisible
Discussion

A Boolean value indicating whether the network activity indicator is currently displayed in the status bar.

Declared In

QBSettings.h

logFilePaths

+ (nullable NSArray<NSString*> *)logFilePaths
Discussion

Returns log file paths if loggint to file is enabled Example name of log file: /var/mobile/Containers/Data/Application/518F9FD2-BB4C-4AF4-89D8-7FF85B0518B7/Library/Caches/Logs/com.quickblox.supersample 2016-03-25 11-23.log

Return Value

Array of log file paths or nil if logging to file is disabled

Declared In

QBSettings.h

sessionConfiguration

+ (nullable NSURLSessionConfiguration *)sessionConfiguration
Discussion

Get custom session configuration.

Return Value

Your NSURLSessionConfiguration object.

Declared In

QBSettings.h

setAccountKey:

+ (void)setAccountKey:(NSString *)accountKey
Discussion

Set account key

Parameters

accountKey

Account key - from admin.quickblox.com

Declared In

QBSettings.h

setApiEndpoint:chatEndpoint:forServiceZone:

+ (void)setApiEndpoint:(nullable NSString *)apiEndpoint chatEndpoint:(nullable NSString *)chatEndpoint forServiceZone:(QBConnectionZoneType)zone
Discussion
  • Allows to set api endpoint and chat endpoint for service zone. *
  • @note QBConnectionZoneTypeAutomatic is used by default.
  • If you are using shared server and you are migrating to enterprise account,
  • then you don’t need to resubmit your application, endpoints will be updated automatically.

  • To set custom endpoints use QBConnectionZoneTypeProduction or QBConnectionZoneTypeDevelopment service zone.

  • Then you should manually activate your service zone by calling setServiceZone: *
  • @param apiEndpoint apiEndpoint - Endpoint for service i.e. http://my_custom_endpoint.com. Possible to pass nil to return to default settings
  • @param chatEndpoint chat endpoint
  • @param zone QBConnectionZoneType - service zone

Declared In

QBSettings.h

setApplicationGroupIdentifier:

+ (void)setApplicationGroupIdentifier:(NSString *)appGroupIdentifier
Discussion

Setting application group identifier

Parameters

appGroupIdentifier
  • NSString value of identifier.

Declared In

QBSettings.h

setApplicationID:

+ (void)setApplicationID:(NSUInteger)applicationID
Discussion

Storing Application ID

Declared In

QBSettings.h

setAuthKey:

+ (void)setAuthKey:(NSString *)authKey
Discussion

Setting API Key for Quickblox API

Parameters

authKey
  • NSString value of API Key.

Declared In

QBSettings.h

setAuthSecret:

+ (void)setAuthSecret:(NSString *)authSecret
Discussion

Setting API Secret for Quickblox API

Parameters

authSecret
  • NSString value of API Secret.

Declared In

QBSettings.h

setAutoReconnectEnabled:

+ (void)setAutoReconnectEnabled:(BOOL)autoReconnectEnabled
Discussion

Enable or disable chat auto reconnect

Parameters

autoReconnectEnabled

The default value is NO

Declared In

QBSettings.h

setCarbonsEnabled:

+ (void)setCarbonsEnabled:(BOOL)carbonsEnabled
Discussion

Enable or disable message carbons

Note: Call this method after chat connection has been established

Parameters

carbonsEnabled

BOOL value

Declared In

QBSettings.h

setChatDNSLookupCacheEnabled:

+ (void)setChatDNSLookupCacheEnabled:(BOOL)enabled
Discussion

Enable or Disable chat DNS Lookup cache for current chat endpoint

Caches DNS lookup for chat api endpoint.

Warning: Deprecated in 2.7.6.

Parameters

enable

YES / NO. Defaults NO

Declared In

QBSettings.h

setKeepAliveInterval:

+ (void)setKeepAliveInterval:(NSTimeInterval)keepAliveInterval
Discussion

Many routers will teardown a socket mapping if there is no activity on the socket. For this reason, the stream supports sending keep-alive data. This is simply whitespace, which is ignored by the protocol.

Keep-alive data is only sent in the absence of any other data being sent/received.

The default value is 20s. The minimum value for TARGET_OS_IPHONE is 10s, else 20s.

To disable keep-alive, set the interval to zero (or any non-positive number).

The keep-alive timer (if enabled) fires every (keepAliveInterval / 4) seconds. Upon firing it checks when data was last sent/received, and sends keep-alive data if the elapsed time has exceeded the keepAliveInterval. Thus the effective resolution of the keepalive timer is based on the interval.

Declared In

QBSettings.h

setLogLevel:

+ (void)setLogLevel:(QBLogLevel)logLevel
Discussion

Set SDK log level (by default: QBLogLevelDebug). Possible values: QBLogLevelDebug, QBLogLevelNothing.

Parameters

logLevel

New log level

Declared In

QBSettings.h

setNetworkIndicatorManagerEnabled:

+ (void)setNetworkIndicatorManagerEnabled:(BOOL)enabled
Discussion
  • A Boolean value indicating whether the manager is enabled.

  • If YES, the manager will change status bar network activity indicator according to network operation notifications it receives.

  • The default value is NO.

Declared In

QBSettings.h

setReconnectTimerInterval:

+ (void)setReconnectTimerInterval:(NSTimeInterval)reconnectTimerInterval
Discussion

A reconnect timer may optionally be used to attempt a reconnect periodically. Default value is 5 seconds

Declared In

QBSettings.h

setServiceZone:

+ (void)setServiceZone:(QBConnectionZoneType)serviceZone
Discussion

Allows to change Services Zone to work with Production, Development and Staging environments

Parameters

serviceZone

Declared In

QBSettings.h

setSessionConfiguration:

+ (void)setSessionConfiguration:(nullable NSURLSessionConfiguration *)configuration
Discussion

Set custom session configuration that will be used for REST API requests. ‘[NSURLSessionConfiguration defaultSessionConfiguration]’ is used if nil is passed.

Parameters

configuration

Your NSURLSessionConfiguration object.

Declared In

QBSettings.h

setStreamManagementSendMessageTimeout:

+ (void)setStreamManagementSendMessageTimeout:(NSUInteger)streamManagementSendMessageTimeout
Discussion

Set timeout value for Stream Management send a message operation

Declared In

QBSettings.h

setStreamResumptionEnabled:

+ (void)setStreamResumptionEnabled:(BOOL)streamResumptionEnabled
Discussion

Enable or disable Stream Resumption (XEP-0198).

Parameters

streamResumptionEnabled

BOOL value. The default value is NO

Declared In

QBSettings.h