<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Setup proxy rule for iOS ArcGIS map in Swift Maps SDK Questions</title>
    <link>https://community.esri.com/t5/swift-maps-sdk-questions/setup-proxy-rule-for-ios-arcgis-map/m-p/1334826#M152</link>
    <description>&lt;P&gt;Thanks for your information!&lt;/P&gt;</description>
    <pubDate>Wed, 04 Oct 2023 03:16:16 GMT</pubDate>
    <dc:creator>trieunguyenaxon</dc:creator>
    <dc:date>2023-10-04T03:16:16Z</dc:date>
    <item>
      <title>Setup proxy rule for iOS ArcGIS map</title>
      <link>https://community.esri.com/t5/swift-maps-sdk-questions/setup-proxy-rule-for-ios-arcgis-map/m-p/1333265#M145</link>
      <description>&lt;P&gt;We're building our proxy server and want all requests to ArcGIS service go through it.&lt;/P&gt;&lt;P&gt;From the Web I found that they support a method to config proxy rules:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt; /**
     * Adds the given proxy rule to the proxy rules list: `esriConfig.request.proxyRules`.
     *
     * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-urlUtils.html#addProxyRule)
     *
     * @param rule An object specifying a URL that should use the proxy. See the object specification table below for the required properties of this object.
     * @param rule.proxyUrl The URL of the proxy.
     * @param rule.urlPrefix The URL prefix of the resources that should be accessed through the given proxy.
     *
     */
    addProxyRule(rule: urlUtilsAddProxyRuleRule): number;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I can not find the API for iOS SDK. Could anyone has experience share with me how can I use proxy with the iOS ArcGIS SDK?&lt;/P&gt;&lt;P&gt;Many thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2023 08:29:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/swift-maps-sdk-questions/setup-proxy-rule-for-ios-arcgis-map/m-p/1333265#M145</guid>
      <dc:creator>trieunguyenaxon</dc:creator>
      <dc:date>2023-09-28T08:29:10Z</dc:date>
    </item>
    <item>
      <title>Re: Setup proxy rule for iOS ArcGIS map</title>
      <link>https://community.esri.com/t5/swift-maps-sdk-questions/setup-proxy-rule-for-ios-arcgis-map/m-p/1333402#M146</link>
      <description>&lt;P&gt;Greetings,&lt;/P&gt;&lt;P data-unlink="true"&gt;The ArcGIS Maps SDK supports the proxy using the&amp;nbsp;&lt;A href="https://developer.apple.com/documentation/foundation/nsurlsessionconfiguration/1411499-connectionproxydictionary" target="_self"&gt;connectionProxyDictionary.&lt;/A&gt;&amp;nbsp; You can use following code for setting the proxy with desired parameters at the start of the application. Then all &lt;STRONG&gt;data&lt;/STRONG&gt; requests sent by the SDK will go through proxy.&lt;/P&gt;&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="swift"&gt;let configuration = URLSessionConfiguration.default
configuration.connectionProxyDictionary = [
    "HTTPSEnable": true,
    "HTTPSProxy": "localhost",
    "HTTPSPort": 9090
]
ArcGISEnvironment.urlSession = ArcGISURLSession { configuration }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you would like to do the same for &lt;STRONG&gt;download&lt;/STRONG&gt; requests then set &lt;STRONG&gt;ArcGISEnvironment.backgroundURLSession&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nimesh&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2023 15:19:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/swift-maps-sdk-questions/setup-proxy-rule-for-ios-arcgis-map/m-p/1333402#M146</guid>
      <dc:creator>NimeshJarecha</dc:creator>
      <dc:date>2023-09-28T15:19:54Z</dc:date>
    </item>
    <item>
      <title>Re: Setup proxy rule for iOS ArcGIS map</title>
      <link>https://community.esri.com/t5/swift-maps-sdk-questions/setup-proxy-rule-for-ios-arcgis-map/m-p/1334066#M148</link>
      <description>&lt;P&gt;Many thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1055"&gt;@NimeshJarecha&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems that I need to update to the new ArcGIS version v200.x to use new API:&amp;nbsp;ArcGISEnvironment.urlSession&lt;/P&gt;&lt;P&gt;Does the ArcGIS SDK v200.x support UIKit or it just supports SwiftUI?&lt;/P&gt;</description>
      <pubDate>Mon, 02 Oct 2023 07:20:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/swift-maps-sdk-questions/setup-proxy-rule-for-ios-arcgis-map/m-p/1334066#M148</guid>
      <dc:creator>trieunguyenaxon</dc:creator>
      <dc:date>2023-10-02T07:20:41Z</dc:date>
    </item>
    <item>
      <title>Re: Setup proxy rule for iOS ArcGIS map</title>
      <link>https://community.esri.com/t5/swift-maps-sdk-questions/setup-proxy-rule-for-ios-arcgis-map/m-p/1334162#M150</link>
      <description>&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;Since you posted question under &lt;STRONG&gt;Swift Maps SDK Questions, &lt;/STRONG&gt;I assumed that you are using the v200.x.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;gt; Does the ArcGIS SDK v200.x support UIKit or it just supports SwiftUI?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The v200.x supports SwiftUI. However, iOS SDK supports converting UIKit views to SwiftUI. You'll find more information in &lt;A href="https://developer.apple.com/documentation/swiftui/uikit-integration/" target="_self"&gt;UIKit Integration&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nimesh&lt;/P&gt;</description>
      <pubDate>Mon, 02 Oct 2023 15:27:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/swift-maps-sdk-questions/setup-proxy-rule-for-ios-arcgis-map/m-p/1334162#M150</guid>
      <dc:creator>NimeshJarecha</dc:creator>
      <dc:date>2023-10-02T15:27:12Z</dc:date>
    </item>
    <item>
      <title>Re: Setup proxy rule for iOS ArcGIS map</title>
      <link>https://community.esri.com/t5/swift-maps-sdk-questions/setup-proxy-rule-for-ios-arcgis-map/m-p/1334826#M152</link>
      <description>&lt;P&gt;Thanks for your information!&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2023 03:16:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/swift-maps-sdk-questions/setup-proxy-rule-for-ios-arcgis-map/m-p/1334826#M152</guid>
      <dc:creator>trieunguyenaxon</dc:creator>
      <dc:date>2023-10-04T03:16:16Z</dc:date>
    </item>
    <item>
      <title>Re: Setup proxy rule for iOS ArcGIS map</title>
      <link>https://community.esri.com/t5/swift-maps-sdk-questions/setup-proxy-rule-for-ios-arcgis-map/m-p/1334828#M153</link>
      <description>&lt;P&gt;Sorry, but after I try to config the proxy, I found that my server is not a proxy server, it's just a proxy API. Here is how it works:&lt;/P&gt;&lt;P&gt;- Client (iOS, Android, web) sends a request to our API endpoint&amp;nbsp;&lt;/P&gt;&lt;P&gt;- The request is sent to our API endpoint must follow this format: &lt;STRONG&gt;https://&amp;lt;our_api_endpint&amp;gt;?&lt;FONT color="#FF0000"&gt;https://&amp;lt;arcgis_destination_url&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;&amp;gt;.&lt;FONT color="#000000"&gt; Example:&lt;/FONT&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;A href="https://myserver/api/maps/proxy" target="_blank" rel="noopener"&gt;https://myserver/api/maps/proxy&lt;/A&gt;?&lt;STRONG&gt;&lt;A href="https://arcgisabc.maps.arcgis.com" target="_blank" rel="noopener"&gt;https://arcgisabc.maps.arcgis.com&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P class=""&gt;- Our server will build and send a new request to ArcGIS online server after extracting the&amp;nbsp;ArcGIS online destination endpoint&amp;nbsp; (&lt;STRONG&gt;&lt;A href="https://arcgisabc.maps.arcgis.com" target="_blank" rel="noopener"&gt;https://arcgisabc.maps.arcgis.com&lt;/A&gt;&lt;/STRONG&gt;) from the request url, header, and parameters.&lt;/P&gt;&lt;P class=""&gt;- When our server receives response from ArcGIS online server, it forwards the response to client&lt;/P&gt;&lt;P class=""&gt;We follow this approach because we want to make sure all requests must go through our proxy API before reaching out to the ArcGIS online server.&lt;/P&gt;&lt;P class=""&gt;Therefore, I tried to config map Portal base url by&amp;nbsp;&lt;STRONG&gt;https://&amp;lt;our_api_endpint&amp;gt;?&lt;FONT color="#FF0000"&gt;https&amp;lt;arcgisabc&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;.maps.arcgis.com&amp;gt;&lt;/STRONG&gt;&lt;FONT color="#000000"&gt;, but it doesn't work.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;FONT color="#FF0000"&gt;&lt;FONT color="#000000"&gt;I notice that the base map URL just supports those format:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="swift"&gt;/// The supported URL formats are:

    /// - The URL of the portal (Example: https://www.arcgis.com)

    /// - The URL of the portal rest end point (Example: https://www.arcgis.com/sharing/rest)

    /// - The URL of the deprecated portal rest end point (Example: https://www.arcgis.com/sharing)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my code to load the map portal:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="swift"&gt;struct ContentView: View {
    private static let mapItem = PortalItem(portal: Portal(url: URL(string: "https://myserver/api/maps/proxy?https://arcgisabc.maps.arcgis.com")!), id: .baseMapId)

    @State private var map = Map(item: mapItem)

    var body: some View {
        MapView(map: map)
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you have any suggestion for me to load map from our custom URL&amp;nbsp;&lt;STRONG&gt;https://&amp;lt;our_api_endpint&amp;gt;?&lt;FONT color="#FF0000"&gt;https&amp;lt;arcgisabc&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;.maps.arcgis.com&amp;gt;?&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Or is there any way for me to modify the network request before ArcGIS SDK sends to server?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Thanks&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2023 03:47:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/swift-maps-sdk-questions/setup-proxy-rule-for-ios-arcgis-map/m-p/1334828#M153</guid>
      <dc:creator>trieunguyenaxon</dc:creator>
      <dc:date>2023-10-04T03:47:55Z</dc:date>
    </item>
    <item>
      <title>Re: Setup proxy rule for iOS ArcGIS map</title>
      <link>https://community.esri.com/t5/swift-maps-sdk-questions/setup-proxy-rule-for-ios-arcgis-map/m-p/1335437#M154</link>
      <description>&lt;P&gt;Greetings&lt;/P&gt;&lt;P&gt;Unfortunately, the Swift SDK does not support the proxy url format you are using. However, it supports intercepting the requests/responses. You can create a custom object using &lt;A href="https://developers.arcgis.com/swift/api-reference/documentation/arcgis/datataskinterceptor" target="_self"&gt;DataTaskInterceptor&lt;/A&gt;&amp;nbsp;and set it on the &lt;A href="https://developers.arcgis.com/swift/api-reference/documentation/arcgis/arcgisurlsession/datataskinterceptor" target="_self"&gt;ArcGISURLSession.dataTaskInterceptor&lt;/A&gt;. You can do the same for download requests using&amp;nbsp;&lt;SPAN&gt;DownloadTaskInterceptor.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nimesh&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2023 15:59:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/swift-maps-sdk-questions/setup-proxy-rule-for-ios-arcgis-map/m-p/1335437#M154</guid>
      <dc:creator>NimeshJarecha</dc:creator>
      <dc:date>2023-10-05T15:59:39Z</dc:date>
    </item>
    <item>
      <title>Re: Setup proxy rule for iOS ArcGIS map</title>
      <link>https://community.esri.com/t5/swift-maps-sdk-questions/setup-proxy-rule-for-ios-arcgis-map/m-p/1419748#M268</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying your solution , but can you tell me what is the variable 'baseMapId'. What type of value it will store or assign.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2024 05:27:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/swift-maps-sdk-questions/setup-proxy-rule-for-ios-arcgis-map/m-p/1419748#M268</guid>
      <dc:creator>JyoshnaRani</dc:creator>
      <dc:date>2024-05-07T05:27:19Z</dc:date>
    </item>
    <item>
      <title>Re: Setup proxy rule for iOS ArcGIS map</title>
      <link>https://community.esri.com/t5/swift-maps-sdk-questions/setup-proxy-rule-for-ios-arcgis-map/m-p/1419749#M269</link>
      <description>&lt;P&gt;If any fix solution or working solution is there please provide here.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2024 05:25:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/swift-maps-sdk-questions/setup-proxy-rule-for-ios-arcgis-map/m-p/1419749#M269</guid>
      <dc:creator>JyoshnaRani</dc:creator>
      <dc:date>2024-05-07T05:25:56Z</dc:date>
    </item>
  </channel>
</rss>

