Skip to content

Commit

Permalink
Docs fixes (#135)
Browse files Browse the repository at this point in the history
  • Loading branch information
kober32 authored Mar 5, 2024
1 parent ee125bc commit 71b0e13
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 49 deletions.
2 changes: 1 addition & 1 deletion docs/Language-Configuration.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Language Configuration

Before using any methods from this SDK that call the backend, a proper language should be set. A properly translated content is served based on this configuration. The property that stores language settings is not persisted. You need to set `acceptLanguage` every time that the application boots.
Before using any methods from this SDK that call the backend, a proper language should be set. A properly translated content is served based on this configuration. The property that stores language settings does not persist. You need to set `acceptLanguage` every time that the application boots.

<!-- begin box warning -->
Note: Content language capabilities are limited by the implementation of the server - it must support the provided language.
Expand Down
8 changes: 4 additions & 4 deletions docs/Logging.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Logging

For logging purposes, WMT uses `Logger` class inside the `com.wultra.android.mtokensdk.common` package that prints to the console.
For logging purposes, WMT uses the `Logger` class inside the `com.wultra.android.mtokensdk.common` package that prints to the console.

<!-- begin box warning -->
Note that `Logger` is internally using `android.util.Log` class with verbosity ERROR, WARNING, and DEBUG and is subjected to its internal logic.
<!-- end -->

### Verbosity Level

You can limit the amount of logged information via `verboseLevel` static property.
You can limit the amount of logged information via the `verboseLevel` static property.

| Level | Description |
| --- | --- |
Expand All @@ -27,8 +27,8 @@ Logger.verboseLevel = Logger.VerboseLevel.DEBUG

### Networking Logs

All requests and responses are logged in `DEBUG` level.
All requests and responses are logged in the `DEBUG` level.

<!-- begin box warning -->
In case that you provided your own OkHttp instance, you need to setup your own logging for monitoring the traffic via the OkHttp interceptors.
In case you provided your own OkHttp instance, you need to set up your own logging for monitoring the traffic via the OkHttp interceptors.
<!-- end -->
12 changes: 6 additions & 6 deletions docs/Operation-Expiration.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ If you're creating your own custom operation by implementing the `IOperation` in

If the device is [registered to receive push notifications](Using-Push-Service.md), it will receive an [`PushMessageOperationFinished `](https://github.com/wultra/mtoken-sdk-android/blob/develop/library/src/main/java/com/wultra/android/mtokensdk/push/PushParser.kt#L80#docucheck-keep-link) notification with the [`TIMEOUT `](https://github.com/wultra/mtoken-sdk-android/blob/develop/library/src/main/java/com/wultra/android/mtokensdk/push/PushParser.kt#L115#docucheck-keep-link) result when the operation expires.

Operation list should be refreshed on such notification.
The operation list should be refreshed on such notification.


Please be aware that push notifications are not guaranteed to be received. There are several scenarios where push notification delivery will fail, such as:

- user didn't grant notification permission to your app
- network error occurred
- notification token has expired and is waiting for renewal
- the notification token has expired and is waiting for renewal
- ... other situations not under the developer's control

## Local Handling
Expand All @@ -32,7 +32,7 @@ Server and client device time could differ! You should never remove the operatio

### OperationExpirationWatcher

Utility class that will observe operations and informs you when it expired.
Utility class that will observe operations and inform you when it expires.

#### Sample Implementation

Expand All @@ -44,20 +44,20 @@ class OperationsManager(private val ops: IOperationsService) {

init {
operationWatcher.listener = object : OperationExpirationWatcherListener {
// operationsExpired is called on main thread
// operationsExpired is called on the main thread
override fun operationsExpired(expiredOperations: List<ExpirableOperation>) {
// some operation expired, refresh the list
launchFetchOperations()
// this behavior could be improved for example with
// checking if the expired operations is currently displayed etc..
// checking if the expired operations are currently displayed etc..
}
}
}

fun launchFetchOperations() {
ops.getOperations(object : IGetOperationListener {
override fun onSuccess(operations: List<UserOperation>) {
// simplified but working example how operations can be observed for expiration
// simplified but working example of how operations can be observed for expiration
operationWatcher.removeAll()
operationWatcher.add(operations)
// process operations
Expand Down
3 changes: 2 additions & 1 deletion docs/SDK-Integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ implementation "com.wultra.android.powerauth:powerauth-sdk:1.x.y"
|-------------------|---|
| `1.0.x` - `1.2.x` | `1.0.x` - `1.5.x` |
| `1.3.x` - `1.4.x` | `1.6.x` |
| `1.5.x` - `1.6.x` | `1.7.x` |
| `1.5.x` - `1.7.x` | `1.7.x` |
| `1.8.x` - `1.9.x` | `1.8.x` |


10 changes: 5 additions & 5 deletions docs/Using-Inbox-Service.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
Inbox Service is responsible for managing messages in the Inbox. The inbox is a simple one way delivery system that allows you to deliver messages to the user.

<!-- begin box warning -->
Note: Before using Inbox Service, you need to have a `PowerAuthSDK` object available and initialized with a valid activation. Without a valid PowerAuth activation, service will return an error.
Note: Before using Inbox Service, you need to have a `PowerAuthSDK` object available and initialized with a valid activation. Without a valid PowerAuth activation, the service will return an error.
<!-- end -->

## Creating an Instance
Expand All @@ -31,7 +31,7 @@ fun PowerAuthSDK.createInboxService(appContext: Context, baseURL: String, strate

- `appContext` - application context
- `baseURL` - address, where your operations server can be reached
- `strategy` - strategy used when validating HTTPS requests. Following strategies can be used:
- `strategy` - a strategy used when validating HTTPS requests. The following strategies can be used:
- `SSLValidationStrategy.default`
- `SSLValidationStrategy.noValidation`
- `SSLValidationStrategy.sslPinning`
Expand Down Expand Up @@ -76,7 +76,7 @@ inboxService.getUnreadCount {
}
```

### Get List of Messages
### Get a List of Messages

The Inbox Service provide a paged list of messages:

Expand Down Expand Up @@ -112,7 +112,7 @@ inboxService.getAllMessages {

### Get Message Detail

Each message has its unique identifier. To get the body of message, use the following code:
Each message has its unique identifier. To get the body of the message, use the following code:

```kotlin
let messageId = messagesList.first!.id
Expand All @@ -129,7 +129,7 @@ inboxService.getMessageDetail(messageId) {

### Set Message as Read

To mark message as read by the user, use the following code:
To mark the message as read by the user, use the following code:

```kotlin
let messageId = messagesList.first!.id
Expand Down
Loading

0 comments on commit 71b0e13

Please sign in to comment.