Detect Device and Redirect

I am trying to detect the device and redirect if the user-agent contains iPhone

<body is="dmx-app" dmx-on:load="Browser1.userAgent.contains(\'iPhone\') ? Browser1.goto('https://myurl.com/denied/'+query.key+'') : false">

I have tried a Flow but that doesnt seem to work either.
Any help would be appreciated

Community Page
Last updated: