Work in App Extensions

AppMetrica supports extensions and can share application identifiers with its extensions.

Setup

  1. Follow instruction and add App Group into your application and extension.

    Alert

    The App Group should be available only for application and its extension. Sharing App Group with another application can poison your data.

  2. Add the App group into Keychain Access Group according to the instruction.

  3. Edit applications Info.plist and add AMAApplicationGroupIdentifier key with App Group value (without Team ID). Extension Info.plist should be untouched. Extension gets App Group from application Info.plist.

Deep into AppMetrica

Application and extension store identifiers in their private file storage (private keychain) and shared file storage (shared keychain and vendor keychain).

Application and extensions try to read all storages and choose most preferred identifiers: application prefers private storages, extension prefers shared storages. If all storages are empty, new identifiers are generated. Then the identifiers are written to the remaining storages.

Migration from separated AppMetrica to App Group support

If AppMetrica has already been configured in the extensions, the new version will use the application's identifiers. This will cause the existing data to become invalid.

In some cases (for example, if the extension was launched before the application), anomalies in the analytical data are possible due to the loss of identifiers in the extensions and subsequent synchronization in the main application.

If you didn't find the answer you were looking for, you can use the feedback form to submit your question. Please describe the problem in as much detail as possible. Attach a screenshot if possible.

Написать в службу поддержки