iOS Cordova assets not loaded - ios

I wrote some new views for my application, and they all show up properly on chrome and safari. However, when I run the app on simulator and open up the safari debugger, those views don't show up under index.html/scripts/. I have confirmed that those files exist in the www/ and Staging/www/ folders in the Xcode project. I have run rake prepare_ios, but it does not fix the issue, do I need to add these new files to a directory somewhere?

After trying to access my application through mobile Safari, I encountered an error on the Safari inspector that I had hooked to my simulator. It told me that I could not use const since I was using strict mode. This error had not popped up previously, and only out of random luck (when i was closing the safari tab) did it even show up on the inspector. This led me to go and make changes to my files that were using const and the page loads now.

Related

React JS not opening in apple browsers

I have a website created in react js, when I try to open it on windows or android the loading happens normally.
But on IOS devices it doesn't load anything from the site.
I tried to use https://polyfill.io/v3/polyfill.min.js in my index but I still couldn't.
PS: I don't have a mac to debug, tests only on an iphone version 15, I didn't find the iphone ios console to see the errors.
Problem solved, first step was to update the browserslist.
Second it was seen that the application was with storage in localStorage above what safari was handling, thus causing the error.
Removed localStorage.
Link:
https://github.com/browserslist/browserslist
Link:
https://stackoverflow.com/questions/1921048/limit-of-localstorage-on-iphone#:~:text=Mobile%20Safari%20on%20the%20iPhone,limit%2C%20afaik%2C%20on%20localStorage.

Css isn't working on my meteor iOS app, but in Browser it work perfectly

When I build and run my meteor app on my phone (iOS), the css isn't working, but when I access to my localhost on the browser there is no css problems... Have anyone an idea about the problem ? I build and run my app with Xcode.
Thanks for your answers !
If I try to modify the css file from the app in .meteor/local/cordova-build/www/application/app/client/main.scss, after building the app, all what I change disappears.

Xcode 8 app runs on Simulator but doesn't display

I'm using the release version of xCode 8 and am trying to run my app on the simulators. They are all the iOS 10 simulators.
No matter which simulator I use, when I run the app the app icon shows up in the simulator but then that's it. The app never displays in the simulator. I only see the app icons of the iOS home screen.
I put some break points in my initial view controller at the viewDidLoad, viewWillAppear, and viewDidAppear methods. All of them triggered. So as far as my app is concerned, it is displaying on the device. I also get all the normal log output and networking calls happening just fine. It even shows the popups for permission to access the calendar and notifications. But my app is not brought to the foreground.
If I then click on the app icon in the simulator, my app runs normally. But it should be automatic when I hit run from xCode.
When I run my app on an iOS 10 device I get the same behaviour as all three of those view methods are called. However I don't get any of my normal log output. In fact I don't get any log output. However the app was already installed from when the device was on iOS 9.x. Not sure if that is a factor. But aside from the simulator issues, this is the bigger issue.
I've tried cleaning the build, deleting the app, I even tracked down the derived data folder and deleted that from the simulator. None worked. I also updated all my cocoa pods I have installed too.
Any one else experienced this?
That sounds weird but I read a lot of threads on the Apple Developer Forums on the same problem during the different Xcode 8 beta version, try these steps:
reset the simulator using the menu "iOS Simulator" -> "Reset Content and Settings..."
remove your 'xcuserdata' directory inside your .xcodeproj directory
do a clean build folder (hold down option key when selecting clean)
reboot your Mac
If these steps don't solve anything you can try this solution:
Copy-paste Xcode-beta.app from Applications folder to somewhere else, e.g. - Documents folder.
Delete Xcode-beta.app from Applications folder.
Move Xcode-beta.app from Documents to Applications folder again.
originally posted here, obviously using your Xcode.app instead of Xcode-beta.app.

How to edit the Xcode Project for Meteor iOS integration?

I want to create an app icon, splash screen, edit the app name, and set some cordova / app settings.
meteor run ios opens up the simulator but doesn't open or the project. Where is that project and does this Xcode project ever get overwritten? I don't want to lose any settings I make.
For example I want to set the app url scheme so I can implement a redirect to the app. I also want to set cordova preferences to disallow over scroll. Typically I would do these things from within the .xcodeproj but where is it and when does it get overwritten / reset?
From what i have seen from the docs and my experience so far
meteor run ios only runs the iOS emulator with your code in it. The code related to this build is in .meteor/local/cordova-build but is temporary and will get overwritten all the time
meteor run ios-device -p yourlocalip:yourlocalport will launch XCode with the cordova-built .xcodeproject, and a local server on your computer. It is intended to make you able to run and debug your code from an actual iPhone device, with the changes you make on your computer to the code repercuted instantly on the iPhone screen. You need your computer and your phone to be on the same Wifi to enable this feature. The code related to this build is in .meteor/local/cordova-build but is temporary and will get overwritten all the time
meteor build /Path/To/Builds/Directory/NewBuild -p yourserverhost:yourserverip will actually create the cordova-built .xcodeproject pointing to your real server at the path you specified. From this project you can customize as much as you want BUT you will indeed loose these settings with a new build...
Except if you use the yourproject/cordova-build-override/ folder !
As described in the offical cordova meteor docs under "Advanced build configuration" everything you put in this folder will overwrite the files created by meteor during its build. So you can configure everything in the Cordova/Phonegap way there. If you were able to configure your features through Cordova usually, you will be able to do it there.
Bonus that I have learned the hard way :
Always destroy the .meteor/local folder before building one of those three things, i got stuck in a state where XCode remembered some of my changes to the .xcodeproject and everything was messed up. After destroying this folder, everything went back to normal :)
hope i helped
Mickael
If you are looking for the path to the Xcode project in your filesystem, it is located at:
/path/to/project/.meteor/local/cordova-build/platforms/ios/<project>.xcodeproj
You'll have to navigate to your project directory and open .meteor because it is a hidden file.
Note: If you want to be able to see hidden files in finder on a mac, then type into your terminal defaults write com.apple.finder AppleShowAllFiles TRUE, and then restart finder. Change TRUE to FALSE to only see visible files.

How to use Cordova's splash screen API

I have built an iOS app and set the splash (loading) screens in my .plist file, but when I load the app it still shows Cordova's default loading image (see image below).
I see there is an API for this here but I am unsure how to use it or if this is even what I am after.
I am running Cordova 2.7 (and JQuery mobile if that matters).
Would anyone know how to ammend this?
Have you replaced the images with your own in the Resources/Splash folder in the app ?
(Do so in finder rather then xcode!)
Also remember to 'Clean' your build as xcode has a habit of storing that type of thing.

Resources