6 Replies Latest reply on Apr 5, 2017 6:36 AM by 34South

    IOS SDK Window adjust to fit?

    34South

      I've spent ages trying to solve this problem before eventually throwing in the towel and deciding to saddle this forum with it.

       

      An FM solution starts up fine in FMGo, adjusting the window size to fit the screen of the device it is running on. This is effected by a script triggered using "OnFirstWindowOpen" which contains the Adjust Window step with option "Resize to fit". The background image, which resides in the body, is proportionally correct and autosizing is set to include left/right/up and down. There is no footer.

      However, when deploying as a FIAS App and testing on the same iPhone, the window always opens with the bottom edge slightly off screen and I have to pinch zoom to get it to fit, after which the layout is spot on for the rest of the session. I have triple checked the layout settings and these are all correct for all objects on the layout. I have also tried triggering the script using "OnWindowOpen", as I read that startup scripts may not always run when expected within an SDK build (I guess when the App is running in the background and brought to front), but without improvement. No toolbars are on and I've tried "Maximize" and Zoom level of 100%, all to no avail. I've looked in Xcode, but can't see anything obvious.

       

      Again, it works perfectly in Go and is identical in FIAS down to the last pixel after pinching.

       

      A small problem, but an annoying one.

        • 1. Re: IOS SDK Window adjust to fit?
          TSGal

          34South:

           

          Thank you for your post.

           

          Please describe the different parts of the layout.  That is, does the layout contain only a Body part?

           

          Did you use Xcode 7 or Xcode 8?  Since FileMaker Go 15 was built using Xcode 7, be sure to use Xcode 7 when creating an iOS App SDK project.

           

          Any other information you can provide may be helpful in determining the possible cause.

           

          TSGal

          FileMaker, Inc.

          • 2. Re: IOS SDK Window adjust to fit?
            34South

            Dear TSGal

             

            Thanks!

            The layout is a simple one, a top navigation part and a body. The top navigation contains a button bar within a slide control and the body contains a background image and a few buttons, the latter also within slide controls. I have moved everything out of the body to test, but the same oversizing occurs. I then moved everything back to the original position, but added a button which allows one to manually perform the startup script containing the Adjust Window step (just for test purposes). The same oversizing again occurs but clicking the test button snaps everything to size. This suggests that the start script does not get triggered, even when the SDK App is not simply closed or quit but deleted from the device entirely.

            I originally used FMA15 to write the solution and IOS-SDK/Xcode 8 to compile it. At some point I also tried FMA (Next), but I do not think this is where the problem lies.

            I have read in this forum the problems of startup scripts not being triggered due to the App remaining open, despite pressing the home button and swiping up but, in my case, the problem occurs even when launching the App for the first time, immediately after it has been transferred to the device.

            I tried to incorporate a close file script, triggered on last window close, but also to no avail.

            • 3. Re: IOS SDK Window adjust to fit?
              34South

              A bit of further testing:

              I placed a beep step in the startup script and can confirm that, after quitting the App by swiping up and then restarting, the beep is heard confirming the script IS triggered on startup.

              When pushing the home button once to dismiss the App and then again 'opening' the App, the script fails to run (that is, there is no audible beep). This is as has been described in previous posts on the topic.

              However, even when the beep is heard, signalling that the startup script had been triggered, my display still fails to adjust to size. The only time this does occur is when the script is manually triggered by my test button. This suggests that the layout needs to be in focus for the Adjust Window step to function correctly.

              I have tried to replicate this by going to a specific object or field, but this too does not help.

              Once the display is correctly adjusted, I don't mind that the startup script is not run again since, once correctly sized (through my test button or pinching), it remains that way even when dismissing and reopening the App, but it is perplexing as to why this step specifically is not being executed correctly, even when the rest of the script appears to run on startup.

              Interestingly, changing to a different layout (by clicking on a button in the navigation button bar), that layout is correctly sized and, when clicking back to the original layout, that too is correctly sized.

              • 4. Re: IOS SDK Window adjust to fit?
                TSGal

                34South:

                 

                Thank you for the additional information.

                 

                First, I recommend reading Knowledge Base Article #16019 as it describes the OnFirstWindowOpen script trigger with iOS App SDK:

                 

                iOS App SDK - OnFirstWindowOpen works on first opening, but never again | FileMaker

                 

                Also, as covered in Knowledge Base Article #16283, Xcode 8 is not compatible with iOS App SDK.

                iOS App SDK 15.x comaptibility with Xcode 8 | FileMaker

                 

                Even though it appears everything is running, perhaps there is a timing issue.  Try placing a Pause script step of duration 0.25 seconds just prior to the Adjust Window, or if that doesn't work, add another Adjust Window with a Pause between the two steps.

                 

                TSGal

                FileMaker, Inc.

                • 5. Re: IOS SDK Window adjust to fit?
                  34South

                  Thanks again!

                  I did try inserting a pause step as well as an additional Adjust Window step. Unfortunately this did not solve the problem.

                  I will review the documents you provided and alert you should I have any success.

                  • 6. Re: IOS SDK Window adjust to fit?
                    34South

                    I have discovered the cause of my problem. Due to Device Orientation not being supported due to the split screen incompatibility on newer iPads, I had experimented with settings in the info.plist, since orientation limitations are in fact crucial to my App, and had temporarily removed all but the Portrait (bottom home button) interface orientation. I had done this a while back before actually deploying to my iPhone, so it wasn't that evident that this change was the cause of the problem. Reverting to all orientations (or just both Portrait orientations alone) has the App performing normally again, albeit with the orientation problem (which wasn't solved by removing the settings in info.plist anyway) which remains an issue for me.