Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions knowledge/android/MASVS-PLATFORM/MASTG-KNOW-0054.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
masvs_category: MASVS-PLATFORM
platform: android
title: App Notifications
---

Android apps use [notifications](https://developer.android.com/develop/ui/views/notifications "About notifications") to provide information to users outside the app's UI. A basic notification can contain an icon, a title, and text content, which can be configured using [`NotificationCompat.Builder`](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder "NotificationCompat.Builder") methods such as `setContentTitle` and `setContentText`. On Android 13 (API level 33) and higher, posting non-exempt notifications is subject to the [`POST_NOTIFICATIONS`](https://developer.android.com/develop/ui/compose/notifications/notification-permission "Notification runtime permission") runtime permission.
Comment thread
mateofumis marked this conversation as resolved.
Outdated

- Notifications can appear on the device's lock screen. Apps can control the level of detail displayed on a secure lock screen using [`setVisibility`](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder#setVisibility(int) "setVisibility") with `VISIBILITY_PUBLIC`, `VISIBILITY_PRIVATE`, or `VISIBILITY_SECRET`. For private notifications, [`setPublicVersion`](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder#setPublicVersion(android.app.Notification) "setPublicVersion") can provide alternative content to display when the full notification is hidden. Users retain control over lock screen visibility through the system notification settings.

- Apps can implement a [`NotificationListenerService`](https://developer.android.com/reference/android/service/notification/NotificationListenerService "NotificationListenerService") to receive system callbacks when notifications are posted or removed after the user grants notification access. The receiving app can process or retain the notification content independently of the app that posted it. Starting with Android 15 (API level 35), the system prevents [untrusted notification listeners from reading unredacted content from notifications in which an OTP is detected](https://developer.android.com/about/versions/15/behavior-changes-all#otp_redaction "OTP Redaction").
Comment thread
mateofumis marked this conversation as resolved.
Outdated
13 changes: 0 additions & 13 deletions knowledge/android/MASVS-STORAGE/MASTG-KNOW-0054.md

This file was deleted.

13 changes: 13 additions & 0 deletions knowledge/ios/MASVS-PLATFORM/MASTG-KNOW-0x01.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
masvs_category: MASVS-PLATFORM
platform: ios
title: App Notifications
---

iOS provides developers with _local_ and _remote_ [app notifications](https://developer.apple.com/notifications/ "Notifications") to communicate relevant information to the user. Notifications can display an alert, play a sound, or badge the app's icon.
Comment thread
mateofumis marked this conversation as resolved.

While useful, app notifications also have privacy implications:

- For remote notifications, the [APNs payload](https://developer.apple.com/documentation/usernotifications/generating-a-remote-notification "APNs payload") can define user-visible content such as the notification's `title`, `subtitle`, and `body`. When notification previews are hidden, notification categories can use the [`hiddenPreviewsShowTitle`](https://developer.apple.com/documentation/usernotifications/unnotificationcategoryoptions/hiddenpreviewsshowtitle "hiddenPreviewsShowTitle") and [`hiddenPreviewsShowSubtitle`](https://developer.apple.com/documentation/usernotifications/unnotificationcategoryoptions/hiddenpreviewsshowsubtitle "hiddenPreviewsShowSubtitle") options to keep the title or subtitle visible, while [`hiddenPreviewsBodyPlaceholder`](https://developer.apple.com/documentation/usernotifications/unnotificationcategory/hiddenpreviewsbodyplaceholder "hiddenPreviewsBodyPlaceholder") defines placeholder text to display instead of the notification body.

- Notifications can appear on the device's Lock Screen and display their content according to the user's notification preview settings. iOS allows users to control when [notification previews](https://support.apple.com/guide/iphone/change-notification-settings-iph7c3d96bab/ios#:~:text=Prevent%20notification%20previews%20from%20appearing%20on%20the%20Lock%20Screen "Prevent notification previews from appearing on the Lock Screen") are shown, while apps can customize the content displayed when previews are hidden using notification categories.
Loading