SDK Setup
SDK Customization
Log Level
Castled Swift SDK supports the following log levels
Swift | Objective C | Description |
---|---|---|
.error | CastledLogLevelError | Logs errors |
.debug | CastledLogLevelDebug | Logs debugging informations & .error |
.info | CastledLogLevelInfo | Logs everything including .info,.debug &.error |
.none | CastledLogLevelNone | Disables logs. When set no logs will be printed |
The default log level is debug
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
...
let config = CastledConfigs.initialize(appId: "<App ID>")
config.logLevel = CastledLogLevel.debug
Castled.initialize(withConfig: config, delegate: self, andNotificationCategories: nil)
...
return true
}
Configs
This section covers the basic configurations available in the SDK. Use these configs if you want to enable specific mobile communication channel or want to override default behavior.
Config Name | Description | Default Value |
---|---|---|
enablePush | Enables push notification support | false |
enableInApp | Enables In App notification support | false |
enableAppInbox | Enables App Inbox notification support | false |
enableTracking | Enables tracking of App events | false |
location | Preferred server location | US |
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
...
let config = CastledConfigs.initialize(appId: "<App ID>")
config.permittedBGIdentifier = "com.castled.backgroundtask"
config.appGroupId = "group.com.castled.CastledPushDemo.Castled"
config.enablePush = true
config.enableInApp = true
config.enableAppInbox = true
config.location = CastledLocation.US
config.logLevel = CastledLogLevel.debug
Castled.initialize(withConfig: config, delegate: self, andNotificationCategories: nil)
...
return true
}