Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26102] Android: Push notifications should create default channel if not assigned when targeting Android 8

GitHub Issuen/a
TypeImprovement
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2018-06-07T00:51:46.000+0000
Affected Version/sn/a
Fix Version/sRelease 7.3.0
ComponentsAndroid
Labelsandroid, notification, pushnotification
ReporterJoshua Quick
AssigneeGary Mathews
Created2018-06-06T01:42:36.000+0000
Updated2018-06-19T17:54:03.000+0000

Description

*Summary:* Our APS library (which implements Android push notifications) correctly uses Google's DEFAULT_CHANNEL_ID on Android 8 when targeting API Level 25 or lower. [APSCloudPush.java#L409](https://github.com/appcelerator/aps_sdk/blob/897b735961c10ce1b6e74f9fd48b48edb4eec83e/android/cloudpush/APSCloudPush/src/main/java/com/appcelerator/aps/APSCloudPush.java#L409) However, when targeting API Level 26 or higher, you cannot use Google's DEFAULT_CHANNEL_ID which means notifications will fail to be posted to the status bar. So, the APS library must be changed to create its own default notification channel if one was not supplied from the payload... and it should only do so when targeting API Level 26 or higher. *Recommended Solution:* We should use a similar solution used by Titanium's local notifications as shown here... https://github.com/appcelerator/titanium_mobile/pull/9945 It probably should use a separate notification channel name than what Titanium uses. This may be needed to avoid collision with how Titanium configures its channel.

Comments

  1. Gary Mathews 2018-06-06

    aps_cloudpush: https://github.com/appcelerator/aps_sdk/pull/321 cloudpush: https://github.com/appcelerator-modules/cloudpush/pull/41 ti.cloudpush: https://github.com/appcelerator-modules/cloudpush/releases/tag/android-5.1.2
  2. Lokesh Choudhary 2018-06-07

    FR Passed. PR Merged.
  3. Lokesh Choudhary 2018-06-18

    [~gmathews], we would need to update the cloud push module version in the SDK so that 5.1.2 cloud push module can be included with the SDK 7.3.0 & master.
  4. Gary Mathews 2018-06-18

    titanium_mobile-7_3_X: https://github.com/appcelerator/titanium_mobile/pull/10119
  5. Lokesh Choudhary 2018-06-19

    Verified with SDK 7.3.0.v20180618182516. Cloudpush 5.1.2 is included with the SDK. Closing.

JSON Source