You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
companion object {
@Volatile private var instance: GoogleMobileAdsConsentManager? = null
fun getInstance(context: Context) =
instance
?: synchronized(this) {
instance ?: GoogleMobileAdsConsentManager(context).also { instance = it }
}
}
If for any reason (e.g. configuration change) this or another activity try to get an instance of GoogleMobileAdsConsentManager they will ask for an instance with the actual context but will get an instance for the original activity context - of the now old and dead MainActivity. This might be the cause for #441. But even if it isn't this doesn't seem memory safe at all.
Can UserMessagingPlatform.getConsentInformation() work with an application context?
If so GoogleMobileAdsConsentManager.getInstance() should get an application context instead of an activity context.
If not GoogleMobileAdsConsentManager should not use singleton pattern.
The text was updated successfully, but these errors were encountered:
MainActivity gets an instance of GoogleMobileAdsConsentManager using its activity context via
GoogleMobileAdsConsentManager is a singleton:
If for any reason (e.g. configuration change) this or another activity try to get an instance of GoogleMobileAdsConsentManager they will ask for an instance with the actual context but will get an instance for the original activity context - of the now old and dead MainActivity. This might be the cause for #441. But even if it isn't this doesn't seem memory safe at all.
Can
UserMessagingPlatform.getConsentInformation()
work with an application context?If so
GoogleMobileAdsConsentManager.getInstance()
should get an application context instead of an activity context.If not GoogleMobileAdsConsentManager should not use singleton pattern.
The text was updated successfully, but these errors were encountered: