Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Cross-Platform-Entwicklung (https://www.delphipraxis.net/91-cross-platform-entwicklung/)
-   -   iOS: OpenDialog für iCloud? (https://www.delphipraxis.net/206935-ios-opendialog-fuer-icloud.html)

philipp.hofmann 10. Feb 2021 12:27

iOS: OpenDialog für iCloud?
 
Hallo allerseits,

bisher habe ich immer nur Dateien in der iCloud abgelegt. Dies geht ja recht einfach. Jetzt muss ich aber Files auch aus der iCloud öffnen. An sich auch kein Problem, ich kann die Dateien in der App-iCloud ja auflisten und dann in einer eigenen Liste auswählbar machen:

Delphi-Quellcode:
  var
    nsFile: NSFileManager;
    URL: NSURL;
  begin
    nsFile := TNSFileManager.Wrap(TNSFileManager.OCClass.defaultManager);
    URL:=nsFile.URLForUbiquityContainerIdentifier(nil);
    if (URL <> nil) then
    begin
      URL:=URL.URLByAppendingPathComponent(StrToNSStr('Documents'));
      Result := UTF8ToString(URL.path.UTF8String);
      if (not nsFile.fileExistsAtPath(URL.path,nil)) then
      begin
        mlog.info('create new iCloud directory: '+result);
        if (nsFile.createDirectoryAtURL(URL,true,nil,nil)) then
          mlog.info('Created new iCloud directory '+result)
        else
          mlog.info('Can´t creat new iCloud directory '+result);
      end;
    end else
      Result := '';
  end;
Ich würde aber lieber den iOS-Standard-iCloud-Dialog öffnen (so quasi ein TOpenDialog für iOS-iCloud) und dann ein File auswählen (am liebsten inklusive Filter) und dann in meiner App weitermachen. Dies hätte auch den Vorteil, dass ich nicht auch eine Ebene in der iCloud runterspringen kann in den allgemeinen Bereich und dann drei Ordner zur Auswahl der Datei zur Verfügung habe:
- iCloud (Root)
- Downloads
- App-Ordner

Gibt es dafür eine Alternative? Habe auch mal die TMS-iCl-Komponenten gecheckt, da gibt es dies leider auch nicht.

Grüße, Philipp


Alle Zeitangaben in WEZ +1. Es ist jetzt 14:48 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz