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, andDelegate: self)
...
return true
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
...
CastledConfigs config = [CastledConfigs initializeWithInstanceId:@"<App Id>"];
config.logLevel = CastledLogLevelDebug;
[Castled initializeWithConfig:config andDelegate:self];
...
return YES;
}
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 |
| enableSessionTracking | Enables tracking of User Sessions | true |
| skipUrlHandling | Disables the click action handling by the SDK. Set when app handles the notification action itself | false |
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
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
...
CastledConfigs config = [CastledConfigs initializeWithInstanceId:@"<App Id>"];
config.permittedBGIdentifier = @"com.castled.backgroundtask";
config.enablePush = TRUE;
config.enableInApp = TRUE;
config.enableAppInbox = TRUE;
config.appGroupId = @"group.com.castled.CastledPushDemo.Castled";
config.logLevel = CastledLogLevelDebug;
config.location = CastledLocationUS;
[Castled initializeWithConfig:config andDelegate:self];
...
return YES;
}