Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

get IP address of IOS device using AirforIOS

Participant ,
Feb 15, 2017 Feb 15, 2017

Dear friends,

Greetings! iam using the following code to find IP address using AS3. It works in desktop, but not showing output details in IOS device. Please advise me how can I make it work in in IOS device.

import flash.net.NetConnection;
import flash.net.NetworkInterface;
import flash.net.*;

var netInterfaces: Vector.< NetworkInterface > = NetworkInfo.networkInfo.findInterfaces();
if (netInterfaces && netInterfaces.length > 0) {
for each(var i: NetworkInterface in netInterfaces) {
  if (i.active) {
   var addresses: Vector.< InterfaceAddress > = i.addresses;
   for each(var j: InterfaceAddress in addresses) {
    trace("- Host : " + j.address);
    txt.appendText(j.address+'\n');
   }
  }
}
}

Thanks in Advance,

Regards,

Syed Abdul Rahim

TOPICS
ActionScript
491
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Feb 15, 2017 Feb 15, 2017

AS3 Networkinfo class works on desktop and Air TV. You'll need a native extension for IOS. Details here: NetworkInfo native extension sample | Adobe Developer Connection

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 16, 2017 Feb 16, 2017
LATEST

i think as3 has all the classes you need:

function ipF():String{    

var ni:Vector. = NetworkInfo.networkInfo.findInterfaces();

var addresses:Vector. = ni[1].addresses;

return addresses[0].address;

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines