How to transfer files from iOS app to Android Nearby Share without an app Android?

618 Views Asked by At

I want to build a File sharing app for iOS, which I can use to share files to Android devices through nearby connections API. I can see that it can be done through windows nearby share and chrome OS nearby share, but I cant find anything in the documentation. Any help will be highly appreciated.

1

There are 1 best solutions below

2
JBYoshi On

The "Exchange data" page on the Nearby Connections documentation lists three methods you can look at:

  • send(_:to:)
  • startStream(_:to:)
  • sendResource(at:withName:to:)

From the source code, it looks like send takes a Data object, startStream takes an InputStream, and sendResource takes a URL and a filename. On Apple platforms, files are usually represented by their URLs, so sendResource is probably what you want.

The Android version of the documentation goes into more details on the different types of data you can send, and some of that information applies to iOS as well.