BlackBerry Dynamics for .NET Maui  12.0.0.9
Runtime library for .NET Maui applications
BBDXamarinForms.Common.Interfaces.LogManager.IBBDLogManager Interface Reference

More...

Public Member Functions

bool DetailedLoggingFor (long duration)
 
bool StartUpload ()
 
bool CancelUpload ()
 Call this method to cancel the upload of activity logs, which would have been started by calling StartUpload. Upload cannot be resumed after cancellation. More...
 
bool SuspendUpload ()
 Call this method to suspend the upload of activity logs, which would have been started by calling StartUpload. Upload can be resumed after suspension. More...
 
bool ResumeUpload ()
 Call this method to resume the upload of activity logs after suspension. Upload would have been suspended by calling SuspendUpload. More...
 
void OpenLogUploadUI ()
 

Properties

BBDLogUploadState UploadState [get]
 Gets the current upload state. More...
 
long UploadBytesSent [get]
 The amount of data sent so far. More...
 
long UploadBytesTotal [get]
 The total data to be sent. More...
 
long DetailedMaximumDuration [get]
 Maximum duration of user detailed logging. More...
 

Events

EventHandler LogUploadChanged
 

Detailed Description

This class contains a number of programming interfaces for managing BlackBerry Dynamics activity logs.

The BlackBerry Dynamics Runtime logs its activity to files in the secure store on the device. The application can use the programming interface in this class to:

  • Initiate upload of activity log files to a central server.
  • Show a BlackBerry Dynamics user interface for monitoring the upload process.
  • Implement a custom user interface for monitoring the upload process.
  • Switch on detailed logging, if allowed by enterprise policies.

Member Function Documentation

◆ CancelUpload()

bool BBDXamarinForms.Common.Interfaces.LogManager.IBBDLogManager.CancelUpload ( )

Call this method to cancel the upload of activity logs, which would have been started by calling StartUpload. Upload cannot be resumed after cancellation.

Returns
true, if upload was canceled OK, false otherwise or if this application is in the Wiped state.

◆ DetailedLoggingFor()

bool BBDXamarinForms.Common.Interfaces.LogManager.IBBDLogManager.DetailedLoggingFor ( long  duration)

Call this method to switch on detailed logging by the BlackBerry Dynamics Runtime.

The runtime writes more messages to its activity log if detailed logging is switched on. Detailed logging slows down the runtime, and increases the amount of device storage occupied by the activity logs in the secure store. For these reasons, detailed logging can only be switched on by the application for a specified duration, and there is a maximum allowed duration. The maximum duration is 15 minutes and is given by the DetailedMaximumDuration property.

Detailed activity logging can also be switched on by the BlackBerry Dynamics management console, in which there are a number of options. Check the user interface and documentation of the management console for details.

The ability to switch on detailed logging from the application code can be blocked by enterprise policy. See the BBDAppConfigKeyPreventUserDetailedLogs item in the collection returned by the IBBDXamarin.GetApplicationConfig method.

Detailed activity logging can be switched off by the application code, if it was switched on by the application code. If detailed logging is switched on by the managment console then it cannot be switched off by the application code. Switch off detailed logging by calling this method and passing zero or a negative duration.

Returns
true, if the parameter value is less than or equal to the maximum allowed duration, false otherwise.
Parameters
durationlong representation of the duration for which detailed logging is to be switched on, in milliseconds. On iOS, value will be rounded down to full seconds. Pass zero or a negative number to switch off detailed logging.

◆ OpenLogUploadUI()

void BBDXamarinForms.Common.Interfaces.LogManager.IBBDLogManager.OpenLogUploadUI ( )

This method opens a complete user interface that gives the user an option to start uploading activity log files, then displays progress and a number of management options.

The upload user interface is built in to the BlackBerry Dynamics Runtime. This method makes it possible to include the upload user interface in the application's own user interface. It is an alternative to implementing a whole user interface in the application code, using the other methods in this class.

◆ ResumeUpload()

bool BBDXamarinForms.Common.Interfaces.LogManager.IBBDLogManager.ResumeUpload ( )

Call this method to resume the upload of activity logs after suspension. Upload would have been suspended by calling SuspendUpload.

Returns
true, if upload was resumed OK, false otherwise or if this application is in the Wiped state.

◆ StartUpload()

bool BBDXamarinForms.Common.Interfaces.LogManager.IBBDLogManager.StartUpload ( )

Call this method to upload the current activity log files for support purposes. The logs will be uploaded to a server in the BlackBerry Dynamics Network Operation Center (NOC).

BlackBerry Dynamics support staff have access to the server to which log files are uploaded, and can use the data for support analysis.

This method can be used to upload logs even if BlackBerry Dynamics authorization has failed. The user identifier with which the application was activated will be needed by support staff, to identify uploaded files. The user identifier is typically the end user's enterprise email address. If authorization has failed or been cancelled without a user identifier being successfully entered, then no logs will be uploaded.

The upload takes place in background and will be retried as necessary by the runtime. Progress can be monitored and managed by using the programming interface of this class.

The OpenLogUploadUI method opens a complete built-in user interface that displays progress and gives the user a number of options to manage the upload.

The other methods in this class could be utilized instead, to implement a custom log upload user interface in the application code.

The runtime makes a copy of its current activity log files when this method is called. The copy is retained until upload completes or is cancelled. If an earlier log upload is still in progress when this method is called, the current activity log files are added to the in-progress upload.

Returns
true, if upload was started OK, false otherwise or if this application is in the Wiped state.

◆ SuspendUpload()

bool BBDXamarinForms.Common.Interfaces.LogManager.IBBDLogManager.SuspendUpload ( )

Call this method to suspend the upload of activity logs, which would have been started by calling StartUpload. Upload can be resumed after suspension.

Returns
true, if upload was suspended OK, false otherwise or if this application is in the Wiped state.

Property Documentation

◆ DetailedMaximumDuration

long BBDXamarinForms.Common.Interfaces.LogManager.IBBDLogManager.DetailedMaximumDuration
get

Maximum duration of user detailed logging.

◆ UploadBytesSent

long BBDXamarinForms.Common.Interfaces.LogManager.IBBDLogManager.UploadBytesSent
get

The amount of data sent so far.

long representing the amount of data sent so far, in bytes.

◆ UploadBytesTotal

long BBDXamarinForms.Common.Interfaces.LogManager.IBBDLogManager.UploadBytesTotal
get

The total data to be sent.

long representing the total data to be sent, in bytes.

◆ UploadState

BBDLogUploadState BBDXamarinForms.Common.Interfaces.LogManager.IBBDLogManager.UploadState
get

Gets the current upload state.

BBDLogUploadState value representing the current upload state.

Event Documentation

◆ LogUploadChanged

EventHandler BBDXamarinForms.Common.Interfaces.LogManager.IBBDLogManager.LogUploadChanged

In the case that the application implements a custom user interface, it can be notified of progress by the BlackBerry Dynamics Runtime. A notification will be dispatched by the runtime when there is any change to the upload state, or to the amount of data uploaded.

For example, a notification would be dispatched when:

  • Log upload has finished.
  • The number of bytes sent so far has increased.

When a notification is received, the application code could determine the new status and then update the user interface accordingly, for example:

  • Update a progress bar to reflect the new number of bytes sent.
  • Show or hide an option for the end user to cancel upload, based on whether there is an upload in progress.

Implementation of an observer of log upload notifications is only required if the application has its own monitoring user interface. It should be easier to display the built-in monitoring user interface, by calling the OpenLogUploadUI method.