Resources Bridge is a tool for sending and requesting files from Mac on iOS devices.
Read and write your Mac’s files in a sync manner like they are on your iPhone.
⚠️ Currently this project is in early alfa stage and it’s a subject for improvements.
First of all you need to launch the Monitor app on your Mac. It is used to receive and send files from iOS devices and handle all local file management.
After the Monitor app is launched, you may call one of the following functions on iPhone or iPad:
Init Bridge
let bridge = try ResourcesBridge()
Start session and try to connect to Monitor automatically
progressHandler: read / write functions are designed to be synchronous, but you may pass a progress handler that will report progress on other dispatch queue for debug purposes.
remotePath is an absolute path to the file on Mac.
In order for Resources Bridge to work when running on iOS 14, you will have to include two keys in your app’s Info.plist file.
The keys are Privacy - Local Network Usage Description (NSLocalNetworkUsageDescription) and Bonjour services (NSBonjourServices).
For the privacy key, include a human-readable description of what benefit the user gets by allowing your app to access devices on the local network.
The Bonjour services key is an array of service types that your app will browse for. For Resources Bridge, he value of this key should be _ResourcesBridge._tcp.
If you do not configure the above keys properly, then Resources Bridge won’t work.
Dependencies
This project is based on Bonjour framework. You can use it for async communication and files transferring between 🍏 devices.
Resources Bridge
Resources Bridge
is a tool for sending and requesting files from Mac on iOS devices. Read and write your Mac’s files in a sync manner like they are on your iPhone.⚠️ Currently this project is in early alfa stage and it’s a subject for improvements.
Requirements
5.2
11.0
10.13
Install via SwiftPM
How To Use
First of all you need to launch the
Monitor
app on your Mac. It is used to receive and send files from iOS devices and handle all local file management.After the
Monitor
app is launched, you may call one of the following functions on iPhone or iPad:Init Bridge
Start session and try to connect to
Monitor
automaticallyAbort connection and stop session
Wait for connection synchronously
Write resource on Mac
progressHandler
:read
/write
functions are designed to be synchronous, but you may pass a progress handler that will report progress on other dispatch queue for debug purposes.remotePath
is an absolute path to the file on Mac.Read resource from Mac
The logic is similar to the
write
func.Info.plist configuration
In order for
Resources Bridge
to work when running on iOS 14, you will have to include two keys in your app’s Info.plist file. The keys arePrivacy - Local Network Usage Description
(NSLocalNetworkUsageDescription
) andBonjour services
(NSBonjourServices
). For the privacy key, include a human-readable description of what benefit the user gets by allowing your app to access devices on the local network. The Bonjour services key is an array of service types that your app will browse for. ForResources Bridge
, he value of this key should be_ResourcesBridge._tcp
.If you do not configure the above keys properly, then
Resources Bridge
won’t work.Dependencies
This project is based on
Bonjour
framework. You can use it for async communication and files transferring between 🍏 devices.License
MIT