Home > Software design >  Angular route is not working with Cordova iOS
Angular route is not working with Cordova iOS

Time:10-05

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?

CodePudding user response:

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

  • Related