Skip to content

Commit 9125a63

Browse files
[interactive_media_ads] Fixes AdEventTypes not triggering on iOS in release mode (#8918)
Because `_delegate` was an unused field, Dart would garbage collect the value in release mode. To prevent this, this adds the `@pragma('vm:entry-point')` to indicate that the value is an entry point for the platform side. See the comment above the field. Fixes flutter/flutter#163049 ## Pre-Review Checklist [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
1 parent f95a24f commit 9125a63

File tree

5 files changed

+8
-3
lines changed

5 files changed

+8
-3
lines changed

packages/interactive_media_ads/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.2.3+10
2+
3+
* Fixes `AdEventType`s not triggering on iOS in release mode.
4+
15
## 0.2.3+9
26

37
* Bumps gradle from 8.0.0 to 8.9.0.

packages/interactive_media_ads/android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/AdsRequestProxyApi.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class AdsRequestProxyApi(override val pigeonRegistrar: ProxyApiRegistrar) :
2121
*
2222
* This must match the version in pubspec.yaml.
2323
*/
24-
const val pluginVersion = "0.2.3+9"
24+
const val pluginVersion = "0.2.3+10"
2525
}
2626

2727
override fun setAdTagUrl(pigeon_instance: AdsRequest, adTagUrl: String) {

packages/interactive_media_ads/ios/interactive_media_ads/Sources/interactive_media_ads/AdsRequestProxyAPIDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class AdsRequestProxyAPIDelegate: PigeonApiDelegateIMAAdsRequest {
1313
/// The current version of the `interactive_media_ads` plugin.
1414
///
1515
/// This must match the version in pubspec.yaml.
16-
static let pluginVersion = "0.2.3+9"
16+
static let pluginVersion = "0.2.3+10"
1717

1818
func pigeonDefaultConstructor(
1919
pigeonApi: PigeonApiIMAAdsRequest, adTagUrl: String, adDisplayContainer: IMAAdDisplayContainer,

packages/interactive_media_ads/lib/src/ios/ios_ads_manager.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class IOSAdsManager extends PlatformAdsManager {
2222
// This must maintain a reference to the delegate because the native
2323
// `IMAAdsManagerDelegate.delegate` property is only a weak reference.
2424
// Therefore, this would be garbage collected without this explicit reference.
25+
@pragma('vm:entry-point')
2526
// ignore: unused_field
2627
late IOSAdsManagerDelegate _delegate;
2728

packages/interactive_media_ads/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: interactive_media_ads
22
description: A Flutter plugin for using the Interactive Media Ads SDKs on Android and iOS.
33
repository: https://github.com/flutter/packages/tree/main/packages/interactive_media_ads
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+interactive_media_ads%22
5-
version: 0.2.3+9 # This must match the version in
5+
version: 0.2.3+10 # This must match the version in
66
# `android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/AdsRequestProxyApi.kt` and
77
# `ios/interactive_media_ads/Sources/interactive_media_ads/AdsRequestProxyAPIDelegate.swift`
88

0 commit comments

Comments
 (0)