Skip to content

Use Android notification channels #120

@Panda2a

Description

@Panda2a

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 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions