Class MapsInitializerKt

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final static MapsInitializer.Renderer awaitMapsSdkInitialized(Context $self, MapsInitializer.Renderer preferredRenderer) Suspends until the Google Maps SDK is initialized and returns the MapsInitializer.Renderer that was actually loaded.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • awaitMapsSdkInitialized

         final static MapsInitializer.Renderer awaitMapsSdkInitialized(Context $self, MapsInitializer.Renderer preferredRenderer)

        Suspends until the Google Maps SDK is initialized and returns the MapsInitializer.Renderer that was actually loaded.

        Purpose: Provides a modern coroutine suspension alternative to MapsInitializer.initialize with callback handlers, enabling clean, sequential asynchronous SDK initialization.

        How it works: Invokes MapsInitializer.initialize passing an com.google.android.gms.maps.OnMapsSdkInitializedCallback. When the callback fires, it resumes the coroutine with the loaded MapsInitializer.Renderer. If the SDK returns an error status code other than ConnectionResult.SUCCESS and does not invoke the callback, it resumes with GooglePlayServicesNotAvailableException holding the error code.

        Cancellation: This suspending function supports standard coroutine cancellation. Note that the underlying Maps SDK MapsInitializer.initialize operation cannot be cancelled once initiated. Only the first Maps SDK initialization in an application lifecycle honors preferredRenderer; passing null uses the SDK's default preference.

        Parameters:
        preferredRenderer - the renderer to request, or null to use the SDK default preference
        Returns:

        the MapsInitializer.Renderer actually loaded by the Maps SDK