use 3g for internet when connected to adhoc wifi (using private API's)
Asked Answered
E

1

7

First and foremost, I am looking for a resource to use Private API's. this is an enterprise application and will never go to the app store I need to take as much configuration out of the users hands as possible.

That being said, I have a device that an ipad will be connected to and communicate with via an adhoc wifi network supplied by the device. the ipad connects to this device and sends raw data to it via socket connections. I also need to connect to the internet for data syncing.

80% of the time, the ipad will be connected to this adhoc wifi device. Management software on the ipad does not allow the user to adjust wifi settings so I am trying to make sure I am connected to my device without limiting my server syncing. I know I can determine the connection using apples Reachability class, this is not what i am looking for. I need to use BOTH 3g AND wifi.

Is there a way to enforce this in code? Or is there a resource for the private API's that I can look at to find a way?

This will be in iOS 5 and the most preferable method would be to just route my http requests via some private api method to use 3G and let the socket requests use wifi to the adhoc device.

code samples would be awesome, links / class names to research would be very much appreciated.

and once again this is not going into the app store, it is an enterprise app

Epilate answered 4/11, 2011 at 20:49 Comment(1)
thanks for the downvote... This is not meant for jailbroken devices, or malicious intent. as stated TWICE it is for an enterprise application in an already limited (by management software that also uses private API's) environment.Epilate
E
2

the resolution i found was to assign an ip in the privately assigned ip range the ipad uses (169.254.x.x) to the adhoc device then let the ipad determine an ip. Then see if i can open a socket connection to the device (to determine if its available) and then issue a print.

Going this route, i am still able to use 3g data as well as communicate with the device via wifi.

Epilate answered 21/11, 2011 at 16:17 Comment(4)
Hi, I have a similar requirement, but app needs to go to app store, did you need to use private API's to achieve this in the end? or could you create a standard unix socket on the correct device?Liquorice
the way i am connecting to my printer does not use private apis. it is a socket connection to a specific ip. as long as you can still get access to the internet through the 3g connection and have no access via the wifi connection, it seems to work. I have not had any issues since implementing it other than the few extra seconds the ipad takes to self assign an ip.Epilate
We are making an app with similar requirement, do you mean that the printer the iPad is connected to will always assign an IP in the range of 169.254.x.x, which is what allows the iPad to using both 3G & wifi? Thanks for your clarifications!Nutritionist
the printers i am using will have an ip assigned to them. in my case it is in the same subdomain the ipad self assigns. so if your ipad self assigns another range, you should use that. but chances are, it will be the 169.254.x.x range. if you can get around it, it is better to use a bluetooth printer for this scenario, we were just unable to do so.Epilate

© 2022 - 2024 — McMap. All rights reserved.