# Not working Dynatrace features for iOS app

**URL:** <https://community.dynatrace.com/t/not-working-dynatrace-features-for-ios-app/47486>\
**Category:** Real User Monitoring\
**Tags:** mobile-monitoring\
**Created:** [September 4, 2024, 7:22pm UTC](https://community.dynatrace.com/t/not-working-dynatrace-features-for-ios-app/47486 "2024-09-04T19:22:34Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![volivan](https://avatars.discourse-cdn.com/v4/letter/v/3ab097/32.png) [@volivan](https://community.dynatrace.com/u/volivan)\
**Post date:** [September 4, 2024, 7:22pm UTC](https://community.dynatrace.com/t/not-working-dynatrace-features-for-ios-app/47486/1 "2024-09-04T19:22:34Z")

</div>

I have difficulties finding any info on addressing issues while integrating Dynatrace into an iOS app. So far, after completing the setup wizard I see users & sessions on Dynatrace dashboard but still no records of web requests, crashes and custom actions.

I have some questions to start with:

- since the app is already in production and traffic control is set to, let’s say, 10%, how to force a local app run to log the data to Dynatrace? Setting the traffic control to 100% isn’t favorable because there are a lot of end users using the app

- currently the console logs contain many warnings of this type:

objc[96868]: Class ObjC is implemented in both …/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.5.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/VFX.framework/Frameworks/libVFXCore.dylib (0x20ec8e438) and …/DynatraceSessionReplay.framework/DynatraceSessionReplay (0x106ed4b20). One of the two will be used. Which one is undefined.

so, interesting if it actually breaks any functionality of Dynatrace?

- any tips how to figure out missing logs of web requests and custom actions?

---

<div class="post-metadata">

**Author:** ![Patrick\_H](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/patrick_h/32/37540_2.png) [@Patrick\_H](https://community.dynatrace.com/u/Patrick_H)\
**Post date:** [September 5, 2024, 6:08am UTC](https://community.dynatrace.com/t/not-working-dynatrace-features-for-ios-app/47486/2 "2024-09-05T06:08:13Z")

</div>

If privacy opt-in is enabled, but no level was set, the agent is in a restricted mode and only sends anonymous data and no data that could contain any PII like user actions:

> **[OneAgent SDK for iOS in RUM Classic](https://docs.dynatrace.com/docs/observe/digital-experience/rum-classic/mobile-applications/instrument-ios-app/customization/oneagent-sdk-for-ios)**
>
> Enrich mobile user experience monitoring using OneAgent SDK for iOS.

same goes for crashes, they also need to be enabled than - there is a snipped in the wizard that shows an example fo both.  
regarding traffic controll, it is advices to have a different environment set up for development to be able to experiment.  
the console log does not have any impact - we are aware of it and it will be fixed in the future, but not short term as it requires some design changes.

---

<div class="post-metadata">

**Author:** ![volivan](https://avatars.discourse-cdn.com/v4/letter/v/3ab097/32.png) [@volivan](https://community.dynatrace.com/u/volivan)\
**Post date:** [September 6, 2024, 1:21am UTC](https://community.dynatrace.com/t/not-working-dynatrace-features-for-ios-app/47486/3 "2024-09-06T01:21:10Z")

</div>

Thank you for the answers.

I noticed that when initializing Dynatrace.userPrivacyOptions the callback isn’t called and the settings aren’t applied afterwards. Here’s the code:

let privacyConfig = Dynatrace.userPrivacyOptions()  
privacyConfig.dataCollectionLevel = .userBehavior  
privacyConfig.crashReportingOptedIn = true  
privacyConfig.crashReplayOptedIn = true  
Dynatrace.applyUserPrivacyOptions(privacyConfig) { (successful) in  
assert(successful) // ← this point isn’t reachable in result  
ConsoleLog(“Privacy settings: dataCollectionLevel=\(Dynatrace.userPrivacyOptions().dataCollectionLevel), crashReportingOptedIn=\(Dynatrace.userPrivacyOptions().crashReportingOptedIn), crashReplayOptedIn=\(Dynatrace.userPrivacyOptions().crashReplayOptedIn)”)  
}  
Dynatrace.startupWithInfoPlistSettings()

ConsoleLog(“Privacy settings: dataCollectionLevel=\(Dynatrace.userPrivacyOptions().dataCollectionLevel), crashReportingOptedIn=\(Dynatrace.userPrivacyOptions().crashReportingOptedIn), crashReplayOptedIn=\(Dynatrace.userPrivacyOptions().crashReplayOptedIn)”)

// The log is: Privacy settings: dataCollectionLevel=DTX\_DataCollectionLevel(rawValue: 0), crashReportingOptedIn=false, crashReplayOptedIn=false

---

<div class="post-metadata">

**Author:** ![volivan](https://avatars.discourse-cdn.com/v4/letter/v/3ab097/32.png) [@volivan](https://community.dynatrace.com/u/volivan)\
**Post date:** [September 6, 2024, 1:22am UTC](https://community.dynatrace.com/t/not-working-dynatrace-features-for-ios-app/47486/4 "2024-09-06T01:22:35Z")

</div>

And regarding different environments - how to configure Dynatrace to differentiate dev. and prod. environments? In the app we do have dev. and prod. configs already

---

<div class="post-metadata">

**Author:** ![Patrick\_H](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/patrick_h/32/37540_2.png) [@Patrick\_H](https://community.dynatrace.com/u/Patrick_H)\
**Post date:** [September 6, 2024, 6:57am UTC](https://community.dynatrace.com/t/not-working-dynatrace-features-for-ios-app/47486/5 "2024-09-06T06:57:53Z")

</div>

As you use&nbsp;Dynatrace.startupWithInfoPlistSettings() I assume you [disabled automatic agent start](https://docs.dynatrace.com/docs/shortlink/ios-oneagent-sdk#start-oneagent). You should start the agent before you applies the privacy settings, then it should work.

---

<div class="post-metadata">

**Author:** ![Patrick\_H](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/patrick_h/32/37540_2.png) [@Patrick\_H](https://community.dynatrace.com/u/Patrick_H)\
**Post date:** [September 6, 2024, 7:11am UTC](https://community.dynatrace.com/t/not-working-dynatrace-features-for-ios-app/47486/6 "2024-09-06T07:11:54Z")

</div>

As you already used manual startup&nbsp;Dynatrace.startupWithInfoPlistSettings() you could switch to Dynatrace.startup(withConfig: startupDictionary)&nbsp;and provide the dev/prod environment config on app start depending on which mode the app is in. See&nbsp;[OneAgent SDK for iOS in RUM Classic — Dynatrace Docs](https://docs.dynatrace.com/docs/shortlink/ios-oneagent-sdk#start-oneagent-config-dict)

Please be aware that it is not intended to use the Dynatrace.shutdown() API to switch configurations as this will be deprecated. (There will be a better solution to switch environments, but this is

---

<div class="post-metadata">

**Author:** ![volivan](https://avatars.discourse-cdn.com/v4/letter/v/3ab097/32.png) [@volivan](https://community.dynatrace.com/u/volivan)\
**Post date:** [September 6, 2024, 5:15pm UTC](https://community.dynatrace.com/t/not-working-dynatrace-features-for-ios-app/47486/7 "2024-09-06T17:15:37Z")

</div>

Thanks, it works well after I moved “Dynatrace.startupWithInfoPlistSettings()” up.

---

<div class="post-metadata">

**Author:** ![volivan](https://avatars.discourse-cdn.com/v4/letter/v/3ab097/32.png) [@volivan](https://community.dynatrace.com/u/volivan)\
**Post date:** [September 6, 2024, 5:18pm UTC](https://community.dynatrace.com/t/not-working-dynatrace-features-for-ios-app/47486/8 "2024-09-06T17:18:32Z")

</div>

Still I’m confused which attribute determines if the environment is dev. or prod. Or do different environments on Dynatrace side are represented by different app entities (DTXApplicationID)?

---

<div class="post-metadata">

**Author:** ![Patrick\_H](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/patrick_h/32/37540_2.png) [@Patrick\_H](https://community.dynatrace.com/u/Patrick_H)\
**Post date:** [September 9, 2024, 6:21am UTC](https://community.dynatrace.com/t/not-working-dynatrace-features-for-ios-app/47486/9 "2024-09-09T06:21:09Z")

</div>

Yes, the applicationID determines which Mobile App entity on Dynatrace side the captured data is reported to.

---

<div class="post-metadata">

**Author:** ![volivan](https://avatars.discourse-cdn.com/v4/letter/v/3ab097/32.png) [@volivan](https://community.dynatrace.com/u/volivan)\
**Post date:** [September 10, 2024, 7:39pm UTC](https://community.dynatrace.com/t/not-working-dynatrace-features-for-ios-app/47486/10 "2024-09-10T19:39:36Z")

</div>

Thank you. Multiple environments work well now. One question regarding crashes - if the traffic control is set to 10%, than only 10% of crashes are recorded as well or all 100% not depending on the traffic control settings?

---

<div class="post-metadata">

**Author:** ![Patrick\_H](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/patrick_h/32/37540_2.png) [@Patrick\_H](https://community.dynatrace.com/u/Patrick_H)\
**Post date:** [September 11, 2024, 6:05am UTC](https://community.dynatrace.com/t/not-working-dynatrace-features-for-ios-app/47486/11 "2024-09-11T06:05:49Z")

</div>

as traffic controls disables capturing on per-session base this also includes crashes - otherwise this would skew the crash free users metric

---

<div class="post-metadata">

**Author:** ![volivan](https://avatars.discourse-cdn.com/v4/letter/v/3ab097/32.png) [@volivan](https://community.dynatrace.com/u/volivan)\
**Post date:** [September 11, 2024, 1:28pm UTC](https://community.dynatrace.com/t/not-working-dynatrace-features-for-ios-app/47486/12 "2024-09-11T13:28:14Z")

</div>

Thank you for all your answers. So far all the issues have been resolved
