Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
b72914e
example app
Feb 4, 2026
4ef0742
fetch user and ordering
Feb 10, 2026
252fb7b
updated prompt
Feb 10, 2026
3578d69
cleanup after PR
Feb 10, 2026
180a493
better ui
Feb 11, 2026
a4b538f
updated the md file
Feb 11, 2026
17ee771
Update tooltip_content.json
nan-li Feb 11, 2026
54295dc
compose and other
Feb 11, 2026
8aa5232
update local prompt for now
fadi-george Feb 11, 2026
2b1623b
fix discrepancies with prompt
fadi-george Feb 11, 2026
c1616fd
fix onesignal logo
fadi-george Feb 11, 2026
5c4f6f6
fix image notification example
fadi-george Feb 11, 2026
8d43a93
fix themeing of in app message buttons
fadi-george Feb 11, 2026
96e1a05
remove prompt md in favor of sdk-shared prompt
fadi-george Feb 12, 2026
e99ceaa
fix theme of the toggles
fadi-george Feb 12, 2026
a38e0e5
add multipair dialog logic
fadi-george Feb 12, 2026
2c20523
add remove collection dialog and logic
fadi-george Feb 12, 2026
459d012
update logic for track event example
fadi-george Feb 12, 2026
55318b0
update theme back to red
fadi-george Feb 12, 2026
3fc1358
fix init state logic
fadi-george Feb 12, 2026
dc4b90d
more clean up
fadi-george Feb 12, 2026
05132d1
Merge origin/samplev2 - keep Compose, add batch methods
Feb 12, 2026
75c8f6e
Add batch operations UI in Compose
Feb 12, 2026
d21efb2
Fix notification with image not working
Feb 12, 2026
e93bc06
Add IAM type icons and improve toast messages
Feb 12, 2026
3c5a9cd
Update BUILDING_THE_APP.md with Compose architecture
Feb 12, 2026
b0bc42b
cleaned up sample app
Feb 12, 2026
bc68ae7
cleanup
Feb 12, 2026
b0bac1a
log view and updating build prompt
Feb 12, 2026
ac4c3d9
updating the prompt
Feb 12, 2026
e204773
add back onesignal logo
fadi-george Feb 12, 2026
23b8c30
make buttons fullwidth
fadi-george Feb 12, 2026
278b6d9
adjust button spacing
fadi-george Feb 12, 2026
6e89098
move buttons outside cards
fadi-george Feb 12, 2026
8d3eb8b
remove double splash screen
fadi-george Feb 12, 2026
6295f3b
adjust dialog layout
fadi-george Feb 12, 2026
e7eb75e
ui clean up
fadi-george Feb 12, 2026
9b3bc2b
fix log key to avoid crash
fadi-george Feb 12, 2026
52b4aeb
fix inconsistencies
fadi-george Feb 12, 2026
6af6ce7
dont double fetch
fadi-george Feb 12, 2026
185e4c4
adjust prompt
fadi-george Feb 12, 2026
9e002a5
adjust textfield colors
fadi-george Feb 12, 2026
38855d6
add consent required toggle
fadi-george Feb 12, 2026
d3adc50
hide remove alias(es) for now
fadi-george Feb 12, 2026
2579731
additional ui tweaks
fadi-george Feb 12, 2026
cd61b05
tweak app bar
fadi-george Feb 12, 2026
63841ca
other tweaks
fadi-george Feb 12, 2026
90820c7
be clear on iam values
fadi-george Feb 13, 2026
b5c643a
update iam titles to be uppercase
fadi-george Feb 13, 2026
8e9d78a
adjust dialogs styles
fadi-george Feb 13, 2026
771e7dc
prompt tweaks
fadi-george Feb 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 96 additions & 0 deletions Examples/OneSignalDemoV2/app/agconnect-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
{
"agcgw":{
"backurl":"connect-dre.hispace.hicloud.com",
"url":"connect-dre.dbankcloud.cn",
"websocketbackurl":"connect-ws-dre.hispace.dbankcloud.com",
"websocketurl":"connect-ws-dre.hispace.dbankcloud.cn"
},
"agcgw_all":{
"CN":"connect-drcn.dbankcloud.cn",
"CN_back":"connect-drcn.hispace.hicloud.com",
"DE":"connect-dre.dbankcloud.cn",
"DE_back":"connect-dre.hispace.hicloud.com",
"RU":"connect-drru.hispace.dbankcloud.ru",
"RU_back":"connect-drru.hispace.dbankcloud.cn",
"SG":"connect-dra.dbankcloud.cn",
"SG_back":"connect-dra.hispace.hicloud.com"
},
"websocketgw_all":{
"CN":"connect-ws-drcn.hispace.dbankcloud.cn",
"CN_back":"connect-ws-drcn.hispace.dbankcloud.com",
"DE":"connect-ws-dre.hispace.dbankcloud.cn",
"DE_back":"connect-ws-dre.hispace.dbankcloud.com",
"RU":"connect-ws-drru.hispace.dbankcloud.ru",
"RU_back":"connect-ws-drru.hispace.dbankcloud.cn",
"SG":"connect-ws-dra.hispace.dbankcloud.cn",
"SG_back":"connect-ws-dra.hispace.dbankcloud.com"
},
"client":{
"cp_id":"5190001000034239317",
"product_id":"388421841221340564",
"client_id":"1103097158011211392",
"client_secret":"14843C60CAFDCFD5E50025C14864697AFF55886BCF00558E8C817F141E0B4704",
"project_id":"388421841221340564",
"app_id":"107780279",
"api_key":"DAEDAN06wwm3fsiHbQaQzugegFDUc6lpsR9VZGRNoWEbjHpDphR5rSbobUr5/ohT1WlRTyIykjr4GzzEJ/jSxlziFmXF/8e56HAYiw==",
"package_name":"com.onesignal.sdktest"
},
"oauth_client":{
"client_id":"107780279",
"client_type":1
},
"app_info":{
"app_id":"107780279",
"package_name":"com.onesignal.sdktest"
},
"service":{
"analytics":{
"collector_url":"datacollector-dre.dt.hicloud.com,datacollector-dre.dt.dbankcloud.cn",
"collector_url_ru":"datacollector-drru.dt.dbankcloud.ru,datacollector-drru.dt.hicloud.com",
"collector_url_sg":"datacollector-dra.dt.hicloud.com,datacollector-dra.dt.dbankcloud.cn",
"collector_url_de":"datacollector-dre.dt.hicloud.com,datacollector-dre.dt.dbankcloud.cn",
"collector_url_cn":"datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn",
"resource_id":"p1",
"channel_id":""
},
"edukit":{
"edu_url":"edukit.edu.cloud.huawei.com.cn",
"dh_url":"edukit.edu.cloud.huawei.com.cn"
},
"search":{
"url":"https://search-dre.cloud.huawei.com"
},
"cloudstorage":{
"storage_url_sg_back":"https://agc-storage-dra.cloud.huawei.asia",
"storage_url_ru_back":"https://agc-storage-drru.cloud.huawei.ru",
"storage_url_ru":"https://agc-storage-drru.cloud.huawei.ru",
"storage_url_de_back":"https://agc-storage-dre.cloud.huawei.eu",
"storage_url_de":"https://ops-dre.agcstorage.link",
"storage_url":"https://agc-storage-drcn.platform.dbankcloud.cn",
"storage_url_sg":"https://ops-dra.agcstorage.link",
"storage_url_cn_back":"https://agc-storage-drcn.cloud.huawei.com.cn",
"storage_url_cn":"https://agc-storage-drcn.platform.dbankcloud.cn"
},
"ml":{
"mlservice_url":"ml-api-dre.ai.dbankcloud.com,ml-api-dre.ai.dbankcloud.cn"
}
},
"region":"DE",
"configuration_version":"3.0",
"appInfos":[
{
"package_name":"com.onesignal.sdktest",
"client":{
"app_id":"107780279"
},
"app_info":{
"package_name":"com.onesignal.sdktest",
"app_id":"107780279"
},
"oauth_client":{
"client_type":1,
"client_id":"107780279"
}
}
]
}
136 changes: 136 additions & 0 deletions Examples/OneSignalDemoV2/app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
plugins {
id(Plugins.androidApplication)
id(Plugins.kotlinAndroid)
}

// Apply GMS or Huawei plugin based on build variant
// Check at configuration time, not when task graph is ready
val taskRequests = gradle.startParameter.taskRequests.toString().lowercase()
if (taskRequests.contains("gms")) {
apply(plugin = Plugins.googleServices)
} else if (taskRequests.contains("huawei")) {
apply(plugin = Plugins.huaweiAgconnect)
}

// OneSignal SDK version - can be overridden via gradle property SDK_VERSION
val sdkVersion: String = rootProject.findProperty("SDK_VERSION") as? String ?: Versions.oneSignalSdk

android {
namespace = AppConfig.applicationId
compileSdk = Versions.compileSdk

defaultConfig {
minSdk = Versions.minSdk
targetSdk = Versions.targetSdk
versionCode = Versions.versionCode
versionName = Versions.versionName
multiDexEnabled = true

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

buildFeatures {
compose = true
}

composeOptions {
kotlinCompilerExtensionVersion = Versions.composeCompiler
}

flavorDimensions += "default"

productFlavors {
create("gms") {
dimension = "default"
applicationId = AppConfig.applicationId
}
create("huawei") {
dimension = "default"
minSdk = Versions.minSdk
applicationId = AppConfig.applicationId
}
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
debug {
isDebuggable = true
}
create("profileable") {
initWith(getByName("release"))
isDebuggable = false
isProfileable = true
isMinifyEnabled = false
signingConfig = signingConfigs.getByName("debug")
matchingFallbacks += listOf("release")
}
}

kotlinOptions {
jvmTarget = "1.8"
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

packaging {
resources {
excludes += "androidsupportmultidexversion.txt"
}
}
}

dependencies {
// Kotlin
implementation(Dependencies.kotlinStdlib)
implementation(Dependencies.coroutinesAndroid)

// AndroidX
implementation(Dependencies.multidex)
implementation(Dependencies.appcompat)
implementation(Dependencies.coreKtx)

// Compose BOM
implementation(platform(Dependencies.composeBom))
implementation(Dependencies.composeUi)
implementation(Dependencies.composeUiGraphics)
implementation(Dependencies.composeUiToolingPreview)
implementation(Dependencies.composeMaterial3)
implementation(Dependencies.composeMaterialIcons)
implementation(Dependencies.composeRuntime)
implementation(Dependencies.composeRuntimeLivedata)
debugImplementation(Dependencies.composeUiTooling)

// Activity & Lifecycle Compose
implementation(Dependencies.activityCompose)
implementation(Dependencies.lifecycleViewModelCompose)
implementation(Dependencies.lifecycleRuntimeCompose)

// Lifecycle
implementation(Dependencies.lifecycleViewModelKtx)
implementation(Dependencies.lifecycleRuntimeKtx)

// Google Play Services
implementation(Dependencies.playServicesLocation)

// OneSignal - Google Play Builds
"gmsImplementation"("com.onesignal:OneSignal:$sdkVersion")

// OneSignal - Huawei Builds
"huaweiImplementation"("com.onesignal:OneSignal:$sdkVersion") {
exclude(group = "com.google.android.gms", module = "play-services-gcm")
exclude(group = "com.google.android.gms", module = "play-services-analytics")
exclude(group = "com.google.android.gms", module = "play-services-location")
exclude(group = "com.google.firebase", module = "firebase-messaging")
}
"huaweiImplementation"(Dependencies.huaweiPush)
"huaweiImplementation"(Dependencies.huaweiLocation)
}
30 changes: 30 additions & 0 deletions Examples/OneSignalDemoV2/app/google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"project_info": {
"project_number": "249481192614",
"firebase_url": "https://onesignaltest-e7802.firebaseio.com",
"project_id": "onesignaltest-e7802",
"storage_bucket": "onesignaltest-e7802.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:249481192614:android:9d39e24e24034b14",
"android_client_info": {
"package_name": "com.onesignal.sdktest"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyC2H_Z5NRhKVJsoG6dLwzSrH3aLNm7p3sw"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
}
}
}
],
"configuration_version": "1"
}
21 changes: 21 additions & 0 deletions Examples/OneSignalDemoV2/app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
17 changes: 17 additions & 0 deletions Examples/OneSignalDemoV2/app/src/huawei/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:name=".application.MainApplication">

<service
android:name="com.onesignal.sdktest.notification.HmsMessageServiceAppLevel"
android:exported="false">
<intent-filter>
<action android:name="com.huawei.push.action.MESSAGING_EVENT" />
</intent-filter>
</service>

</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
package com.onesignal.sdktest.notification

import android.os.Bundle
import android.util.Log
import com.huawei.hms.push.HmsMessageService
import com.huawei.hms.push.RemoteMessage
import com.onesignal.notifications.bridges.OneSignalHmsEventBridge

/**
* HMS Message Service for handling Huawei Push notifications.
* This service forwards all push events to the OneSignal SDK.
*
* Note: This is the Huawei flavor-specific implementation.
*/
class HmsMessageServiceAppLevel : HmsMessageService() {

companion object {
private const val TAG = "OneSignalHMS"
}

/**
* When an app calls the getToken method to apply for a token from the server,
* if the server does not return the token during current method calling,
* the server can return the token through this method later.
* This method callback must be completed in 10 seconds.
* Otherwise, you need to start a new Job for callback processing.
*/
override fun onNewToken(token: String, bundle: Bundle) {
Log.d(TAG, "HmsMessageServiceAppLevel onNewToken refresh token: $token bundle: $bundle")

// Forward event on to OneSignal SDK
OneSignalHmsEventBridge.onNewToken(this, token, bundle)
}

@Deprecated("Deprecated in Java")
override fun onNewToken(token: String) {
Log.d(TAG, "HmsMessageServiceAppLevel onNewToken refresh token: $token")

// Forward event on to OneSignal SDK
OneSignalHmsEventBridge.onNewToken(this, token)
}

/**
* This method is called in the following cases:
* 1. "Data messages" - App process is alive when received.
* 2. "Notification Message" - foreground_show = false and app is in focus
* This method callback must be completed in 10 seconds.
* Start a new Job if more time is needed.
*/
override fun onMessageReceived(message: RemoteMessage) {
Log.d(TAG, "HMS onMessageReceived: $message")
Log.d(TAG, "HMS onMessageReceived.ttl: ${message.ttl}")
Log.d(TAG, "HMS onMessageReceived.data: ${message.data}")

message.notification?.let { notification ->
Log.d(TAG, "HMS onMessageReceived.title: ${notification.title}")
Log.d(TAG, "HMS onMessageReceived.body: ${notification.body}")
Log.d(TAG, "HMS onMessageReceived.icon: ${notification.icon}")
Log.d(TAG, "HMS onMessageReceived.color: ${notification.color}")
Log.d(TAG, "HMS onMessageReceived.channelId: ${notification.channelId}")
Log.d(TAG, "HMS onMessageReceived.imageURL: ${notification.imageUrl}")
Log.d(TAG, "HMS onMessageReceived.tag: ${notification.tag}")
}

// Forward event on to OneSignal SDK
OneSignalHmsEventBridge.onMessageReceived(this, message)
}
}
Loading