1 2 Previous Next 20 Replies Latest reply on Nov 23, 2016 3:59 PM by sfpx

    SDK with third party framework

    sfpx

      I understand that it's not a supported feature but I'm getting desperate for ideas/solutions.

       

      We're trying to code a framework embedded in the FIAS app that sends gps data to the app/database every x seconds (using the app url scheme)

       

      It works perfectly except that it will hang sometimes when the user clicks on a button (at the same time the data is being sent to the app...so we're guessing anyway.) When it hangs we get the spinning animation forever without any other choice than quitting the app.

       

      Notes:

       

      -The button script and the script called by the framework are irrelevant. The freeze will happen with simple scripts that only set a local variable.

       

      -It will not freeze without any user interaction. Data will be received by the database just fine.

       

      -We eliminated the gps tracking from the equation by trying a simple timer that will send a simple text to the app every 5 seconds. Still hangs occasionally when a user clicks on a button.

       

      -We tried everything (dispatch_async to main queue, to different global queues...dispatch_after etc..)

       

      -With the sdk 14 we had a webviewer with a javascript that was doing basically the same thing than the framework (sending the data using the url scheme) and it never froze the app.

       

      -When it hangs we get different behaviors on the sdk 14 and the sdk 15

      -On sdk14, we have to actually end the task to be able to "unfreeze" the app

      -On sdk15 , hitting the home button and coming back to the app will unfreeze it

       

      -When the freeze happen, the framework is still running and still dispatch data every x seconds

       

      And finally...

      It will freeze on the following devices (Iphone 6, Iphone 6s, Ipad 4, Ipad Mini 2) but NOT on an Iphone 5 and Ipod 6

       

      If anyone has any idea...

        • 1. Re: SDK with third party framework
          monkeybreadsoftware

          Wait for a plugin SDK for iOS.

           

          Than you can do whatever you need on a separate thread and call a plugin function regularly to query state.

          • 2. Re: SDK with third party framework
            sfpx

            Christian Schmitz wrote:

             

            Wait for a plugin SDK for iOS.

             

            Than you can do whatever you need on a separate thread and call a plugin function regularly to query state.

             

            Plugin SDK ? Who will make this ? Filemaker ? Do you something I don't ? Is this planned ?

            • 3. Re: SDK with third party framework
              monkeybreadsoftware

              FileMaker Inc. may someday support plugins on iOS.

              You could ask them for it to show them your interest.

              • 5. Re: SDK with third party framework
                sfpx

                Interesting.

                I did not know about livecode.

                It looks promising but there are a lot of question marks.

                When will it be ported to IOS ? Will it support background operations ? Will it support threading , etc ...

                It may take a year or more before this is available for IOS.

                I guess we may know a bit more in the next roadmap webinar in a few days.

                 

                Anyway thanks for the information.

                Unfortunately we can not afford to wait for all this. We are looking for a solution that would work now. It almost works perfectly...just a bit unreliable for the moment.

                • 6. Re: SDK with third party framework
                  schamblee

                  Have you tried adding a pause script step to your script?  I have seen that a pause has been need in some scripts to prevent issues. 

                   

                  I would compare the ios versions to see if it is related.  I would think the ipod 6 would be the same as the iPhone 6, so does the ipod 6 have the same ios version as the other devices.  

                  • 7. Re: SDK with third party framework
                    sfpx

                    I don't think the OS is the problem as I know it hangs on ios 9.3 and ios 10.

                     

                    I tried adding a pause script to the script called by the framework. It did not fix the issue.

                    I haven't tried adding a pause script to the different button scripts on the layout because I know for a fact that the freeze happens when we click on a button but before the first line of the button script is executed.

                     

                    It looks like Filemaker has trouble managing the script called by the framework. I guess it has trouble to pause or halt a script that has been called by the framework. Just a guess. It's pretty tough to debug .

                    • 8. Re: SDK with third party framework
                      sfpx

                      My theory about the problem being Filemaker's attempt to halt, pause or exit a running script invoked by something else than itself (in this case, a plugin) may be right.

                       

                      I replaced my main 2 buttons by fields and put the scripts in the OnEnter triggers and so far it seems stable.

                       

                      That remains to be tested more though.

                      • 9. Re: SDK with third party framework
                        sfpx

                        I found a way to get it to hang easily and 100% of the time.

                        I just have to keep my finger on a button and wait for the plugin to call a script.

                        I get the spinning animation and it hangs there.

                         

                        By comparison, if I do the same thing with my webviewer/javascript method I will get the spinning animation but it will disappear as soon as my finger leaves the button.

                         

                        So far the only way to prevent a freeze is to not use any button...but some alternative (like a field OnEnter trigger).

                         

                        I still want to use a standard button so if anyone has any idea...

                        • 10. Re: SDK with third party framework
                          sfpx

                          Also tested the following.

                          Made an ontimer script that lasts 10 seconds and waited for the plugin to call a script while the app was running the ontimer script.

                          It did not freeze.

                          So far , it looks like only the buttons are problematic.

                          • 11. Re: SDK with third party framework
                            schamblee

                            Can you set a flag in the FMGo app when the plugin is running?  Hide the buttons if the plugin is running then show when the plugin finishes.

                            • 12. Re: SDK with third party framework
                              sfpx

                              Good idea in theory but the only way for the plugin to communicate with the database is via an openurl script .

                               

                              If I keep my finger on a button and wait for the plugin to call a script, it will hang before any script is executed (the called script or the button script).

                               

                              If the click starts just before the button disappears and is held until the plugin calls a script it would still hang.

                               

                              Basically It hangs when the plugin calls a script while a button is still pressed in a layout.

                              If you click really fast you reduce the chance of a freeze.

                              • 13. Re: SDK with third party framework
                                schamblee

                                I assume a button is pressed or a script timer is used to call the plugin.  If so

                                 

                                set flag to hide button

                                openurl

                                set flag to show button

                                • 14. Re: SDK with third party framework
                                  sfpx

                                  You assumed wrong

                                  Once the plugin is started, it runs in the background and will call the db script without being invoked each time by the database.

                                  1 2 Previous Next