Page 1 of 2

iTunes file sharing issue

Posted: 07 Mar 2017, 03:22
by hsyhai
According to the documentation in README.ios - iTunes file sharing should be available on the MrMC app on the AppStore.
In that case (MrMC will be sandboxed like any other app) - all MrMC files are then located in the sandboxed "Documents" folder and can be easily accessed via iTunes file sharing.
However when I plug my phone into iTunes - I don't see an iTunes file share folder for MrMC. Is this a known issue, am I missing something? I would love to be able to use MrMC offline when I'm traveling...

EDIT: It seems that this pull request doesn't exist in the MrMC codebase- Adaptions for developing for XBMC on non-jailbroken devices

Thank you

Re: iTunes file sharing issue

Posted: 08 Mar 2017, 14:57
by hsyhai
If I create a pull request with this implemented is there a chance it would be merged? Or is there a reason this hasn't been implemented yet?


Sent from my iPhone using Tapatalk

Re: iTunes file sharing issue

Posted: 08 Mar 2017, 15:14
by amet
we can try, it has been put on backburner as initially apple was asking for more changes while in review... this was in version 1.x if I remember correctly

Re: iTunes file sharing issue

Posted: 08 Mar 2017, 16:13
by davilla
PR please :) At the time we tried it, we were under pressure to get the release out so we just took out the hammer.

Re: iTunes file sharing issue

Posted: 08 Mar 2017, 16:15
by hsyhai
Alright I'll take a crack at it...


Sent from my iPhone using Tapatalk

Re: iTunes file sharing issue

Posted: 10 Mar 2017, 20:04
by hsyhai
I am having trouble getting it to build using xcode - however reading the code it seems that all that is necessary is adding

Code: Select all

<key>UIFileSharingEnabled</key><string>YES</string>
to mrmc/xbmc/platform/darwin/ios/Info.plist.in, because you can already access the internal filesystem using the special:// url.

Can you try it - I would try it myself but I can't seem to get xcode to build MrMC (even using a clean repo and following the directions in README.ios)?

Thanks!

Re: iTunes file sharing issue

Posted: 14 Mar 2017, 03:38
by hsyhai
Ok so adding <key>UIFileSharingEnabled</key><string>YES</string> enables it - and you can access the files via special://home/../ - Although there are a couple things:
  • I don't think Apple allows file sharing when the app files themselves can be accessed via iTunes. We have to figure out how to hide the app folder.
  • The url is a hack - we have to add another URL to access these files.
  • Probably should add an option in the sources UI - for Local....

Re: iTunes file sharing issue

Posted: 14 Mar 2017, 04:32
by davilla
in CDarwinStorageProvider::GetLocalDrives

Add;

#if defined(TARGET_DARWIN_IOS) && !defined(TARGET_DARWIN_TVOS)
share.strPath = CDarwinUtils::GetOSAppRootFolder();
share.strName = "iTunes Sharing";
share.m_ignore = true;
localDrives.push_back(share);
#endif

GetOSAppRootFolder returns the path to NSDocumentDirectory.

This will then show up in source/browse. As Documents is not available under tvOS, the compiler define only allows it for pure iOS. TARGET_DARWIN_TVOS includes TARGET_DARWIN_IOS as it is based off iOS so you have to exclude it if you only want pure iOS.

Hiding the App files from iTunes is more difficult as we can only place them at that location on the iOS device. See CDarwinUtils::GetUserHomeDirectory, this sets where special://home points.

Re: iTunes file sharing issue

Posted: 14 Mar 2017, 04:36
by davilla
And before you ask :)

#if defined(TARGET_DARWIN_IOS) && defined(__x86_64__)

is a special setup for internal development.

Re: iTunes file sharing issue

Posted: 14 Mar 2017, 16:26
by Everbrave
As I have been redirected to this post :)
You suggest to modify CDarwinSorageProvider and rebuild for iOS?
Where to find CDarwinSorageProvider and what are the steps for the iOS only build?

EDIT:
How this build would be different from the Kodi iOS build?
In kodi iOS, there exists a home folder with a document that folder in it but no media can be found there (just checked)!

Thanks