Network notifications
AppInspect can post a notification for each captured API call, so you can watch traffic go past without keeping the inspector open. On Android 13 and newer there is one thing your app has to do, and if you skip it nothing appears and nothing explains why.
What a notification shows
The method, the status code, the host and the path — and deliberately nothing else. No headers, no bodies, no tokens ever reach the notification shade, because a notification can be read on a lock screen or mirrored to a watch.
Tapping one opens the inspector on that exact request. A call answered by a mock rule
is marked: a MOCK · title prefix, an amber tint, and a group
summary that counts mocked calls separately. See Mocks.
Android 13+ needs a runtime permission
AppInspect declares POST_NOTIFICATIONS in its own manifest, so the
permission is merged into your app — you do not need to declare it yourself. But
the library has no Activity of its own, which means it cannot show the
permission prompt. Only the host app can do that.
Without the grant there is no error, no toast and no log line. Notifications simply never appear. If you expect them and see nothing on Android 13 or newer, check the permission before anything else.
Requesting it from your app
Ask at whatever moment suits your app — on first launch of a debug build, or from your own debug menu. Treat the answer as best effort: if the user declines, everything else in the inspector still works.
private val notificationPermission =
registerForActivityResult(
ActivityResultContracts.RequestPermission()
) { /* best effort — the rest of the inspector works either way */ }
private fun requestNotificationPermissionIfNeeded() {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) return
val granted = ContextCompat.checkSelfPermission(
this,
Manifest.permission.POST_NOTIFICATIONS,
) == PackageManager.PERMISSION_GRANTED
if (!granted) {
notificationPermission.launch(Manifest.permission.POST_NOTIFICATIONS)
}
}
On Android 12 and older no runtime grant exists, so notifications work as soon as the library is enabled — which is why this only bites when someone upgrades a test device.
Turning them off
Notifications are on by default. Switch them off when the build is going to a wider audience, when lock-screen visibility matters, or when a chatty app makes the shade unusable:
AppInspectEntryPoints(networkNotificationsEnabled = false)
Capture itself is unaffected — calls still show up in the Network panel. And in a release build the notification channel is never even created; see the security model.