iOS Question OpenFile with DocumentInteraction does not work on iPad Air with iOs 11.4.1

Discussion in 'iOS Questions' started by sdesan, Sep 13, 2018.

  1. sdesan

    sdesan Member Licensed User

    I made an app with a database of GPS trails. User can choose trails (a .gpx file) from a list and it will be opened with any external GPS app.
    Few months ago, due iOs upgrade to ver 11.xx.xx i have to add copy file from DirAssets to DirTemp before invoke OpenFile.
    Few days ago a friends of mine showed as on his iPad Air with iOS 11.4.1 the opening file does not works but it works on
    iPhone 4 - iOS
    iPad 2 - iOS 9.3.5
    iPhone 6+ - iOS 11.4.1
    iPhone X - iOS 11.4.1
    but not on iPad Air 2 with iOS 11.4.1
    This is my code
    Code:
    'Code module
    #If RELEASE
      #CertificateFile: ios_distribution.cer
      #ProvisionFile: sentieri.mobileprovision
    #End If
    #Region  Project Attributes 
        
    #ApplicationLabel: I Sentieri del Centro Abruzzo
        
    #Version: 1.9.0
        
    #iPhoneOrientations: Portrait 
        
    #iPadOrientations: Portrait, PortraitUpsideDown 
        
    #Target: iPhone, iPad
        
    #MinVersion: 7
    #End Region
    Sub Process_Globals
        
    'These global variables will be declared once when the application starts.
        'Public variables can be accessed from all modules.
        Public App As Application
        
    Public NavControl As NavigationController
        
    Private main1, princi1, genzana1, maiellamain1, parcomaiella1, parconalm1, sirentevelino1, vallesagittario1, mostra1 As Page
        
    Public di As DocumentInteraction
        
    Public di_page As String
        ....
    End Sub
    Private Sub Application_Start (Nav As NavigationController)
        NavControl = Nav
        ....
    End Sub
    After the user choise i fill a List with data read from a text file with a specific structure to extract more than an information from any line
    Code:
    Sub ParcoNALM_Click
        parconalm1.Initialize(
    "parconalm1")
        parconalm1.Title = 
    "I Sentieri del Centro Abruzzo"
        parconalm1.RootPanel.LoadLayout(
    "parconalm"
        NavControl.ShowPage(parconalm1)
        
    'leggo le tracce
        If File.Exists(File.DirAssets,"traccepnalm.txt")=True Then
            clv1.Clear
            mylist=
    File.ReadList(File.DirAssets,"traccepnalm.txt")   
             
    If mylist.size>1 Then
               
    For i= 0 To mylist.Size-1
                     line=mylist.Get(i)
                    dove=line.IndexOf(
    ";")
                    codice=line.SubString2(
    0,3)
                    percorso=line.SubString2(
    4,dove)
                    descri=line.SubString(dove+
    1)
                    di_page=
    1
                    clv1.Add(CreateListItem(percorso, descri, clv1.GetBase.Width, 
    48dip), 150dip, codice)
               
    Next
               pre_percorso=
    "pnalm_"
             
    End If
          
    Else
            
    Msgbox("File delle tracce non trovato","Errore")
          
    End If
    End Sub
    When user tap a line i will show the gpx file true opening external app
    Code:
    ub clv1_ItemClick (Index As Int, Value As Object)
        
    Dim traccia, nome As String
        nome=Value
        nome=nome.ToLowerCase
        traccia=pre_percorso & nome & 
    ".gpx"
        
    File.Copy(File.DirAssets, traccia, File.DirTemp, traccia)
        di.Initialize(
    "di"File.DirTemp,traccia)
        
    Try
            
    If di_page=1 Then
                di.OpenFile(parconalm1.RootPanel)
            
    End If
            
    If di_page=2 Then
                di.OpenFile(vallesagittario1.RootPanel)
            
    End If
            
    If di_page=3 Then
                di.OpenFile(genzana1.RootPanel)
            
    End If
            
    If di_page=4 Then
                di.OpenFile(sirentevelino1.RootPanel)
            
    End If
            
    If di_page=5 Then
                di.OpenFile(parcomaiella1.RootPanel)
            
    End If
        
    Catch
            
    Msgbox("Non posso aprire il file.""Errore")
        
    End Try
    End Sub
    This code works on the above devices but not on iPad Air... (and apple store does not accept any new upgrade of app)
    Any suggestions will be apprecciated
    Thank you
    Sergio
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    What happens when it doesn't work?
     
  3. sdesan

    sdesan Member Licensed User

    On all devices, different from iPad Air, when i tap on an element of the list as usal is showed a screen like this

    [​IMG]

    where i can choose the app to use for open files (in my app all files are .gpx files so i use ARA gpx viewer)
    On iPad Air the choice of the list is highlighted but dialog box for choosing app isn't showed
    Thank you Erel
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Try to pass a BarButton to di.OpenFile.
     
  5. sdesan

    sdesan Member Licensed User

    Thank you Erel for the answer but i don't understood your reply :(
    Can you write o indicate a little example?
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    Do it as a test.

    Add a BarButton with the designer.

    Open the dialog with:
    Code:
    di.OpenFile(Page1.TopRightButtons.Get(0))
     
  7. sdesan

    sdesan Member Licensed User

    Hi Erel in this way it works but i need to set
    Code:
    NavControl.NavigationBarVisible = True
    and sincerely i prefer to hide navigation bar.
    Any other suggestion? :)
     
  8. Erel

    Erel Administrator Staff Member Licensed User

    Try to pass a different small view instead of the RootPanel.
     
  9. sdesan

    sdesan Member Licensed User

    At the end i used thi solution:

    BarButton with the designer.

    and

    Code:
    NavControl.NavigationBarVisible = True
    di.OpenFile(Page1.TopRightButtons.Get(
    0))
    NavControl.NavigationBarVisible = 
    False
    I'm waiting for Apple review... (the previous one with iPad Air incompatibility was rejected)

    Thank you Erel
     
    Erel likes this.
  10. sdesan

    sdesan Member Licensed User

    App has been approvated
    :)
     
    Erel likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice