Skip to content

Troubleshooting iOS SDK integration

NOTE

If you encounter any issues during integration and testing of Contextual then the quickest and best way for us to help is to get a build of your app so we can test your app from our side. To do this please get your developers to add QA@contextu.al to your test platform (Testflight, Fabric, App center etc) with the device id of 744d3c12be72e17a5e3c76f8be809ce17469def0

Capture a crash report from a device

If you ever encounter a hanging app or a crash then please try to provide us with some of the following information so that we can debug the iussue as quickly as possible.

Sharing from system settings

  • Go to OS Settings, Find "Privacy" -> "Analytics"
  • Enable "Share iPhone Analytics" and then enable "Share With App Developers"
  • Go to "Analytics Data"
  • You should see a bunch of .ips files here (formatted as <app_name>-<datetime>.ips), choose the one with your app name and the datetime when crash occur
  • Click the right upper corner's button to share this file with us

Using the Xcode Organizer

Note

This method requires you have Xcode installed on your machine.

  • Launch Xcode on your desktop machine.
  • Open the Xcode Devices and Simulators window. (Window menu -> Devices and Simulators, or Cmd-Shift-2.)
  • Find your device in the left sidebar, then select “device logs”.
  • Choose the crash (or multiple crashes) and select “Export” at the bottom of the Organizer window.
  • This will copy the crash reports to your hard drive.
  • Send this report to us

Capture a crash report from the iOS Simulator

  • After a crash happen there will be a crash report generated at path ~/Library/Logs/DiagnosticReports/
  • The report will be named as <app_name>_<datetime>_<device_name>.crash
  • Choose the one with your app name and the datetime when crash occur
  • Send this report to us

Enclose corresponding dSYM file

In order to analysis the original bug report you've sent to us, it is very important that you also enclose the corresponding dSYM file together with the report.

  • Open your project by using cocoapods project launcher <app_name>.xcworkspace
  • Choose project Pods on the left side panel
  • Go to Build Settings
  • Search for debug information format
  • Make sure it is set as DWARF with dSYM File for Debug build or Release build depends on which build are you testing with

Further information may help

What are the steps to replicate the issue ?

  • Try to write steps to replicate issues including additional information such as:
  • AppKey
  • Device version
  • Contextual version
  • Guide name

Provide videos to help us understand the issue better:

  • Sometimes a recording the issue can help us understand the issue a little bit better. A good software for windows 10 is Hit the Windows key and G. For window MAC it is QuickTime Player from your Applications folder.

Sharing your app's view hierarchy

  • Apple change things frequently, crash may happen when a layout hierarchy unexpectedly changed, please do the following command in debug mode and enclose the result to allow us to analyze the view hierarchy.
    1
    po [[UIWindow keyWindow] recursiveDescription]
    

Enable Debug logging

To enable more verbose logging from the Contextual sdk pass the withDebugMode parameter to the registerInstall method.

Swift 
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
import ContextualSDK

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate
{
    var window: UIWindow?

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool
    {
        // Replace 'MyApp' with your app_key, registered in the Contextual Dashboard.
        // Set 'withDebugMode' to 'true to enable debug logging.
        Contextual.sharedInstance().registerInstall(forApp: "MyApp", withDebugMode: true)
        return true
    }
}
Objc 
1
2
3
4
5
6
7
8
9
#import "ContextualSDK/ContextualSDK.h"

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // Replace 'MyApp' with your app_key, registered in the Contextual Dashboard.
    // Set 'withDebugMode' to 'YES' to enable debug logging.
    [CONTEXTUAL registerInstallForApp:@"MyApp" withDebugMode:YES];
    return YES;
}

Last update: 2024-01-16