Post iOS 11.3 - Mobile app freeze / crash on resume after sleep - silk ui

Post iOS 11.3 - Mobile app freeze / crash on resume after sleep - silk ui

  

Hi guys,

Has anyone seen issues where phones updated to iOS 11.3 freeze if they sleep while an outsystems app is running and are woken up? Screen elements, (but not always ALL screen elements) become unresponsive.

Not seen to affect Android, and doesn't seem to be an issue on iOS prior to update.

The iOS update could be a red-herring, i only have one device which hasn't been updated so could be a false positive. We have also updated our app significantly over the last few days. Odd though that on any screen it has started freezing. Definitely not exhibited on Android.

The app must be open at the time the phone goes to sleep for the issue to happen.

I will of course try winding back our app to see if recent changes have affected this change but wanted to put this out there in case others are having issues. I'm just in the free environment at the moment, so don't want to trouble the support guys with this and will try to research myself as much as possible to narrow down the issue and reply if I figure it out.

Thanks,

Danny

Danny O'Neill wrote:

Hi guys,

Has anyone seen issues where phones updated to iOS 11.3 freeze if they sleep while an outsystems app is running and are woken up? Screen elements, (but not always ALL screen elements) become unresponsive.

Not seen to affect Android, and doesn't seem to be an issue on iOS prior to update.

The iOS update could be a red-herring, i only have one device which hasn't been updated so could be a false positive. We have also updated our app significantly over the last few days. Odd though that on any screen it has started freezing. Definitely not exhibited on Android.

The app must be open at the time the phone goes to sleep for the issue to happen.

I will of course try winding back our app to see if recent changes have affected this change but wanted to put this out there in case others are having issues. I'm just in the free environment at the moment, so don't want to trouble the support guys with this and will try to research myself as much as possible to narrow down the issue and reply if I figure it out.

Thanks,

Danny

Hi Danny, 

Same here. Problem started after upgrading to IOS 11.3. 

Regards, Dirk


Report it using support portal guys so Outsystems teams can fix this.

Every OS updates will have risk of breaking something that Outsystems cannot predict.

Dirk, thanks for confirming I'm not the only one, Harlin thanks for suggesting a support call. I have given them details so that they know in case this affects many people.


One further detail: I have tried creating an OnApplicationResume action. It currently just creates an message to the user saying Welcome Back!. This does work, although the rest of the screen is frozen and I will now try to work round the problem using that - perhaps I can force the screen to redraw to get it to come back to life, even if it means reloading the current screen. Not sure how to get it to do that but will work it out if I can!

Hi guys,

In case anyone else needs a work around for this I have implemented something which is working for me:

I use the OnApplicationResume event to triger a whole page reload.

Initially I tied using it to flip a bool from false to true again, that variable was referenced in an if widget encapsulating a whole screen. That didn't work, the if did hide the screen and showed my false branch (in which I put a welcome back message) but the screen still is frozen and unresponsive. I mention this as it might help OS track down what is going on.

Then I changed to making it navigate to a new screen (edit: I mean the same screen, not sure why I wrote new) which does work and allows touch events to control the screen again.

In case anyone needs it, although I'm a total noob so I'm sure you can all achieve it better:

0) on each screen suffering with the issue (all of mine) I have put a hidden (css display:none) button with an appropriate ID, eg 'HiddenButtonForOnResume_Dashboard'

1) OnApplicationResume create action

2) Javascript action and in it (im terrible with syntax - am old so forgive me):

- element = get by id 'hiddenbutton'

- if (element) { element.click(); }

- repeat for other screens. nb the assignment then the if becasue they wont exist on the other screens so would throw exception

3) setup the action for each button to reload the screen using a navigation action

Note that in mine I didn't like the momentary flicker as the navigation ran so I have some extra steps, first I actually stay on the same screen and using the whole-screen-encapsulating if I mention above I show a friendly message, then I use a javascript timeout function to call another action on the screen to navigate 1.5s later. Ends up a little smoother and has the benifit of tricking the user into thinking this was a deliberate thing and not just an app that flickers oddly when coming out of screen lock.

Hope that helps someone else, maybe at least Dirk if he is the only one suffering with this. No one else coming out of woodwork yet, so perhaps there's a specific comibination of platform or dev version or particular screen elements, maybe blocks with certain onrender functions, who knows, but anyone using my little app on iOS 11.3 on a phone was getting affected and now they aren't with workaround above.

Thanks all and hopefully whatever is 'broken' if indeed something is, will get fixed or adjusted to make things better again.

Hi Danny,

We are experiencing this also - Outsystems informs us that the issue is due to a bug introduced with iOS10.3 with the internal Apple's web view, UIWebView. It has "a known issue where, after sending an application to background for some time, the events associated to End-User inputs have a negative timestamp" causing the issue.

Apparently they have a fix for this which didn't quite make it into the most recent platform version 10.0.816.0 but we should be able to expect it in a future release.

Hope this helps someone.

Cheers,

Adrian


Danny O'Neill wrote:

Hi guys,

In case anyone else needs a work around for this I have implemented something which is working for me:

I use the OnApplicationResume event to triger a whole page reload.

Initially I tied using it to flip a bool from false to true again, that variable was referenced in an if widget encapsulating a whole screen. That didn't work, the if did hide the screen and showed my false branch (in which I put a welcome back message) but the screen still is frozen and unresponsive. I mention this as it might help OS track down what is going on.

Then I changed to making it navigate to a new screen (edit: I mean the same screen, not sure why I wrote new) which does work and allows touch events to control the screen again.

In case anyone needs it, although I'm a total noob so I'm sure you can all achieve it better:

0) on each screen suffering with the issue (all of mine) I have put a hidden (css display:none) button with an appropriate ID, eg 'HiddenButtonForOnResume_Dashboard'

1) OnApplicationResume create action

2) Javascript action and in it (im terrible with syntax - am old so forgive me):

- element = get by id 'hiddenbutton'

- if (element) { element.click(); }

- repeat for other screens. nb the assignment then the if becasue they wont exist on the other screens so would throw exception

3) setup the action for each button to reload the screen using a navigation action

Note that in mine I didn't like the momentary flicker as the navigation ran so I have some extra steps, first I actually stay on the same screen and using the whole-screen-encapsulating if I mention above I show a friendly message, then I use a javascript timeout function to call another action on the screen to navigate 1.5s later. Ends up a little smoother and has the benifit of tricking the user into thinking this was a deliberate thing and not just an app that flickers oddly when coming out of screen lock.

Hope that helps someone else, maybe at least Dirk if he is the only one suffering with this. No one else coming out of woodwork yet, so perhaps there's a specific comibination of platform or dev version or particular screen elements, maybe blocks with certain onrender functions, who knows, but anyone using my little app on iOS 11.3 on a phone was getting affected and now they aren't with workaround above.

Thanks all and hopefully whatever is 'broken' if indeed something is, will get fixed or adjusted to make things better again.



Same issue.

I couldn't get Danny O'Neill's solution working and had to resort to the following javascript kludge in the OnApplicationResume client action... If offline this only worked for certain page types - all of our pages which had HTML rendering contained Preview in their name generate an error. For those pages we just redirect to our home screen. This is visually a poor experience :(

We also then had to put in another workaround for every pages OnRender to workaround the fact that the Outsystem back button navigation no longer works :(

Way ugly...


OnApplicationResume

/* This script is toworkaround the Apple bug which causes the app to freeze on resume if the device is an apple with iOS version 11.3 or greater

User agent stringsfor ipad/ipod/iphone are of the format

eg iphone"Mozilla/5.0 (iPhone; CPU iPhone OS 11_3 like Mac OS X)...  ""

eg ipad"Mozilla/5.0 (iPad; CPU OS 11_3_1 like Mac OS X) AppleWebKit/605.1.15(KHTML, like Gecko) Version/11.0 Mobile/15E148 Safari/604.1"

*/

try {

    var userAgent =navigator.userAgent.toLowerCase();

    var isIOS = false;

    var deviceName = "";

    var osMajorVersion = "";

    var osMinorVersion = "";

    var isSplash = false;

    var isOnline = (navigator.connection.type!== 'none'); // refresh doesn't work unless you are online! :(

    var isPageTypeRefreshableOffline = false;

 

    // isIOS

    isIOS =userAgent.indexOf("iphone") > -1 ||userAgent.indexOf("ipad") > -1 ||userAgent.indexOf("ipod") > -1;

console.log("isIOS= " + isIOS);

 

//We wont do a refresh for the splash screen as it automatically redirects once the splash animation completes.

    isSplash =(document.getElementById("splash_screen") !== null);

console.log("isSplash= " + isSplash);

 

    if (isIOS && !isSplash) {    

        // Check Version to see if refresh needed

        var userAgentArr =userAgent.split(" ");

        for (var i = 0; i <userAgentArr.length; i++) {

            // Look for the first word OS, thenext field will be the OS version 

            // eg '(iPhone; CPU iPhone OS 11_2 like Mac OS X)' or '(iPad; CPU OS 11_3 like Mac OS X)'

            if (userAgentArr[i] =="os") {

                versionStr = userAgentArr[i +1];

                console.log("versionStr =" + versionStr);

                var versionArr =versionStr.split("_");

                osMajorVersion =parseInt(versionArr[0]);

               console.log("osMajorVersion = " + osMajorVersion);

                osMinorVersion =parseInt(versionArr[1]);

               console.log("osMinorVersion = " + osMinorVersion);

                break;

            }

        }

        

        // Apply fix for iOS 11.3 or above only

        if (osMajorVersion == 11 &&osMinorVersion >= 3 || osMajorVersion > 11) {

            console.log('ios 11.3+ so reloadneeded');

 

            // if page has preview in pagetitle these page types are not refreshable offline

            isPageTypeRefreshableOffline =(window.location.href.indexOf("Preview_") == -1);            

            

//refresh if we aren't on the splash screen and aren't offline viewing a preview type page.

if(isOnline || (!isOnline && isPageTypeRefreshableOffline)) {

$public.FeedbackMessage.showFeedbackMessage("Resuming...",0);

setTimeout(function(){

console.log('doinglocation.reload');

//need to disable the back button for the initial resume page after this reload as Outsystems seems to lose it's history after a refresh

vartarget = location.search ? location.pathname + location.search +"&hidebackbutton=true" : location.pathname +"?hidebackbutton=true"

location.replace(target);

//location.reload();

},300);

}else if (!isSplash && !isOnline &&!isPageTypeRefreshableOffline) {

$public.FeedbackMessage.showFeedbackMessage("Resuming...",0);

//Refresh by Redirecting to home page as every other option fails!

setTimeout(function(){

console.log('doing location.assign HOME');

location.assign("/USC_Fraser_App_Mobile/Home");

},300);

}

        }

    }

} catch (ex) {

    console.log(ex.message);

    // Exception determining whether to refresh on resume, skipping

}

 

OnRender - in each page

$(document).ready(function(){

    console.log(location.search);

   // hide the back button if no historypresent. This needed due to OnApplicationResume refresh clearing history 

    if(document.getElementById("b2-Back") &&location.search.indexOf("hidebackbutton=true") > -1) {

 document.getElementById("b2-Back").style.display = 'none';

    }

});

Today we test our application is iOS 11.4 and this bug still in the platform. 

Has this issue been resolved for iOS 11.3 ? Has Outsystems team provided any patch ?

We too are experiencing this issue.  Was banging my head trying to figure out why it was crashing.


Hei,

I've been in contact with Outsystems support regarding this issue and I got a reply saying that this should be fixed in the platform version released yesterday, 11/06.

Can you confirm that this is solved for you after upgrading the platform and regenerating the app?

Same problem. Waiting for feedback from Outsystems.

This is still an issue with iOS 11.4 for the sample banking app on Silk UI (United Financial Group/Patricia Wesley).

After device wake up, the bottom buttons and the menu button don't respond to input.  The credit card carousal still works though.

Hi,


I noticed the following behaviour in line with above reported incident:

On an iPad if user returns back to the app which is open on the tablet shortly after the screen lock has taken effect, there is not issue. However if user waits for several minutes (I measured 8 but could be even shorter) after screen lock and then returns to open app, the app freezes. Only PullToRefresh is still able.


I doubt this issue is on all OS installations and all iPad as this issue is not widely reported.


Anyone found a solution?

No solution that I know of and it is a very annoying problem.

We implemented the the javascript workaround that Adrian posted a few posts up.  It has seemed to work well for us until a proper fix is released.

Adrian Holland solution works for now.

May need slight work, not just copy past:

1 - separate "vartarget" into "var target" before one of the redirects

2 - don't forget to set you own homepage URL, it likelly isn't "/USC_Fraser_App_Mobile/Home"

Thank you Adrian

Thanx Ricardo,

I missed the typo.

It now seems to work better, however the back button does not want to come back.

Also: is the commenting out correct for: //location.reload(); ??


thanks

Does iOS 12 beta still have this issue?