AppMetrica Blog

Big post about the AppMetrica SDK: several reasons to update

Smartphones are getting faster and more secure, and work longer on a single charge. While this is partly due to powerful hardware, it is also achieved by frequent updates to mobile operating systems with releases of new tools to help save power and work with RAM. At the same time, data collection polices are continuously being adjusted.

Our SDK also needs to change to keep up with these updates. We regularly add new features and teach AppMetrica to comply with the new policies. To ensure data is collected consistently and with no loss, make sure the AppMetrica SDK is kept up to date in your application. In today's post, we look exclusively at the latest news in this area.

What's new in the AppMetrica SDK

Android SDK 3.6.4

Application Not Responding (ANR) data collection for crash reports and increased stability

The June version added ANR data collection – after all, the number of crashes isn't the only indicator of app stability. Information about when an app doesn't respond still isn't available in the interface, but ANR data is collected on the server and made available within an hour. Update the SDK now so that AppMetrica will have enough audience coverage to make an analysis when the reports update.

AppMetrica also sends thread dumps along with crash reports to help find out what's happening with your app. They can be especially useful when dealing with insufficient memory errors — OutOfMemoryError.

See our documentation to learn how to update the library.

iOS SDK 3.7.1

Manual session management

The session is a key concept in user-app interactions. Audience loyalty and app effectiveness are determined by the number of sessions: the more conversions per session, the better.

Every app has its own understanding of what session is. For some, minimizing the app for 10 seconds means the session is over. For others, a single session may continue even after the user takes a 30-minute break.

In the new version of the iOS SDK, we made it possible to manually start and pause sessions. Also, every time an app is activated can now be considered the start of a new session. This gives you more flexibility to adjust how sessions are counted based on the nature of your app.

Decimal: accurate financial calculations in revenue events

In early versions of revenue events, we used the double data type to calculate money. However, double doesn't exactly know how to store fractions. For example, 0.3 can turn into 0.2999999, which creates a noticeable margin of error when making large-scale purchases.

Realizing this, we decided to switch from double to decimal. The decimal data type immediately converts data to decimal format, which is much better for financial calculations. This gives you much more accurate calculations. As usual, we strongly recommend updating the SDK.

To set up revenue event collection, see the documentation.

Overall improvements

Improved SDK stability and reduced data consumption:

  • Less data is required to send crash reports.
  • Accurate information about how long an app was running before a crash.
  • The reportReferraIUrl method was removed from the current list. It was previously required for referrer-based tracking, but this technology is no longer supported by iOS.

See our documentation to learn how to update the library.

New push features

If you haven't made any push updates in a long time, we're sure you'll find these features useful:

Android Push SDK 1.4.1 – image caching

Images from push notifications are now cached on the user's device. This means that if push notifications use the same image more than once (like a theme picture), that image gets downloaded from the phone's cache, saving internet traffic.

Caching parameters are set in the HTTP cache-control header received with the image. The cache is implemented with the OKHttp library, so now there's a corresponding dependency.

For more information, see the documentation.

iOS Push SDK 0.8.0 – lightweight push notification tracking in open apps

If your app accepts push notifications while actively in use, you also have to track when the notification is received and opened. You can use various implementations of the  UNUserNotificationCenterDelegate protocol to make this easier.

We made a separate class that you can use in your version of the delegate — we got rid of everything extra and left just the parameters for tracking push notifications.


Current plugins

The Xamarin and Unity plugins use the latest versions of the AppMetrica SDK. Don't forget to update those regularly, too! :)