Skip to content

Commit e9cbbef

Browse files
committed
TRIAGE-179: Update docs
1 parent 2869ab3 commit e9cbbef

1 file changed

Lines changed: 32 additions & 3 deletions

File tree

README.md

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,22 @@ Import the `SuccessResponse` and `FailureResponse` classes to write proper callb
480480

481481
#### Identify
482482

483-
The following is a full Identify example with error and success handling. You can adapt the following example with `login`, `modify`, and `logout`.
483+
You can call `identify` without any parameters to identify with the current user's identities:
484+
485+
```dart
486+
mpInstance?.identity
487+
.identify()
488+
.then(
489+
(IdentityApiResult successResponse) =>
490+
print("Success Response: $successResponse"),
491+
onError: (error) {
492+
var failureResponse = error as IdentityAPIErrorResponse;
493+
print("Failure Response: $failureResponse");
494+
}
495+
);
496+
```
497+
498+
Or with an identity request. The following is a full example with error and success handling. You can adapt the following example with `login`, `modify`, and `logout`.
484499

485500
```dart
486501
import 'package:mparticle_flutter_sdk/identity/identity_api_result.dart';
@@ -542,7 +557,22 @@ mpInstance?.identity
542557

543558
#### Login
544559

545-
Partial example - you can adapt the identify example above with login, modify, and logout.
560+
You can call `login` without any parameters:
561+
562+
```dart
563+
mpInstance?.identity
564+
.login()
565+
.then(
566+
(IdentityApiResult successResponse) =>
567+
print("Success Response: $successResponse"),
568+
onError: (error) {
569+
var failureResponse = error as IdentityAPIErrorResponse;
570+
print("Failure Response: $failureResponse");
571+
}
572+
);
573+
```
574+
575+
Or with an identity request:
546576

547577
```dart
548578
var identityRequest = MparticleFlutterSdk.identityRequest;
@@ -561,7 +591,6 @@ mpInstance?.identity.login(identityRequest: identityRequest).then(
561591
var failureResponse = error as IdentityAPIErrorResponse;
562592
print("Failure Response: $failureResponse");
563593
});
564-
565594
```
566595

567596
#### Modify

0 commit comments

Comments
 (0)