iOS SDK FAQ and Troubleshooting

Follow

This document highlights the most frequently asked questions and any troubleshooting queries you may face when integrating the Countly iOS SDK into yout iOS, watchOS, tvOS, or macOS applications. To learn how to integrate the Countly iOS SDK itself, please view the Countly iOS SDK document here.

What platforms does Countly iOS SDK support?

Even though its official name is Countly iOS SDK, it supports all Apple platforms (macOS, tvOS, and watchOS), in addition to iOS. You can use the same SDK for all kinds of projects with different sets of features available for each platform. You can also see how to integrate it into your projects by checking our sample apps here.

Which features are available for each platform?

In addition to Analytics, Events, and User Profiles features, Countly iOS SDK has Push Notifications, Crash Reporting, Auto View Tracking, Remote Config, and Star-Rating features. Availability of these features for platforms are as follows:

  • iOS
    Analytics, Custom Events, User Profiles, Push Notifications, Crash Reporting, Auto View Tracking, Star-RatingRemote Config

  • macOS
    Analytics, Custom Events, User Profiles, Push Notifications,Crash ReportingRemote Config

  • tvOS
    Analytics, Custom Events, User Profiles, Auto View Tracking,Crash Reporting, Remote Config

  • watchOS
    Analytics, Custom Events, User Profiles, Crash Reporting,Remote Config

Can I integrate Countly iOS SDK using CocoaPods?

We keep our Countly.podspec file up-to-date, so you can integrate Countly iOS SDK using CocoaPods. But, please make sure you read our notes to avoid issues.

How can I tell which Countly iOS SDK version I am using?

You can check for kCountlySDKVersion constant in Countly iOS SDK source. It is defined as NSString* const kCountlySDKVersion = @"18.08";

What is the difference between Default Properties and Custom Properties of User Profiles?

User Profiles (only available in Enterprise Edition) has two kinds of properties: Default Properties and Custom Properties.

Default Properties are predefined fields like name, username, email, birth year, organization, gender, phone number and profile picture. They are displayed in their own place in User Profiles section. You can set them using default properties on Countly.user singleton ( Ex: Countly.user.email = @"john@doe.com"; ) and record them using [Countly.user save]; method.

Custom Properties are custom defined key-value pairs. You can set them using Countly.user.custom dictionary ( Ex: Countly.user.custom = @{@"testkey1":@"testvalue1", @"testkey2":@"testvalue2"}; ) and record them using [Countly.user save]; method as well.

In addition to this, you can use Custom Property Modifiers to set, unset or modify Custom Properties and record your changes using [Countly.user save]; method again.

For details please see User Profiles documentation.

How can I handle logged in and logged out users?

When a user logs in on your app and you have a uniquely identifiable string for that user (like user ID or email address), you can use it instead of device ID to track all info afterwards, without losing all the data generated by that user so far. You can use userLoggedIn: method ( Ex: [Countly.sharedInstance userLoggedIn:@"user123@example.com"]; ). This will replace previously used device ID on device, and merge all existing data on server.

Later, when the user logs out, you can use [Countly.sharedInstance userLoggedOut]; method which will switch back to default deviceID and track that device anonymously.

Why are events not displayed on Countly Server dashboard?

Events are queued but not sent to server until next updateSessionPeriod (60 seconds by default) or eventSendThreshold (10 by default) is reached. So, a little delay may be expecting in displaying events on Countly Server dashboard, while still seeing session data immediately.

In addition to this, Countly iOS SDK sends previously stored requests, if any, followed by a begin_session request, when it starts. If your app records any events meanwhile, these events will be queued and sent to server when all previously queued requests are successfully completed.

How should I answer IDFA related questions on App Store Connect?

Apple has some rules on IDFA usage in the apps depending on purpose. If you are getting warnings about this while sending your app to the App Store, please read this document.

Why can some of the requests not be processed by Countly Server?

There was a query string encoding bug in Countly iOS SDK in versions 16.02.01 and 16.06. Due to this bug, some carrier names (especially Chinese) in query string cannot be parsed. This has been fixed in version 16.06.1. If you are using one of the specified versions, please update the SDK.

Is it possible to use Countly iOS SDK with another crash SDK?

In iOS there can only be one uncaught exception handler. Even though it is possible to save the previous handler and pass the uncaught exception to the previous handler as well, it is not safe to assume that it will work in all cases. We can't know how other SDKs are implemented or whether iOS will give enough time for the all the handlers to do their work before terminating the app, hence, we advise to use Countly as the only crash handler.

Why are my test crashes not reported?

If you are running your app with Xcode debugger attached while forcing a test crash, Countly iOS SDK cannot handle the crash as debugger will be intercepting. Please make sure you run your app without Xcode debugger attached.

How can I manually record push notification custom button actions?

If you have set doNotShowAlertForNotifications flag on initial configuration object to handle push notifications manually, you can create your own custom UI to show notification message and action buttons. For this, just implement - (void) application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler method in your application's delegate. For details of handling notification manually, please see Handling Notifications Manually section.

How can I get rid of compiler warning "No rule to process file"?

If you get Warning: no rule to process file '../countly-sdk-ios/README.md' of type net.daringfireball.markdown for architecture arm64 in Xcode, it means README.md (and/or CHANGELOG.md) file is added to Build Phases > Compile Sources in your target. Please remove README.md from Compile Sources list.

What is the average data size of a Countly iOS SDK request sent to Countly Server?

While there are several types of requests that Countly iOS SDK sends to Countly Server, the most common ones are:

  • Begin Session Request: It is sent on every app launch (and session start after coming back from the background), and it includes basic metrics.
    An example Begin Session request (498 bytes) :
http://mycountlyserver.com/i?app_key=0000000000000000000000000000000000000000
&device_id=00000000-0000-0000-0000-000000000000
&timestamp=1534402860000&hour=16&dow=5&tz=540
&sdk_version=18.08&sdk_name=objc-native-ios
&begin_session=1
&metrics=%7B%22_device%22%3A%22iPhone9%2C1%22%2C%22_os%22%3A%22iOS%22%2C%22_os_version%22%3A%2211.4.1%22%2C%22_locale%22%3A%22en_JP%22%2C%22_density%22%3A%22%402x%22%2C%22_resolution%22%3A%22750x1334%22%2C%22_app_version%22%3A%221.0%22%2C%20%22_carrier%22%3A%22NTT%22%7D
  • Update Session Request: It is sent every 60 seconds by default, but it depends on Countly iOS SDK initial configuration.
    An example Update Session request (233 bytes) :
http://mycountlyserver.com/i?app_key=0000000000000000000000000000000000000000
&device_id=00000000-0000-0000-0000-000000000000
&timestamp=1534402920000&hour=16&dow=5&tz=540
&sdk_version=18.08&sdk_name=objc-native-ios
&session_duration=60
  • End Session Request: It is sent at the end of a session, when the app goes to background or terminates.
    An example End Session request (247 bytes) :
http://mycountlyserver.com/i?app_key=0000000000000000000000000000000000000000
&device_id=00000000-0000-0000-0000-000000000000
&timestamp=1534402956000&hour=16&dow=5&tz=540
&sdk_version=18.08&sdk_name=objc-native-ios
&session_duration=36
&end_session=1
  • Other Requests For Events, User Details, Push Notifications, Crash Reporting, View Tracking, Feedbacks, Consents, and some other features: Countly iOS SDK sends various requests with various data sizes. Frequency and size of these requests depend on Countly iOS SDK initial configuration and your app's use cases, as well as the end user.

What data metrics are collected by Countly iOS SDK?

Countly iOS SDK collects following metrics by default:

  • Device Model
  • Screen Resolution
  • Screen Density
  • OS Name
  • OS Version
  • App Version
  • Locale Identifier
  • Carrier

Further, if Apple Watch feature is enabled: - Paired Apple Watch Presence - watchOS App Install Status

Why are push notification action events not reported?

Notification action event is recorded when a user interacts with the notification and system calls didReceiveNotificationResponse: method.

If you tap on the notification, but still do not get any action events, please check for the following possible problem points:
  1. You are setting UNUserNotificationCenter.currentNotificationCenter's delegate manually at some point, so Countly iOS SDK can not handle the notification
  2. requiresConsent flag is enabled on initial config, but consent for Push Notifications feature is not granted (Note that this has nothing to do with iOS notification permission)
  3. Notification is not coming from Countly and it does not have any value for kCountlyPNKeyNotificationID = @"i"  key in it

 

 

Was this article helpful?
0 out of 1 found this helpful

Looking for help?