[TIMOB-26102] Android: Push notifications should create default channel if not assigned when targeting Android 8
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-06-07T00:51:46.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 7.3.0 |
Components | Android |
Labels | android, notification, pushnotification |
Reporter | Joshua Quick |
Assignee | Gary Mathews |
Created | 2018-06-06T01:42:36.000+0000 |
Updated | 2018-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.
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
FR Passed. PR Merged.
[~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.
titanium_mobile-7_3_X: https://github.com/appcelerator/titanium_mobile/pull/10119
Verified with SDK 7.3.0.v20180618182516. Cloudpush 5.1.2 is included with the SDK. Closing.