I am currently using GCDAsyncUdpSocket to build a app that can communicate with UDP protocol.
I am testing whether the connection work with this iPhone app "UDP_Test" >> App link
When I send msg from my iOS simulator, the message does appear received on my iPhone "UDP_Test" app. However, when I download my project to the other iPhone and setup the connection with the iPhone that has "UDP_Test" app, the communication does not work.
Then I tried using "UDP_Test" for the two iPhone to communicate, it does not work as well. Same goes to iPad and iPhone. Is there a restriction for both iOS device to communicate with UDP?
Thanks.
I have found a way. We have to go to Network setting and choose your network. Then go to "HTTP Proxy" and choose "Manual" then enter the port that your device going to listen to, then it works.
Your two devices needed to be on the same subnet of the WiFi network.
Related
I'm trying to connect apple tv with my xcode to debug my app. But I'm getting below dialog and it will never go. So I tried following steps to fix but no use.
Waited for 10 mins and checked but still the same.
I restarted/reset apple tv and checked but no use.
Tried with different versions of xcode but no use.
Tried using wifi, mobile hotspot with different networks.
Some times I will get this dialog and it will never go.
If I try to run app in this state then I will get this alert in xcode
So I'm not understanding the why its behaving like this. And how to fix this issue ?
Wireless Debugging on Apple TV
Dive has some great recommendations about using Apple TV with your machine, connected via Ethernet. So far this is also my preferred way to connect, develop and deploy to Apple TV, however debugging on Wifi isn't the best experience.
Here are a few things you could try.
Remove current pairing by using Device and Simulator window.
Try downloading Apple Configurator 2 and use that to first pair your Apple TV to your machine. This is great tool to ensure you can connect to your iOS/tvOS devices for some super user type setup. ( Main Menu -> Paired Devices)
For this to work you have to be on a specific screen on your Apple TV.
Settings -> Remote and Devices -> Remote App and Devices ( This uses multipeer connectivity)
If you are successful pairing your TV using apple configurator then it's a good sign as you can rule our networking issues with your Wifi.
Try pairing with Xcode after it's paired with your machine in the step above. The dialog window you see above is expected and takes some time ( longer in some cases) but should eventually complete.
If step 3 wasn't a success, unpair from Xcode and Apple Configurator ( if they show as connected but not aren't really paired), restart your machine and Apple TV and start the same steps again.
Lan Set up :
You can connect to your Apple TV via a switch or usually Modem/Routers have inbuilt switch ( extra ethernet ports).
Try the same steps and you should be able to pair with Xcode.
Troubleshooting: Try using Console app on your machine if you still can not figure out the root cause and this should help you debug the pairing issue.
There is a helpful instruction from Apple - Pair a wireless device with Xcode (iOS, tvOS) and I assume that you did as they recommend.
Such issues usually appear due to the following reasons:
Something is wrong with your network configuration. The easiest way to check is to try to wirelessly connect your iPhone to be sure that you do not have the same problem. If this is the case then try to white-list the IP address for the Apple TV on your router and open necessary ports;
About port, Apple recommends the following configuration: Communication to network devices uses port 62078. Some networks block specific ports. You may need to check your network settings or ask your system administrator to open this port;
Your Xcode version has to be in sync with tvOS. From the screenshots, I see that you have tvOS 13.3.1. It means that it is better to use Xcode 11.3.1 in this configuration. But you mentioned that you already tried this.
The option that always works to me is to use an Ethernet connection. I connect my AppleTV via the ethernet cable to my router and access it from my MacBook without problems:
Connect the device to the same network using an Ethernet cable.
For an Apple TV, connect using the Ethernet port in the back of the device.
Is it possible to transfer files via iPhone hotspot i.e, iphone connected to a cellular network creates a wi-fi hotspot and one of the device is connected to that wi-fi and data transfer between these two devices over hotspot?
The iPhone has an app listening to some port or some medium through which the other device can send files to that iPhone app and record/save the files sent from the other device.
Any links or any information would be good if anyone of you can provide.
Thanks.
So this finally worked pretty easily using Apple's Multipeer Connectivity Framework.
Thanks to AppCoda's tutorial, here is the link:
http://www.appcoda.com/intro-ios-multipeer-connectivity-programming/
This tutorial doesn't talk about Hotspot usage, but I figured out a way to use the same to transfer files using personal hotspot on iPhone.
Steps to reproduce:
Install the final product of the AppCoda's on two devices. (This
might not work on Simulator for hotspot check, since no bluetooth via simulator)
Create hotspot on iPhone and connect the other device through the wi-fi created from iPhone.
Switch off bluetooth in one device and proceed with the app, browse for other device to connect.
Try to transfer files from one device to another through the hotspot connection.
Guess what? It worked for me. :) Go ahead. Try it out.
I'm developing an application for iOS which is connecting through TCP sockets to a server aplication run on Android. In order to find the IP of the 2nd device I use a UDP request and receive the IP of the server.
It's working well all the time when I'm connecting them to Wi-Fi network or when I use the Android device as a hotspot to the iPhone. But if I want to make the iOS device a personal hotspot, I can't reach connection between the two devices and the app is useless in this regime. Is it possible to connect the devices then and is the algorithm the problem? I would be glad to hear if someone has ever had a similar problem and knows the solution.
Hello I was searching in all topics of the forum about how can i test an app which uses multipeer connectivity framework. Can someone tell me how can i test an app by using an iPhone device and a simulator simultaneously, player one for device and player two on the simulator and vice versa. I already test the app by using two simulators one per mac - user on a mac and its working but it is not convenient to continuously switch users to test an app.
I tried all the alternatives, running once in simulator and one on device at the same time,make second target, nothing happened.
Thanks in advance
If you put your iPhone and your Mac on the same WiFi network they should able to discover each other without any problem.
Yes you can test your app on Device an Simulator simultaneously.
I'm developing an app with Multipeer Connectivity right now and communication between
Iphone and Simulator works fine.
I'm running it on a MacBook Air.
All you have to do is to make sure, that Bluetooth is enabled on your Mac.
You can do this in System Preferences -> Bluetooth.
In addition to testing on WiFi, you can also test your app based on "Multipeer Connectivity framework" on simulator and any IOS device using Bluetooth, As long as simulator and devices are connected in same Personal area network.
For example, on Iphone you can turn on Personal Hotspot (in your phone General settings) to connect your phone with your mac in same personal area network via bluetooth or WiFi and then try testing your app sharing messages between simulator and Iphone using any personal network based on Bluetooth or WiFi.
All the combination will work as long as app using "Mutlipeer connectivity framework" are on same personal area network.
Is Wi-Fi Direct connection possible within iOS devices and among Wi-Fi Direct enabled devices?
The objective is to enable communication between an iOS device and another device (not necessarily another iOS device. It could be Android, Mac, PC) without the presence of any controllers. (WAPs).
iOS devices can connect to an ad-hoc network, and if they do so they will have full wireless network capabilities. The limitation is with creating an ad-hoc network from the device itself, which is not allowed/not possible.
An alternative would be to use the GameKit/Game Center API which uses Bluetooth to create a network between iOS devices. This would obviously include the more limited range of Bluetooth vs Wifi, as well as the constraints of Apple's SDK.
More information on Game Center in iOS 6 is available here: http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/GameKit_Guide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40008304
I have been looking into this recently and from my research,(please see "Device to device communication with WiFi Direct: Overview and experimentation" by Daniel Camps-Mur,....) the WiFi Direct does NOT create ad-hoc network. It's actually creating a WiFi infrastructure network where one party takes the role of AP (soft-AP). Once this established, the network works much like a normal WiFi network. Do we agree on this?
Given this is the fact, Apple iPhone should be able to connect to WiFi Direct device that is already set up as AP. I haven't check this though.
Having said this, How can you get an Android phone like Samsung Galaxy S3 or S4 to act as AP? there is nothing in the settings as far as I know. If you connect two such devices, one of them will take the role of AP. Now, iPhone will detect the established network, but when trying to connect to that, will be asked for WPA password. Good luck finding it! Cus you can't get it from the phone. I read somewhere that a file in Samsung Galaxy called WPA_Suppliciant.conf has the WPA key in it but I didn't see it there.
I believe if you could find WPA password, you can get the iPhone to easily connect.
iOS devices do not support Wi-Fi Direct functionality, they do not have WFD (Wi-Fi Direct) group creation or role negotiation (P2P Group Owner or Group Client) support.
During a normal WFD connection one of the 2 devices takes role of Group Owner (Soft-AP) allowing other device to connect as a Group Client.
iOS has support for tethering which is normally know as Personal Hotspot option in Settings. It can be used for communication between iOS and non-iOS devices. For example,
Application ShareIt uses similar way to connect iOS to non-iOS devices by creating a temporary Hotspot and in the non-iOS device and promts iOS user to go to Wi-Fi screen and connect manually. This is normally recommended when a common Wi-Fi network is not present.