Log Level

Castled Swift SDK supports the following log levels

SwiftObjective CDescription
.errorCastledLogLevelErrorLogs errors
.debugCastledLogLevelDebugLogs debugging informations & .error
.infoCastledLogLevelInfoLogs everything including .info,.debug &.error
.noneCastledLogLevelNoneDisables 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, andDelegate: self)
  ...
  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 NameDescriptionDefault Value
enablePushEnables push notification supportfalse
enableInAppEnables In App notification supportfalse
enableAppInboxEnables App Inbox notification supportfalse
enableTrackingEnables tracking of App eventsfalse
locationPreferred server locationUS
enableSessionTrackingEnables tracking of User Sessionstrue
skipUrlHandlingDisables the click action handling by the SDK. Set when app handles the notification action itselffalse
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, andDelegate: self)
  ...
  return true
}