Skip to content

Commit 98e3a9c

Browse files
committed
feat(android): Publish sentry-android-navigation3 and SentryNavEffect
Commit publishes the sentry-android-navigation3 module, which implements our initial support for Android's [Nav3 library](https://developer.android.com/guide/navigation/navigation-3). It also removes the `@ApiStatus.Internal` annotations from our public Nav3 APIs, including SentryNavEffect. See the SentryNavEffect KDoc and sentry-android-navigation3 README for more details.
1 parent 2cb909d commit 98e3a9c

7 files changed

Lines changed: 16 additions & 6 deletions

File tree

‎.craft.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ targets:
6464
maven:io.sentry:sentry-quartz:
6565
maven:io.sentry:sentry-okhttp:
6666
maven:io.sentry:sentry-android-navigation:
67+
maven:io.sentry:sentry-android-navigation3:
6768
maven:io.sentry:sentry-compose:
6869
maven:io.sentry:sentry-compose-android:
6970
maven:io.sentry:sentry-compose-desktop:

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
### Features
66

7+
- Add support for Android Navigation 3 through the new `sentry-android-navigation3` library. Use `SentryNavEffect` to record navigation transactions, breadcrumbs, screen names, and additional context as your nav back stack changes ([#XXXX](https://github.com/getsentry/sentry-java/pull/XXXX))
78
- Report the cellular network technology generation in `device.connection_effective_type`, for example `4g` or `5g` ([#6146](https://github.com/getsentry/sentry-java/pull/6146))
89

910
### Dependencies

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Sentry SDK for Java and Android
2525
| sentry-android-timber | [![Maven Central Version](https://img.shields.io/maven-central/v/io.sentry/sentry-android-timber?style=for-the-badge&logo=sentry&color=green)](https://central.sonatype.com/artifact/io.sentry/sentry-android-timber) | 21 |
2626
| sentry-android-fragment | [![Maven Central Version](https://img.shields.io/maven-central/v/io.sentry/sentry-android-fragment?style=for-the-badge&logo=sentry&color=green)](https://central.sonatype.com/artifact/io.sentry/sentry-android-fragment) | 21 |
2727
| sentry-android-navigation | [![Maven Central Version](https://img.shields.io/maven-central/v/io.sentry/sentry-android-navigation?style=for-the-badge&logo=sentry&color=green)](https://central.sonatype.com/artifact/io.sentry/sentry-android-navigation) | 21 |
28+
| sentry-android-navigation3 | [![Maven Central Version](https://img.shields.io/maven-central/v/io.sentry/sentry-android-navigation3?style=for-the-badge&logo=sentry&color=green)](https://central.sonatype.com/artifact/io.sentry/sentry-android-navigation3) | 21 |
2829
| sentry-android-sqlite | [![Maven Central Version](https://img.shields.io/maven-central/v/io.sentry/sentry-android-sqlite?style=for-the-badge&logo=sentry&color=green)](https://central.sonatype.com/artifact/io.sentry/sentry-android-sqlite) | 21 |
2930
| sentry-android-replay | [![Maven Central Version](https://img.shields.io/maven-central/v/io.sentry/sentry-android-replay?style=for-the-badge&logo=sentry&color=green)](https://central.sonatype.com/artifact/io.sentry/sentry-android-replay) | 26 |
3031
| sentry-compose-android | [![Maven Central Version](https://img.shields.io/maven-central/v/io.sentry/sentry-compose-android?style=for-the-badge&logo=sentry&color=green)](https://central.sonatype.com/artifact/io.sentry/sentry-compose-android) | 21 |
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# sentry-android-navigation3
2+
3+
[Navigation 3](https://developer.android.com/guide/navigation/navigation-3) instrumentation for the Sentry Android SDK.
4+
5+
Use `SentryNavEffect` alongside your `NavDisplay` to record navigation transactions, breadcrumbs, screen names, and back stack context as
6+
users move around your app. Configure the data you want captured via `SentryNavOptions`.
7+
8+
Because Nav3 back stacks can have arbitrary key types, host apps need to provide `SentryNavEffect` with a mapping between their back stack
9+
keys and the data Sentry should display for each (see `BackStackEntryMapper`).
10+
11+
See the [Navigation for Android docs](https://docs.sentry.io/platforms/android/integrations/navigation/) for additional details, including
12+
installation, configuration, and limitations.

‎sentry-android-navigation3/src/main/kotlin/io/sentry/compose/navigation3/BackStackEntryMapper.kt‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import org.jetbrains.annotations.ApiStatus
55

66
/** Info about a given back stack entry, suitable for display in Sentry. */
77
@ApiStatus.Experimental
8-
@ApiStatus.Internal
98
public class SentryBackStackEntry(
109
/**
1110
* A host-app defined name for a given back stack entry.
@@ -146,7 +145,6 @@ public class SentryBackStackEntry(
146145
* ```
147146
*/
148147
@ApiStatus.Experimental
149-
@ApiStatus.Internal
150148
public fun interface BackStackEntryMapper<T : Any> {
151149
public fun map(backStackEntry: T): SentryBackStackEntry?
152150
}

‎sentry-android-navigation3/src/main/kotlin/io/sentry/compose/navigation3/SentryNavEffect.kt‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ import org.jetbrains.annotations.ApiStatus
4747
* - a new navigation transaction
4848
* - a breadcrumb
4949
* - a screen name
50-
* - a record of the current back stack (last 10 entries)
50+
* - a record of the current back stack (last 5 entries)
5151
*
5252
* You can configure the above defaults via [SentryNavOptions]. (Screen names can be disabled via
5353
* [SentryOptions.setEnableScreenTracking].)
@@ -75,7 +75,6 @@ import org.jetbrains.annotations.ApiStatus
7575
* @param options The kinds of navigation info this effect should record.
7676
*/
7777
@ApiStatus.Experimental
78-
@ApiStatus.Internal
7978
@Composable
8079
public fun <T : Any> SentryNavEffect(
8180
backStack: List<T>,

‎sentry-android-navigation3/src/main/kotlin/io/sentry/compose/navigation3/SentryNavOptions.kt‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ private const val DEFAULT_MAX_CAPTURED_BACK_STACK_ENTRIES = 5
1919
* ```
2020
*/
2121
@ApiStatus.Experimental
22-
@ApiStatus.Internal
2322
@Immutable
2423
public class SentryNavOptions
2524
private constructor(
@@ -116,6 +115,5 @@ private constructor(
116115
* ```
117116
*/
118117
@ApiStatus.Experimental
119-
@ApiStatus.Internal
120118
public fun SentryNavOptions(configure: SentryNavOptions.Builder.() -> Unit = {}): SentryNavOptions =
121119
SentryNavOptions.Builder().apply(configure).build()

0 commit comments

Comments
 (0)