-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from Keyri-Co/feature/new_event_structure
Updated SDK-s, added new `createFingerprint` method, updated Events s…
- Loading branch information
Showing
16 changed files
with
179 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import 'dart:convert'; | ||
|
||
/// Class which represents fingerprint request object. | ||
class FingerprintRequest { | ||
FingerprintRequest( | ||
this.clientEncryptionKey, this.encryptedPayload, this.salt, this.iv); | ||
|
||
final String clientEncryptionKey; | ||
final String encryptedPayload; | ||
final String salt; | ||
final String iv; | ||
|
||
/// Conversion helper method. | ||
static FingerprintRequest fromJson(dynamic json) { | ||
dynamic jsonData = json; | ||
|
||
try { | ||
String jsonDataString = json.toString(); | ||
jsonData = jsonDecode(jsonDataString); | ||
} catch (e) { | ||
jsonData = json; | ||
} | ||
|
||
return FingerprintRequest( | ||
jsonData['clientEncryptionKey'] as String, | ||
jsonData['encryptedPayload'] as String, | ||
jsonData['salt'] as String, | ||
jsonData['iv'] as String); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,51 @@ | ||
// ignore_for_file: constant_identifier_names | ||
/// Fingerprint event type. | ||
enum EventType { | ||
visits, | ||
login, | ||
signup, | ||
attach_new_device, | ||
email_change, | ||
profile_update, | ||
password_reset, | ||
withdrawal, | ||
deposit, | ||
purchase; | ||
/// Class which represents fingerprint event type. | ||
class EventType { | ||
EventType(this.name, {this.metadata}); | ||
|
||
final String name; | ||
Map<String, dynamic>? metadata; | ||
|
||
/// Returns Visits event. | ||
static EventType visits({Map<String, dynamic>? metadata}) => | ||
EventType("visits", metadata: metadata); | ||
|
||
/// Returns Login event. | ||
static EventType login({Map<String, dynamic>? metadata}) => | ||
EventType("login", metadata: metadata); | ||
|
||
/// Returns signup event. | ||
static EventType signup({Map<String, dynamic>? metadata}) => | ||
EventType("signup", metadata: metadata); | ||
|
||
/// Returns Attach new device event. | ||
static EventType attachNewDevice({Map<String, dynamic>? metadata}) => | ||
EventType("attach_new_device", metadata: metadata); | ||
|
||
/// Returns Email change event. | ||
static EventType emailChange({Map<String, dynamic>? metadata}) => | ||
EventType("emailChange", metadata: metadata); | ||
|
||
/// Returns Profile update event. | ||
static EventType profileUpdate({Map<String, dynamic>? metadata}) => | ||
EventType("profile_update", metadata: metadata); | ||
|
||
/// Returns Password reset event. | ||
static EventType passwordReset({Map<String, dynamic>? metadata}) => | ||
EventType("password_reset", metadata: metadata); | ||
|
||
/// Returns Withdrawal event. | ||
static EventType withdrawal({Map<String, dynamic>? metadata}) => | ||
EventType("withdrawal", metadata: metadata); | ||
|
||
/// Returns Deposit event. | ||
static EventType deposit({Map<String, dynamic>? metadata}) => | ||
EventType("deposit", metadata: metadata); | ||
|
||
/// Returns Purchase event. | ||
static EventType purchase({Map<String, dynamic>? metadata}) => | ||
EventType("purchase", metadata: metadata); | ||
|
||
/// Returns Custom event. | ||
static EventType custom(String name, {Map<String, dynamic>? metadata}) => | ||
EventType(name, metadata: metadata); | ||
} |
Oops, something went wrong.