# OneAgent for iOS - DTXAxtion returning nil

**URL:** <https://community.dynatrace.com/t/oneagent-for-ios-dtxaxtion-returning-nil/48250>\
**Category:** Real User Monitoring\
**Tags:** real-user-monitoring-classic, mobile-monitoring, ios\
**Created:** [October 10, 2024, 11:06am UTC](https://community.dynatrace.com/t/oneagent-for-ios-dtxaxtion-returning-nil/48250 "2024-10-10T11:06:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![OliverBrownNext](https://avatars.discourse-cdn.com/v4/letter/o/b5ac83/32.png) [@OliverBrownNext](https://community.dynatrace.com/u/OliverBrownNext)\
**Post date:** [October 10, 2024, 11:06am UTC](https://community.dynatrace.com/t/oneagent-for-ios-dtxaxtion-returning-nil/48250/1 "2024-10-10T11:06:49Z")

</div>

I’m adding OneAgent to a new iOS app. I’m trying to add custom actions but DTXAction.enter is _nearly_ always returning nil.

I found this post with a similar issue&nbsp;[https://community.dynatrace.com/t5/Real-User-Monitoring/OneAgent-SDK-for-iOS-DTXAction-enter-returns-nil/m-p/186775](https://community.dynatrace.com/post/186775)&nbsp;that seemed to be caused by the app not having access to the beacon URL. I don’t believe that is the cause.

As far as I can see the privacy options are set up to be permissive, and I can see the sessions in the session browser, albeit mostly without my custom action.

The bit that most confuses me is a few times I’ve seen the action isn’t nil, and I do see a few sessions with the events.

I tried getting the result of Dynatrace.lastErrorMsg() but it is always nil. Is there any other way of finding out what, if any, error is happening to cause this?

Thanks,  
Oliver

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [October 10, 2024, 12:11pm UTC](https://community.dynatrace.com/t/oneagent-for-ios-dtxaxtion-returning-nil/48250/2 "2024-10-10T12:11:10Z")

</div>

Can you turn on logging and share the app logs? See&nbsp;[OneAgent for iOS debug logging in RUM Classic — Dynatrace Docs](https://docs.dynatrace.com/docs/shortlink/ios-logging)

---

<div class="post-metadata">

**Author:** ![OliverBrownNext](https://avatars.discourse-cdn.com/v4/letter/o/b5ac83/32.png) [@OliverBrownNext](https://community.dynatrace.com/u/OliverBrownNext)\
**Post date:** [October 10, 2024, 1:27pm UTC](https://community.dynatrace.com/t/oneagent-for-ios-dtxaxtion-returning-nil/48250/3 "2024-10-10T13:27:12Z")

</div>

Thanks for your reply.

After going through a process of enabled the logs, changing the log level, adding my own logging, and getting inconsistent results in the process, I arrived at it seemingly working correctly. I’m 90% I didn’t actually change anything meaningful.

One thing I will share is I did get a log export for a time when it failed, and there did not seem to be anything from Dynatrace in it.

In the log below, there was a bunch of output from&nbsp;DTXAutoInstrument. Then one log from me right before attempting to create DTXAction followed immediately my log when the result was null. Then a bunch of output from DTXSwapper.

*️⃣ ALL ♻ Lifecycle [Agent-DTXAutoInstrument.m:16-259-main] viewDidAppear\_DTX: =\> calling receiver:\<0x1028e6600, \_TtGC7SwiftUI32NavigationStackHostingControllerVS\_7AnyView\_\> super\_class:UIViewController action:viewDidAppear:*️⃣ ALL ♻ Lifecycle [Agent-DTXAutoInstrument.m:16-259-main] otherViews\_BLOCK → exited hookedClass:UIViewController hookedSelectorName:viewDidAppear: viewLifecycle:3DTXAction Timer.Homepage.HomepageLoad.FullyLoadedDTXAction Timer.Homepage.HomepageLoad.FullyLoaded was nil:*️⃣ ALL 🎣 Hooks [Agent-DTXSwapper.m:16-259-main] demangling: \_TtC4NukeP33\_27F0B4BA90823100ED6CA18C21E1B9DD11\_DataLoader =\> Nuke.\_DataLoader​*️⃣ ALL 🎣 Hooks [Agent-DTXSwapper.m:16-259-main] generics name cleanup: Nuke.\_DataLoader =\> Nuke.\_DataLoader

---

<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:** [October 14, 2024, 5:44am UTC](https://community.dynatrace.com/t/oneagent-for-ios-dtxaxtion-returning-nil/48250/4 "2024-10-14T05:44:11Z")

</div>

It’s hard to diagnose the issue with just a fraction of the log. If you still have an issue please raise a support ticket and provide the full log when the issue happens.
