Hello Nimesh,
Please see my sample code what exactly I am trying.
Local Server Connection:
var featureLayers = [FeatureLayer(featureTable: ServiceFeatureTable(url: URL(string: "https://localhosturl.com")!))]
map.addOperationalLayers(featureLayers)
Note: In local server where proxy is not required there "FeatureLayer" is adding into a arcgis map.
Live Server Connection(Prod):
var featureLayers = [FeatureLayer(featureTable: ServiceFeatureTable(url: URL(string: "https://myserver/api/maps/proxy?https://localhosturl.com")!))]
map.addOperationalLayers(featureLayers)
Note: But same coding only URL changed for production build, "FeatureLayer" is not adding in map.
For the security purpose prod build has proxy setup - "https://myserver/api/maps/proxy?" in the prefix of the FeatureLayer URL.
Hope I explained you about my query.