Skip to content

Commit

Permalink
Merge pull request #31 from Keyri-Co/releases/1.7.2
Browse files Browse the repository at this point in the history
Fixed sendEvent on Android
  • Loading branch information
AndrewKuliahin96 authored Mar 8, 2024
2 parents dfcab7e + 0051f72 commit f1c4e4a
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ on:

jobs:
publish:
permissions:
id-token: write
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.7.2

- Fixed `sendEvent` issue on Android

## 1.7.1

- Updated Android SDK
Expand Down
8 changes: 7 additions & 1 deletion android/src/main/kotlin/com/keyrico/keyri/KeyriPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import io.flutter.plugin.common.PluginRegistry.Registrar
import io.flutter.plugin.common.MethodChannel
import io.flutter.plugin.common.MethodChannel.MethodCallHandler
import io.flutter.plugin.common.MethodChannel.Result
import java.lang.Exception

class KeyriPlugin : FlutterPlugin, MethodCallHandler, ActivityAware,
PluginRegistry.ActivityResultListener {
Expand Down Expand Up @@ -369,7 +370,12 @@ class KeyriPlugin : FlutterPlugin, MethodCallHandler, ActivityAware,
result: MethodChannel.Result
) {
keyriCoroutineScope("sendEvent", result::error).launch {
val jsonMetadata = metadata?.let(::JSONObject)
val jsonMetadata = try {
metadata?.let { JSONObject(it) }
} catch (e: Exception) {
null
}

val type = eventType?.let { EventType.custom(it, jsonMetadata) }

if (success == null) {
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: keyri_example
version: 1.7.1
version: 1.7.2
description: Demonstrates how to use the Keyri plugin.
publish_to: 'none'

Expand Down
2 changes: 1 addition & 1 deletion ios/Classes/KeyriPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
} else if ([@"sendEvent" isEqualToString:call.method]) {
[self sendEvent:call result:result];
} else if ([@"createFingerprint" isEqualToString:call.method]) {
[self sendEvent:call result:result];
[self createFingerprint:call result:result];
} else if ([@"initiateQrSession" isEqualToString:call.method]) {
[self initiateQrSession:call result:result];
} else if ([@"login" isEqualToString:call.method]) {
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: keyri_v3
description: Keyri QR Login plugin for Flutter. Provides Keyri SDK capabilities for secure and passwordless login.
version: 1.7.1
version: 1.7.2
homepage: https://keyri.com

environment:
Expand Down

0 comments on commit f1c4e4a

Please sign in to comment.