OneAgent for iOS - DTXAxtion returning nil

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 https://community.dynatrace.com/t5/Real-User-Monitoring/OneAgent-SDK-for-iOS-DTXAction-enter-returns-nil/m-p/186775 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

Can you turn on logging and share the app logs? See OneAgent for iOS debug logging in RUM Classic — Dynatrace Docs

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 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.

:asterisk: ALL :recycling_symbol: Lifecycle [Agent-DTXAutoInstrument.m:16-259-main] viewDidAppear_DTX: => calling receiver:<0x1028e6600, _TtGC7SwiftUI32NavigationStackHostingControllerVS_7AnyView_> super_class:UIViewController action:viewDidAppear::asterisk: ALL :recycling_symbol: 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::asterisk: ALL :fishing_pole: Hooks [Agent-DTXSwapper.m:16-259-main] demangling: _TtC4NukeP33_27F0B4BA90823100ED6CA18C21E1B9DD11_DataLoader => Nuke._DataLoader​:asterisk: ALL :fishing_pole: Hooks [Agent-DTXSwapper.m:16-259-main] generics name cleanup: Nuke._DataLoader => Nuke._DataLoader

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.