CORS issue mobile app

We have upgraded mobile app from ionic 3 to ionic4 with angular. Now we are facing issues with CORS. we tried to resolve it on the server side but solution either works for android or ios, not both as we set the header :

  • Access-Control-Allow-Origin “http://localhost” It works only for android
  • Access-Control-Allow-Origin “ionic://localhost” It works only for ios

do we have any recommendations for UI or server side which should work for both iOS & the android.