aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2020-03-06 23:31:35 +0530
committerFlorian Dold <florian.dold@gmail.com>2020-03-06 23:31:35 +0530
commitc5c308661e1080b30c20b1e50d1072b269f4a482 (patch)
tree98e9649385312851c56d1f3b7c33cb4cd18c31f5 /src
parent4e76edf129229823281c2a662392249c32a1c7a2 (diff)
give payload notification to Android
Diffstat (limited to 'src')
-rw-r--r--src/android/index.ts15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/android/index.ts b/src/android/index.ts
index 20d83d71a..351d89249 100644
--- a/src/android/index.ts
+++ b/src/android/index.ts
@@ -33,6 +33,7 @@ import {
} from "../util/http";
import { NodeHttpLib } from "../headless/NodeHttpLib";
import { OperationFailedAndReportedError } from "../operations/errors";
+import { WalletNotification } from "../types/notifications";
// @ts-ignore: special built-in module
//import akono = require("akono");
@@ -140,8 +141,10 @@ class AndroidWalletMessageHandler {
switch (operation) {
case "init": {
this.walletArgs = {
- notifyHandler: async () => {
- sendAkonoMessage(JSON.stringify({ type: "notification" }));
+ notifyHandler: async (notification: WalletNotification) => {
+ sendAkonoMessage(
+ JSON.stringify({ type: "notification", payload: notification }),
+ );
},
persistentStoragePath: args.persistentStoragePath,
httpLib: this.httpLib,
@@ -290,7 +293,13 @@ export function installAndroidWalletListener() {
console.log(
`android listener: sending success response for ${operation} (${id})`,
);
- const respMsg = { type: "response", id, operation, isError: false, result };
+ const respMsg = {
+ type: "response",
+ id,
+ operation,
+ isError: false,
+ result,
+ };
sendMessage(JSON.stringify(respMsg));
} catch (e) {
const respMsg = {