Skip to content

[MOB-24978] refresh InApp bug fix#160

Merged
navratan-soni merged 2 commits into
adobe:dev-5.1.0from
Harjot1508:hsk/inappFix
Jun 3, 2026
Merged

[MOB-24978] refresh InApp bug fix#160
navratan-soni merged 2 commits into
adobe:dev-5.1.0from
Harjot1508:hsk/inappFix

Conversation

@Harjot1508

@Harjot1508 Harjot1508 commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Description

On Android, refreshInAppMessages was inlined in the method channel handler as:

"refreshInAppMessages" -> result.success(Messaging.refreshInAppMessages())

Since Messaging.refreshInAppMessages() returns void, Kotlin implicitly passes Unit into result.success(...) instead of null, causing a type mismatch on the Flutter/Dart method channel response.

The fix extracts this into a dedicated private method that calls Messaging.refreshInAppMessages() first, then explicitly returns result.success(null) — consistent with all other void-returning methods in the
plugin.

Related Issue

MOB-24978

Motivation and Context

Messaging.refreshInAppMessages() was not functioning correctly on Android due to the incorrect method channel result type being returned (Unit instead of null). The iOS implementation
(SwiftFlutterAEPMessagingPlugin) already handles this correctly and this fix brings Android to parity.

How Has This Been Tested?

- Existing Dart unit tests verified — the refreshInAppMessages test confirms the correct method is invoked with null arguments
- Manually called Messaging.refreshInAppMessages() from a Flutter app on an Android device and confirmed no type error is thrown on the method channel response

Screenshots (if appropriate):

N/A

Types of changes

[x] Bug fix (non-breaking change which fixes an issue)

Checklist:

[X] I have signed the Adobe Open Source CLA.
[x] My code follows the code style of this project.
[-] My change requires a change to the documentation.
[-] I have updated the documentation accordingly.
[x] I have read the CONTRIBUTING document.
[-] I have added tests to cover my changes.
[x] All new and existing tests passed.

@Harjot1508 Harjot1508 closed this Jun 3, 2026
@Harjot1508 Harjot1508 reopened this Jun 3, 2026
@navratan-soni navratan-soni changed the base branch from main to dev-5.1.0 June 3, 2026 07:57
@navratan-soni navratan-soni merged commit 6bf2ad0 into adobe:dev-5.1.0 Jun 3, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants