0

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.

1HaKr
  • 1,098
  • 1
  • 11
  • 18
  • If I'm understanding your question correctly, you're wanting to write an app for Nearby Share on iOS, and you want to know how an Android device would receive files from your app. There is a Google support article on how to set up Nearby Share on Android: https://support.google.com/android/answer/9286773 It doesn't mention iOS specifically, but I would assume that the steps would still be the same, at least on the Android side. – JBYoshi Sep 02 '23 at 03:52
  • No, my question is what specific Nearby Connections API should I use to send to the android device directly? I know what to use when sending to my own app on another device, as explained in Nearby Connections API docs, but there are no details on sending it directly to an android device without an app. – 1HaKr Sep 02 '23 at 13:46

1 Answers1

0

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.

JBYoshi
  • 258
  • 2
  • 6