Ionic iOS Selecting the background application after a while, it only shows the splash screen and the application does not continue.
Installing the Ionic application in iOS 11.3 it works correctly after pressing the home menu and the application goes to background after approximately 3 hours Select the application then only the splash screen is show and don’t continue with the application. I check in safari the navigation and it shows an about:blank, there is nothing in resources and in the console prints
exception nativeEvalAndFetch: ReferenceError: Can not find variable: cordova.
iOS: 11.3.1
engine name = “ios” spec = “4.4.0”
@ ionic / cli-utils: 1.19.2
ionic (Ionic CLI): 3.20.0 global packages:
Cordova (Cordova CLI): 8.0.0 local packages:
@ ionic / app-scripts: 3.1.6
Cordova Platforms: android 6.4.0
Ionic Framework: ionic-angular 3.9.2 System:
Node: v6.11.5
npm: 5.6.0
I’ve currently checked in the console and it shows the following: exception nativeEvalAndFetch : ReferenceError: Can’t find variable: cordova global code about:blank 1:127 global code script element 1:1:127 try { cordova.require(‘cordova/exec’).nativeEvalAndFetch(function() { cordova.fireDocumentEvent(‘active’); }) } catch (e) { console.log('exception nativeEvalAndFetch : ’ + e); }; Looking for this code in xcode I find that it is in CDVCommandDelegateImpl.m but I could not solve it yet
Hey @jeorgefabre! Indeed, I have a working solution.
The issue was fixed in a pullrequest in the cordova-ios repository (see https://github.com/apache/cordova-ios/pull/363/files). Nevertheless, there does not exist an update with this PR yet. Therefore, I decided to download the fixed file and after adding the ios platform, I replace the old CDVViewController.m on my own. For me this worked and my > 2000 user do not experience this issue anymore.
The path to the old file is platforms/ios/CordovaLib/Classes/Public/CDVViewController.m.
Remember to replace this file everytime after removing/adding the platform. I use for this (and other things) a shellscript to prepare my working directory before building.
I’ve experienced the same issue. I’m still testing this solution and it looks the good one. The version 5.0.0 of cordova-ios includes this code automatically. We don’t know what is the cause of this problem but I think that with this solution it doesn’t matter anymore.
Thank you very much and an apologize for my english.