Skip to content

W-19408803: Add MainApplication.kt for hybrid Android apps#2930

Open
wmathurin wants to merge 4 commits into
forcedotcom:devfrom
wmathurin:W-19408803-hybrid-main-application
Open

W-19408803: Add MainApplication.kt for hybrid Android apps#2930
wmathurin wants to merge 4 commits into
forcedotcom:devfrom
wmathurin:W-19408803-hybrid-main-application

Conversation

@wmathurin

@wmathurin wmathurin commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Replace HybridApp.java with MainApplication.kt in libs/SalesforceHybrid/src/com/salesforce/androidsdk/phonegap/app/.

MainApplication.kt is the Kotlin replacement for HybridApp — it calls SalesforceHybridSDKManager.initHybrid() and includes commented-out hooks for IDP login and push notifications (matching the pattern in native Android templates). It has a real, valid package so it compiles cleanly as part of the library.

update.sh in CordovaPlugin explicitly copies MainApplication.kt to src/android/ so postinstall-android.js can inject it into generated hybrid apps at a stable path — regardless of whether the app uses the dev composite build or Maven Central (GA).

Also updates the two hybrid sample app manifests (AccountEditor, MobileSyncExplorerHybrid) to reference MainApplication instead of HybridApp.

GUS

W-19408803

Test plan

  • ./gradlew :libs:SalesforceHybrid:compileDebugKotlin passes
  • Generated hybrid app contains MainApplication.kt at correct path with correct package and import
  • App launches and authenticates successfully

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.

1 participant