Skip to content

Fix Kotlin compiler warnings (#439)#441

Open
NickSxti wants to merge 3 commits intodevelopfrom
nch/fix-issue-439-kotlin-warnings
Open

Fix Kotlin compiler warnings (#439)#441
NickSxti wants to merge 3 commits intodevelopfrom
nch/fix-issue-439-kotlin-warnings

Conversation

@NickSxti
Copy link
Copy Markdown
Contributor

@NickSxti NickSxti commented Apr 30, 2026

Summary

Fixes the React Native deprecation warning from #439 in android/src/main/java/com/qonversion/reactnativesdk/QonversionModule.kt:26.

ActivityProvider.currentActivity getter no longer references BaseJavaModule.getCurrentActivity() (deprecated in RN 0.80.0). Replaced this@QonversionModule.currentActivity with reactApplicationContext.currentActivity, which resolves to ReactContext.getCurrentActivity() (a Java method, not deprecated). This silences both the deprecation warning and the Kotlin synthetic-property warning.

The third warning from #439 (override-vs-supertype param-name mismatch on onDeferredPurchaseCompleted) is the symptom of sandwich-sdk declaring the supertype param as transaction while iOS and the RN bridge use purchaseResult (cross-platform-aligned, see commit 801d40d). That will be addressed at the root via a sandwich-sdk PR renaming the supertype param; this PR intentionally leaves the warning in place.

Single-file change, +1/-1.

Closes #439

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
NickSxti and others added 2 commits April 30, 2026 19:44
The previous commit renamed the onDeferredPurchaseCompleted override
parameter to match the supertype's transaction name, but that reverted
a deliberate review-driven rename (commit 801d40d) that aligned Android
with iOS (RNQonversion.mm uses purchaseResult). Restore purchaseResult
and silence the Kotlin override-mismatch warning with @Suppress
instead of renaming.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Removing the @Suppress annotation. The override-vs-supertype param-name
warning is the root-cause symptom of sandwich-sdk's QonversionEventsListener
declaring 'transaction' while iOS and the rest of the RN bridge use
'purchaseResult'. That will be fixed at the source via a sandwich-sdk PR
to rename the supertype param. After that lands and we bump
io.qonversion:sandwich, this override will silently match. Until then,
the warning is acceptable.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Build issue on expo EAS

2 participants