Debugging & Logging

PushIOManager supports several debug levels which control how verbose the library is when logging to the console. Setting a debug level may significantly help troubleshooting your integration.

To set a debug level, simply add a line like the following into AppDelegate.m, directly under "//Initial Setup" in didFinishLaunchingWithOptions:

#ifdef DEBUG
        [[PushIOManager sharedInstance] setLoggingEnabled:YES];
        [[PushIOManager sharedInstance] setLogLevel:PIOLogLevelInfo]; //PIOLogLevelWarn or PIOLogLevelError
    #else
        [[PushIOManager sharedInstance] setLoggingEnabled:NO];
    #endif						
#if DEBUG
    PushIOManager.sharedInstance().setLoggingEnabled(true);
    PushIOManager.sharedInstance().setLogLevel(PIOLogLevel.info); //PIOLogLevel.warn or PIOLogLevel.error
#else
    PushIOManager.sharedInstance().setLoggingEnabled(false)
#endif				

The available debug levels are:

  • PIOLogLevel.verbose
  • PIOLogLevel.debug
  • PIOLogLevel.info
  • PIOLogLevel.warn
  • PIOLogLevel.error
  • PIOLogLevel.none

PIOLogLevel.verbose is the highest level of debugging and will display the data logged by the PushIOManager in the Debugger/Organizer Console.

NOTE: Logging is enabled by default with log level as PIOLogLevel.info.

For example, the data may look something like this:

    appv = "2.0";
    c = "Europe,China";
    cr = "n/f";
    d = 2;
    di = "ECFC65AE-0E54-4314-8A77-84CF02E3742C";
    dt = ed73effd3a986950bcc36ce261ffee754f3eb246a82c97b6cd0d0941d78f6be9;
    h = 1136;
    ins = 1388688062;
    l = "en_US";
    libv = "2.10.0";
    mf = Apple;
    mod = "iPod5,1";
    osv = "7.0.4";
    tz = "America/Denver";
    utc = "-25200";
    w = 640;						

SDK Crash Reporting

The SDK is capable of reporting crashes that happen within the SDK back to Responsys. This feature is enabled by default. All crashes by the SDK are propagated back to the application, so that the application can capture and implement its own crash reporting.

You can disable this capability for your mobile app by calling following method and passing NO (for Objective-C) or false (for Swift). To re-enable it, pass YES (for Objective-C) or true (for Swift).

[[PushIOManager sharedInstance] setCrashLoggingEnabled:YES];
PushIOManager.sharedInstance().setCrashLoggingEnabled(true)