We are trying to transfer a file either iOS <-> Android or iOS <-> iOS
The implemented logic works fine in Android but we have an issue in iOS
Keep in mind that we are testing on, iOS 7, alljoyn 3.4.6 and latest file transfer component module cloned from repository
Receiver Setup
Create bus attachment that allows communication between devices
Register the bus object
Request the bus attachment to connect
Bind the session to the default transports (all transports except wfd and bluetooth)
onSessionLost
notify user for the error
onSessionJoined
cancelAdvertiseName
initialize the fileTransferComponent
with bus attachment and session id. define the default save directory of fileTransferComponent setFileCompletedListener
and setFileAnnouncementReceivedListener
After bind request and advertise name.
When necessary call the function busAttachment.enableConcurrentCallbacks()
Issue on Receiver Side
fileTransferComponent.requestOffer(joiner, filePath)
returns status ok
UnannouncedFileRequestListener
on sender is engaged and returns true
FileAnnouncementReceivedListener
callback should have been called but is NOT engaged, so we cannot proceed
Why are we getting this issue in iOS only?
In case the library itself is the culprit as we suspect what needs to be fixed inside iOS library in order to make it work?
FYI, long story short, this is how it goes:
Sender: send via doRequestOffer the file that wants to get sent into receiver
Receiver: execute requestOffer to ask for file to offered
Sender: filepath is the same as expected? Yes
(so sender actually announces the file, this is handled via library)
Receiver: inside FileAnnouncementReceivedListener we received the new announcement
Now receiver has file id etc and he executes requestFile
Sender: you requested a file and have RequestDataReceivedListener to respond, sending the file has already started
Receiver: know the file has been received completely by FileCompletedListener
Sender: counted the bytes sent and know that the file is sent, but I will ask receiver for a verification via the proxy call