[TIMOB-26319] iOS: "usernotificationsettings" does not include "types" array on iOS 10 and SDK 7.3.0
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-08-21T07:11:14.000+0000 |
Affected Version/s | Release 7.3.0 |
Fix Version/s | Release 7.3.1 |
Components | iOS |
Labels | n/a |
Reporter | Hans Knöchel |
Assignee | Hans Knöchel |
Created | 2018-08-20T06:25:43.000+0000 |
Updated | 2018-08-21T10:54:20.000+0000 |
Description
When using iOS 10+ on SDK 7.3.0, the "usernotificationsettings" event does not include the "types" array of granted types anymore. An easy workaround is to use the following code, but ideally it should be 100 % backwards compatible.
Workaround:
Ti.App.iOS.NotificationCenter.requestUserNotificationSettings(event => {
const alertSetting = event.alertSetting;
const badgeSetting = event.badgeSetting;
const soundSetting = event.soundSetting;
if (alertSetting === Ti.App.iOS.USER_NOTIFICATION_SETTING_ENABLED) {
// Alert allowed
}
});
PR (master): https://github.com/appcelerator/titanium_mobile/pull/10267 PR (7_3_X): https://github.com/appcelerator/titanium_mobile/pull/10268 Test-Case:
*Closing ticket*. Verified fix with SDK version:
7.3.1.v20180821020403
and7.4.0.v20180820235132
. "usernotificationsettings" now includes "types" array on iOS 10+ and SDK 7.3.0.Created a titanium application with the test case above
Ran the program
Pressed the
Trigger
button on the applicationAble to see the console log show more information (iOS 10+) ("usernotificationsettings" including "types" array)
Previously only the following information would be seen on iOS 10+ (7.3.0.GA)
*Test Environment*