Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
New Contributor
pescamillam
Posts: 4
Registered: ‎11-08-2012
My Device: Playbook
My Carrier: NONE
Accepted Solution

How to get ip from playbook via HTML5

Hi, I'm trying to add some ads from mmedia to my playbook app, but I need to get the ip adress from the playbook in order to achieve it does somebody know how can I do that? I've looked though the APIs and haven't been able to get a way to do it, thanks.

Please use plain text.
Developer
interfaSys
Posts: 817
Registered: ‎11-19-2009
My Device: Z10, Q10, 9900, 9790, PlayBook,
My Carrier: T-Mobile UK, Three, O2, Orange, Sunrise, Swisscom

Re: How to get ip from playbook via HTML5

Simply get the IP via an external service.

 

Call this URL:

http://jsonip.appspot.com/?callback=getip

 

The returned object will contain the client's IP

 

Solution provided by

http://stackoverflow.com/questions/102605/can-i-lookup-the-ip-address-of-a-hostname-from-javascript

 

 

--
Olivier - interfaSys ltd
Developing for BlackBerry 10 devices using the Sencha Touch framework.
Please use plain text.
New Contributor
pescamillam
Posts: 4
Registered: ‎11-08-2012
My Device: Playbook
My Carrier: NONE

Re: How to get ip from playbook via HTML5

Thank you interfaSys it worked thou http://jsonip.appspot.com/?callback=getip usually returns over quota messages

Please use plain text.
Developer
interfaSys
Posts: 817
Registered: ‎11-19-2009
My Device: Z10, Q10, 9900, 9790, PlayBook,
My Carrier: T-Mobile UK, Three, O2, Orange, Sunrise, Swisscom

Re: How to get ip from playbook via HTML5

I agree that it's not ideal to depend on a 3rd party, so you should maybe set up your own script, either on a commercial cloud or within your own hosting.
--
Olivier - interfaSys ltd
Developing for BlackBerry 10 devices using the Sencha Touch framework.
Please use plain text.