Skip to main content
Devarai
Known Participant
Dec 1, 2011 11:43 AM UTC
Question

$40USD for userAgent string on Air for iOS

Hello,

I pay $40USD to someone who creates a native iOS extension for AIR mobile that gives me the device user agent string. (source code XCode 4.1 project + ANE file).

Thanks,

Henning

This topic is closed to new replies. Start a new post to keep the conversation going.

7 replies

Participant
Dec 19, 2014 2:23 PM UTC

var link:URLRequest = new URLRequest("http://www.adobe.com");

trace("USER AGENT IS ---- " + link.userAgent);

Translate
Dec 1, 2011 12:37 PM UTC

What are you looking for ? Is it the device (iPod, iPad, iPhone) your app is running on or something else ?

Translate
Devarai
DevaraiAuthor
Known Participant
Dec 1, 2011 12:46 PM UTC

The user agent is something like this: Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1C9 Safari/419.3

Translate
Dec 1, 2011 2:00 PM UTC

I dont think you need a Native Extension to do that.

Just load an html page in StageWebView, querry navigator.userAgent in javascript.

Since there is no way for direct communication between AS-JS, you can change the location of document through document.location and append Navigator.userAgent in the new url location.

To get it in AS, listen for LocationChanging event. In its handler, preventdefault it, and read the event.location property to get the userAgent string in AS.

this might help : http://sean.voisen.org/blog/2010/10/making-the-most-of-stagewebview/

Thanks,

Meet

Translate