[MOD-2385] Android: Ti.Cloud support for Oreo NotificationChannels
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Critical |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Cloud |
Labels | android, push, ti.cloud |
Reporter | Michael Gangolf |
Assignee | Unknown |
Created | 2017-12-29T11:43:45.000+0000 |
Updated | 2019-01-29T16:59:39.000+0000 |
Description
*Problem*
When you target Android 8.0 (API level 26), you must implement one or more notification channels to display notifications to your users.
With the current Ti.Cloud you'll see a Toast notification that the NotificationChannel is null: https://i.stack.imgur.com/JCS2e.jpg
*Solution:*
https://stackoverflow.com/a/47135605/5193915
https://stackoverflow.com/a/47974065/5193915
*More infos*
https://medium.com/exploring-android/exploring-android-o-notification-channels-94cd274f604c
*Platform*
Titanium SDK 7.0.1
Ti.Cloud 3.2.11
Android Oreo
Hello, Thanks for the Ticket, Our engineers will look into it.
I find that if you do something like this in your app if (OS_ANDROID) { var apiLevel = parseInt(Ti.Platform.Android.API_LEVEL, 10); if (apiLevel > 25) { var channel = Ti.Android.NotificationManager.createNotificationChannel({ id: 'channel_name', name: 'All Users', importance: Ti.Android.IMPORTANCE_DEFAULT }); } } you can send a push to it via GCM using a payload like data: { payload: { android: { alert: "test", title: "test", channelId: "channel_name" } } } but I cannot do this via the app dashboard in ACS, the app throws an error "no valid small icon"