Facing problem while getting Network & Security Logs for profile owner app.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2023 04:05 AM
The project I am working on is a Profile Owner Application. I want to get the Network logs. I have successfully enabled the NetworkLogging and checked the Network logging enable status by isNetworkLoggingEnabled() and setNetworkLoggingEnabled() methods.
Now I want to get the network logs using the retrieveNetworkLogs() method. which requires the parameter "batchToken : Long."
I have tried several ways to get the batchToken but have failed to get it. Now, I want your kind opinion on how to get the batchToken value and solve this problem by calling the retrieveNetworkLogs() method.
Thank you for your time.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2023 04:48 AM
Hello,
When using the Android Management API, logs are sent to your servers using Pub/Sub notifications the guide is available here: https://developers.google.com/android/management/notifications
Have you subscribed to the USAGE_LOGS notifications for your enterprise and setup Pub/Sub accordingly?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2023 07:25 PM
Thank you for your kind replay.
My app is a profile owner app in a dedicated profile in Android Management Api.
So it has the permissions to access the Network logs, according to the following documentation: https://developer.android.com/work/dpc/logging#java.
All I am stuck is in the batchToken value. Can you give me some idea to where to get this batchToken ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2023 12:34 AM
This is the documentation to retrieve the batch token https://developer.android.com/reference/android/app/admin/DeviceAdminReceiver#onNetworkLogsAvailable...
But, as you're using Android Management API I'm not sure this is the correct way to retrieve those logs as DPC is only for EMM API and you're currently using the Android Management API
- Securing your Business: Checklist for Android device offboarding in Tips & guides
- Work Profile Password Complexity affects Personal Space device password that unlocks the device : Intune in General discussions
- Android 14 - App in EMM work profile failing with android.security.KeyStoreException: Keystore not initialized in General discussions
- Exporting the MDM (Security) policy installed in my Work Profile (BYOD) in General discussions