how to transfer files via iPhone personal hotspot between devices? - ios

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.

Related

Not able to connect to apple tv !! "Making apple tv ready for development" dialog shown

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.

Connect iOS App to Bluetooth device not BLE

I want to connect bluetooth device to my iOS app. That device perfectly works in android as it first paired via bluetooth (from outside the app) and send/recive command from inside the app. But that device is not getting in my list when I am turning on it in iPhone setting.
After a research I come to know that Corebluetooth can connect only with BLE. Now How many possible way to connect my app with that device. Please help me with this.
Is there any app on App Store from where I can scan that device ? It
wii be also helpful for me.
I also come to know about apple MFI program, but how will work ? Is it
paid ?
Thanks.

multipeer connectivity test on iphone and a simulator simultaneously

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.

Using iPhone USB tethering connection from app

My app needs to transfer data to and from a PC/Mac, but without using Wireless or 3G.
Is it possible to use the USB cable to run a server on the device accessible by the PC/Mac?
Accessing the app's documents-directory over USB from a program would work too.
What would be the best way? I need a solution, that will work on normal device, no jailbreak allowed. If it works without special drivers on the PC/Mac, that's a bonus too.
You should enable UIFileShareEnabled. More information is available here:
iTunes Documents Directory in my app

Is Wi-Fi Direct connection possible within iOS devices and among Wi-Fi Direct enabled devices?

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.

Resources