chore: update Android demo app and build guide#2583
Merged
fadi-george merged 8 commits into5.7-mainfrom Mar 18, 2026
Merged
Conversation
Let OneSignal SDK handle notification channel creation automatically instead of creating channels manually in MainApplication.
abdulraqeeb33
approved these changes
Mar 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
One Line Summary
Overhaul the Android demo app to follow the shared build guide, fix bugs, and clean up code.
Details
Motivation
The Android demo app needed to be updated to align with the new shared build guide (
sdk-shared/demo/build.md), add missing features, fix bugs, and follow best practices.Scope
All changes are scoped to
examples/— no SDK source changes.Build guide:
build.mdwith a concise Android-specific guide that references the shared generic guideDemo app features:
android_channel_idreferencing the dashboard-configured channel withvine_boom.wav)Bug fixes:
onUserStateChangecallback to dismiss — now callsfetchUserDataFromApi()directly)vine_boom.wav(was an HTML page, replaced with actual WAV file)Code cleanup:
android.util.LogwithLogManagerin Repository so logs appear in the in-app log viewpromptPush()through the repository instead of callingOneSignal.NotificationsdirectlyMainViewModel.onCleared()— was only removing push subscription observer, now removes all three (push, permission, user state)OneSignalService— extractedgetSubscriptionIdIfOptedIn(),postJson(), andsendNotificationPayload()helpersSharedPreferenceUtil.exists(), fixedgetOneSignalAppId()return type fromString?toStringkotlinx.coroutines.delay(100)and duplicate error loggingNotificationChannelcreation (SDK handles it via dashboard config)MainApplicationinitializationTesting
Manual testing
Affected code checklist
Checklist
Overview
Testing
Final pass
Made with Cursor