Ionic 6 app getting CORS error accessing develper.google.com on iPad only - ios

I have an ionic 6 app built with angular and cordova. I can build the app just fine for iOS and it runs on an iPhone with no issues.
But for some reason, when running the same build on an iPad I get CORS error accessing developers.google.com (I assume this is from firebase, which is in my app)
Most of the other questions I've found involve Capacitor, which I am NOT using.
Similar, but I'm not making http requests directly. I'm using AngularFire: https://forum.ionicframework.com/t/cors-issue-when-sending-request-from-ionic-to-firebase-cloud-function/185239
I've been able to repeat this scenario. If I remove the app from the iPad simulator and run it again, it works. However, if I refresh using Safari dev tools, or just re-run the app, the issue occurs. (maybe it's a timing issue?)
erorrs.
Some more information around the erorrs

The way I managed to address this was to switch from the Cordova build to the Capacitor build following the instructions here:
https://capacitorjs.com/docs/cordova/migrating-from-cordova-to-capacitor
Essentially, once I started using the newly create ios folder instead of the old platform/ios that was generated by Cordova, the error stopped.
I don't know why, but maybe this will help someone else.

Related

Ionic Capacitor IOS Only Works With Livereload

In my ionic capacitor ios app, the app works just fine on a web browser using ionic serve. When I try running ionic capacitor run ios, that is successful but when I build the app I get this:
While that looks like a lot, you can see that at the end it says Webview failed to load and the request timed out. On my phone, all I see is the splash screen.
Instead, when I run ionic cap run ios -l --external, I get this:
In this console, the same warning messages happen, but it says "onscript loading complete" and then the actual app works.
I have looked through many StackOverflow + github pages offering help for this issue. From this issue, I made sure that my phone and computer were on the same wifi. Anyone experienced this error before/knows what to do? This code has worked in the past.
I figured out the issue! The app was trying to connect to a server that did not exist. I needed to remove the server field in capacitor.config.json. I cut out that json field and then ran ionic cap run ios, and the code worked.
Please comment if you are still experiencing this issue

Angular route is not working with Cordova iOS

I'm facing an issue with Cordova, Cordova-ios 6.2.0 and Angular 12.0.
When I'm building my app with Cordova and launch it in an emulator (or with a device), I'm arriving to a white screen.
I did some research and try some "fix" but nothing worked.
Finlly, I've find that it could be because of the balise.
So, I tried to play with the tag and modify the href with ., ./, / but nothing worked.
I've tried without and it worked, but without routing.
Has someone already had this problem?
The Angular router needs the app to be hosted on a "proper" HTTP scheme and does not work with file: URLs. You can check how your app runs, if you open the JavaScript console for your app running on an iOS device with Chrome and typing location.href. If you see file: you need to set up a custom scheme.
Please checkout the documentation and this announcement https://cordova.apache.org/announcements/2020/06/01/cordova-ios-release-6.0.0.html

Meteor AngularJS Ionic IOS device blank page

I am building a Meteor hybrid app that using AngularJS and ionic, so I decided to use driftyco:ionic, since meteoric:ionic doesn't support Angular.
Everything works fine on web browser, however, it is blank when it runs on ios devices or simulator with no warnings or errors showing. I get rid of driftyco:ionic, content is able to show on ios devices. Thus, I believe there is something I did wrong with driftyco:ionic, so I got a blank page.
My repo https://github.com/yumikohey/bringMe ?
I deployed to 52.89.149.88(most updated) and bring-me.meteor.com(older version)
Thanks for your help.
Create mobile-config.js and add App.accessRule('*');
Re-run meteor

Launching app on iOS Simulator (waxsim no longer works)

I've had a workflow for a while that ran automated tests by building an app for the simulator, then launching it using waxsim. On every new sdk release there were some small tweaks to keep it working. However, XCode 5.1 removed the iPhoneSimulatorRemoteClient framework, so waxsim no longer works.
I tried using the ios simulator from the command line directly, as in:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app/Contents/MacOS/iPhone\ Simulator -SimulateApplication /mydir/myapp.app/myapp
However myapp does not run, I just get the simulator loading the home screen. I can't figure out what might be going wrong, since I can't find a way to get any verbose output - the simulator does not complain about anything, it just doesn't load my app.
Any ideas, thoughts? Perhaps an alternative to waxsim that works on Xcode 5.1?
ios-sim was recently updated to support the new private framework DVTiPhoneSimulatorRemoteClient that is present in the current Xcode/SDK. I tried it and it seems to work fine, so I pretty much answered my main question.
Still, if someone has an idea why -SimulateApplication does not work (when the same app launches fine with ios-sim), I'd be curious to find out.

Why does XCode (4.5.1, Lion) require an internet connection to connect to iOS simulator?

I am developing an ios app that doesn't need an internet connection. I'm using phonegap and jquery-mobile. I'd like to develop offline, but XCode gets stuck with a status saying 'Attaching to iosproj' (iosproj is my project name). After that I cannot stop the stuck task, and have to force-quit XCode. With an internet connection however, everything works just fine. Grateful for any clues.
Edit: XCode seems to install the app fine without a network, but it gets stuck before/durimg receiving the deviceready event.
Update 1: The app runs fine on the simulator with or without the n/w. It is purely the XCode-iOS simulator interaction.
Update 2: When using phonegap (Apache cordova), there's an easy work-around to work offline. Once the project has been built and installed (with a n/w), all subsequent updates to html/js/css/img can be made directly to the www directory in the simulator's Library (under your app folder, in ~/Library/Application Support/iPhone Simulator/6.0/Applications).
The Simulator itself attempts to make an Internet connection to Apple as it launches. In particular, the itunesstored process attempts to connect to ax.init.itunes.apple.com and phobos.apple.com.
[That information comes from LittleSnitch. You would be well advised to install LittleSnitch so that you can be sure of exactly what connection is being attempted here. No one - certainly no developer - should be without it.]
If you find this troublesome (that is, if the connection failure is causing you to be unable to run your app in the Simulator at all) you should file a bug report with Apple. However, I've had no difficulty with this, so perhaps this an Xcode bug. I'd suggest first updating to Xcode 4.5.2 in case it is fixed there.

Resources