Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Android notification channels #120

Open
Panda2a opened this issue Dec 21, 2018 · 1 comment
Open

Use Android notification channels #120

Panda2a opened this issue Dec 21, 2018 · 1 comment

Comments

@Panda2a
Copy link

Panda2a commented Dec 21, 2018

SDK version : 7.5.0.GA
Ti.Goosh version 4.2.0

Hi,

No way to use push notifications with custom sound on android device with android 8.1.

1) I declare a notification channel in the app.js

var channelAlerte = null;
if (Ti.Platform.Android.API_LEVEL >= 26) {
channelAlerte = Ti.Android.NotificationManager.createNotificationChannel({
id: "channel_alerte",
name: "Alertes test",
importance: Ti.Android.IMPORTANCE_HIGH,
sound: soundPath,
enableVibration : true,
enableLights : true,
description : "Test channel"
});

  1. I send a push message using FCM with the following payload

{
"registration_ids":["X","Y"],
"data":{"data":{
"alert":"My test",
"title":"Test",
"sound":"dummySound",
"idalerte":"327",
"android_channel_id":"channel_alerte"
}
}
}

The push notification is received on the device but on the default channel : the default sound is played and not my custom sound

The sound is well positioned in the res/raw folder.
On the studio console, i have the ti.Goosh notification "W/ti.goosh.IntentService: Show Notification: TRUE"

Does anybody know where could be the problem ?

Perhaps is the problem coming from the fact that there's no field in Ti.Goosh to detect the notification channel sent in the payload or no way to set the default notification channel sound ?

@furthurr
Copy link

furthurr commented Feb 6, 2019

https://docs.appcelerator.com/platform/latest/#!/guide/Titanium_SDK_7.5.0.GA_Release_Note

TIMOB-26484 - Android: Add "sound" support to NotificationChannel

Added sound support to NotificationChannel

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

No branches or pull requests

2 participants