Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add notifications management delegate methods to CarPlayManagerDelegate. #3828

Conversation

MaximAlien
Copy link
Contributor

@MaximAlien MaximAlien commented Apr 15, 2022

Description

PR adds CarPlayManagerDelegate.carPlayManager(_:shouldUpdateNotificationFor:with:in:) and CarPlayManagerDelegate.carPlayManager(_:shouldShowNotificationFor:in:) methods that allow to control notifications presentation on CarPlay while application is in background.

@MaximAlien MaximAlien added UI Work related to visual components, Android Auto, Camera, 3D, voice, etc. CarPlay Bugs, improvements and feature requests on Apple CarPlay labels Apr 15, 2022
@MaximAlien MaximAlien added this to the v2.5 milestone Apr 15, 2022
@MaximAlien MaximAlien requested a review from a team April 15, 2022 00:40
@MaximAlien MaximAlien self-assigned this Apr 15, 2022
Comment on lines +331 to +332
Determines if the maneuver should be presented as a notification when the app is in the
background.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious why it can't control notifications when the app isn't in the background?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that CarPlay behavior is similar to iOS, when iOS app is in foreground notification will not be shown. Interestingly UNUserNotificationCenter also allows to show generic notification on CarPlay using something like:

UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .badge, .carPlay]) { granted, error in
    UNUserNotificationCenter.current().getNotificationSettings { notificationSettings in
        print("carPlaySetting: \(notificationSettings.carPlaySetting.rawValue)")
    }
}

but carPlaySetting is always disabled. Not sure if it's a problem on my side or it's not really supported after all.

…For:with:in:)` and `CarPlayManager.carPlayManager(_:shouldShowNotificationFor:in:)` methods that allow to control notifications presentation on CarPlay.
@MaximAlien MaximAlien force-pushed the maxim/3827-add-notifications-related-delegate-methods-on-car-play branch from 89f5618 to ef92c2c Compare April 19, 2022 21:19
@MaximAlien MaximAlien merged commit d0fe8e0 into main Apr 19, 2022
@MaximAlien MaximAlien deleted the maxim/3827-add-notifications-related-delegate-methods-on-car-play branch April 19, 2022 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CarPlay Bugs, improvements and feature requests on Apple CarPlay UI Work related to visual components, Android Auto, Camera, 3D, voice, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants