<?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: Result from TokenCredentials.create() seems to be cached for the lifetime of Application process in Kotlin Maps SDK Questions</title>
    <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/result-from-tokencredentials-create-seems-to-be/m-p/1493942#M436</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/805170"&gt;@ErlDeveloper&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We are able to reproduce the bug when initializing the app without internet. Our team is going to look at for a potential solution.&amp;nbsp;&lt;/P&gt;&lt;P&gt;We will keep you updated when we fix the issue.&lt;/P&gt;&lt;P&gt;Thanks.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 17 Jun 2024 19:11:44 GMT</pubDate>
    <dc:creator>Erick_1</dc:creator>
    <dc:date>2024-06-17T19:11:44Z</dc:date>
    <item>
      <title>Result from TokenCredentials.create() seems to be cached for the lifetime of Application process</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/result-from-tokencredentials-create-seems-to-be/m-p/1488912#M431</link>
      <description>&lt;P&gt;I'm experiencing an issue with TokenCredentials.create() when my app is cold started without Internet connection, but regains Internet connection after some seconds. After my app regains Internet connection, and we retry to authenticate, TokenCredentials.create() will immediately fail with UnknownHostException, even though the device has Internet connection.&lt;/P&gt;&lt;P&gt;Please take a look into my test project on GitHub where there is also a video demonstrating the problem.&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/erlingfjelstad/esri-auth-to-map/tree/master" target="_blank" rel="noopener"&gt;https://github.com/erlingfjelstad/esri-auth-to-map/tree/master&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2024 14:48:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/result-from-tokencredentials-create-seems-to-be/m-p/1488912#M431</guid>
      <dc:creator>ErlDeveloper</dc:creator>
      <dc:date>2024-06-11T14:48:02Z</dc:date>
    </item>
    <item>
      <title>Re: Result from TokenCredentials.create() seems to be cached for the lifetime of Application process</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/result-from-tokencredentials-create-seems-to-be/m-p/1489524#M432</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/805170"&gt;@ErlDeveloper&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the repro code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to isolate the bug you mentioned with &lt;EM&gt;TokenCredential.create(),&lt;/EM&gt; so I modified your &lt;EM&gt;MainActivity&lt;/EM&gt; to only load the &lt;EM&gt;TokenCredential&lt;/EM&gt;&amp;nbsp;when a button is clicked and I am not able to reproduce your bug.&lt;/P&gt;&lt;P&gt;It seems that your bug might be somewhere else.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Here's my modified &lt;EM&gt;MainActivity&lt;/EM&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="kotlin"&gt;class MainActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        val viewModel = MainViewModel()
        setContent {
            val coroutineScope = rememberCoroutineScope()
            Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding -&amp;gt;
                Button(modifier = Modifier.fillMaxWidth(),onClick = {
                    Log.d("ArcGIS-Main", "onCreate: $innerPadding")
                    coroutineScope.launch {
                        viewModel.authenticate()
                    }
                }) {
                    Text("Authenticate")
                }
                val uiState by viewModel.mapFlow.collectAsState()
                when (val state = uiState) {
                    is UiState.Error -&amp;gt; {
                        Toast.makeText(this, "Error", Toast.LENGTH_SHORT).show()
                            Log.d("ArcGIS-Main", "onCreate: Error ${state.text}")
                            Log.d("ArcGIS-Main", "onCreate: Error ${state.title}")
                    }

                    UiState.Loading -&amp;gt; {
                        Log.d("ArcGIS-Main", "onCreate: LOADING")
                    }

                    is UiState.Success -&amp;gt; {
                        Toast.makeText(this, "Success", Toast.LENGTH_SHORT).show()
                        Log.d("ArcGIS-Main", "onCreate: Success $uiState")
                    }
                }
            }
        }
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the video with the code above:&lt;/P&gt;&lt;P&gt;&lt;div class="lia-vid-container video-embed-center"&gt;&lt;div id="lia-vid-6354825656112w256h540r865" class="lia-video-brightcove-player-container"&gt;&lt;video-js data-video-id="6354825656112" data-account="6161463677001" data-player="default" data-embed="default" class="vjs-fluid" controls="" data-application-id="" style="width: 100%; height: 100%;"&gt;&lt;/video-js&gt;&lt;/div&gt;&lt;script src="https://players.brightcove.net/6161463677001/default_default/index.min.js"&gt;&lt;/script&gt;&lt;script&gt;(function() {  var wrapper = document.getElementById('lia-vid-6354825656112w256h540r865');  var videoEl = wrapper ? wrapper.querySelector('video-js') : null;  if (videoEl) {     if (window.videojs) {       window.videojs(videoEl).ready(function() {         this.on('loadedmetadata', function() {           this.el().querySelectorAll('.vjs-load-progress div[data-start]').forEach(function(bar) {             bar.setAttribute('role', 'presentation');             bar.setAttribute('aria-hidden', 'true');           });         });       });     }  }})();&lt;/script&gt;&lt;a class="video-embed-link" href="https://community.esri.com/t5/video/gallerypage/video-id/6354825656112"&gt;(view in My Videos)&lt;/a&gt;&lt;/div&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2024 21:53:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/result-from-tokencredentials-create-seems-to-be/m-p/1489524#M432</guid>
      <dc:creator>Erick_1</dc:creator>
      <dc:date>2024-06-11T21:53:48Z</dc:date>
    </item>
    <item>
      <title>Re: Result from TokenCredentials.create() seems to be cached for the lifetime of Application process</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/result-from-tokencredentials-create-seems-to-be/m-p/1490344#M433</link>
      <description>&lt;P&gt;Thanks for your attention on this issue&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/291371"&gt;@Erick_1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've pushed your suggestion to another branch and you can check it out here:&amp;nbsp;&lt;A href="https://github.com/erlingfjelstad/esri-auth-to-map/tree/erick_1-suggestion" target="_blank"&gt;https://github.com/erlingfjelstad/esri-auth-to-map/tree/erick_1-suggestion&lt;/A&gt;&lt;/P&gt;&lt;P&gt;However, I still have a problem when &lt;EM&gt;&lt;STRONG&gt;cold starting the app&lt;/STRONG&gt;&lt;/EM&gt; with airplane mode enabled, then try to authenticate with TokenCredentials.create(), then disable airplane mode and retry to authenticate with TokenCredentials.create()&lt;/P&gt;&lt;P&gt;Since I don't have permission to add a video demonstrating my problem here in this forum, I've uploaded another video to the readme file in the branch you can find on the link above&lt;/P&gt;&lt;P&gt;Again, thanks for your attention&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2024 10:41:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/result-from-tokencredentials-create-seems-to-be/m-p/1490344#M433</guid>
      <dc:creator>ErlDeveloper</dc:creator>
      <dc:date>2024-06-12T10:41:43Z</dc:date>
    </item>
    <item>
      <title>Re: Result from TokenCredentials.create() seems to be cached for the lifetime of Application process</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/result-from-tokencredentials-create-seems-to-be/m-p/1493047#M435</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/291371"&gt;@Erick_1&lt;/a&gt;&amp;nbsp;did you manage to reproduce the issue with the cold starting the app without Internett connection?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2024 21:49:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/result-from-tokencredentials-create-seems-to-be/m-p/1493047#M435</guid>
      <dc:creator>ErlDeveloper</dc:creator>
      <dc:date>2024-06-14T21:49:21Z</dc:date>
    </item>
    <item>
      <title>Re: Result from TokenCredentials.create() seems to be cached for the lifetime of Application process</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/result-from-tokencredentials-create-seems-to-be/m-p/1493942#M436</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/805170"&gt;@ErlDeveloper&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We are able to reproduce the bug when initializing the app without internet. Our team is going to look at for a potential solution.&amp;nbsp;&lt;/P&gt;&lt;P&gt;We will keep you updated when we fix the issue.&lt;/P&gt;&lt;P&gt;Thanks.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 19:11:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/result-from-tokencredentials-create-seems-to-be/m-p/1493942#M436</guid>
      <dc:creator>Erick_1</dc:creator>
      <dc:date>2024-06-17T19:11:44Z</dc:date>
    </item>
  </channel>
</rss>

