Back to Cordova

2021 07 16

slack-digest/2021-07-16.md

latest2.9 KB
Original Source

Cordova Slack Digest

Fri, 16 Jul 2021 08:21:07 GMT

User count: 4554

Join the conversation at slack.cordova.io

Channel #cordova-ios (1 messages)


Thu, 15 Jul 2021 09:20:13 GMT

@jakob.pfab says

Hi, whats the best way to remove any Logs (NSLog) from production builds?

Channel #cordova-android (1 messages)


Thu, 15 Jul 2021 12:46:21 GMT

@ucheozoemena says

Hi folks, has anyone had an issue with a flash of their app's background color when resuming the app from the background? I've included a video showing the problem. The white is the normal app content, and the green is the background color of the app (not the DOM, the Android view itself). You can see that as I return the app to the foreground from the app switcher, there's a brief period where the green color overrides the white. I used those 2 colors just to highlight the bug, but the problem is the same with the app's actual contents i.e. when I return to the app, the app's background (white in my case) flashes over the app's contents (i.e. the DOM). I'm not sure what's going on, it looks it's something happening with the webview itself. I am fairly certain it's not a style invalidation problem because style invalidations or repaints of the DOM don't show up when I profile the bug using dev tools. In fact in dev tools, the DOM is never repainted and there's no flash. Things I've tried:

  • disabling the onDeviceResume and onDevicePause callbacks. When I say disable I mean that I put return; statements to make sure that those callbacks don't execute any logic. This didn't stop the problem
  • using a transparent app background color. I thought this would allow the app's contents to show even when the background color is overlaying the contents, but instead it only made the flash dark (i.e. no background color for the app to show). This suggests that something is actually removing and restoring the Android view, but I don't know how to check for this
  • removing all the contents of the DOM (i.e. setting display: none; to all visible content, and also to the <html> and <body> elements in another test). This essentially hides everything on screen, leaving only the app's background. In my video, that would mean only the green would be showing. The flash doesn't happen when I do this, perhaps unsurprisingly
  • removing some of the heavier plugins I use, particularly <https://github.com/transistorsoft/cordova-background-geolocation-lt/|this background geolocation plugin> and <https://github.com/mapsplugin/cordova-plugin-googlemaps/|the google maps plugin>, but the problem doesn't go away
  • using the basic cordova sample app to try to reproduce the problem but I haven't succeeded yet, the bug hasn't occurred Feels like there's something I'm missing or haven't considered, so I'd appreciate any input. Thank you!