@ -13,7 +13,7 @@ import { GenericServerRecord, containsHiddenDid } from "@/libs/endorserServer";
import * as serverUtil from "@/libs/endorserServer" ;
// eslint-disable-next-line @typescript-eslint/no-var-requires
const Buffer = require ( "buffer/" ) . Buffer ;
//const Buffer = require("buffer/").Buffer;
export const PRIVACY_MESSAGE =
"The data you send be visible to the world -- except: your IDs and the IDs of anyone you tag will stay private, only visible to those you allow." ;
@ -241,7 +241,7 @@ export const generateSaveAndActivateIdentity = async (): Promise<string> => {
} ;
export const sendTestThroughPushServer = async (
subscription : PushSubscription ,
subscription : PushSubscriptionJSON ,
skipFilter : boolean ,
) : Promise < AxiosResponse > = > {
await db . open ( ) ;
@ -256,6 +256,8 @@ export const sendTestThroughPushServer = async (
// Use something other than "Daily Update" https://gitea.anomalistdesign.com/trent_larson/py-push-server/src/commit/3c0e196c11bc98060ec5934e99e7dbd591b5da4d/app.py#L213
const DIRECT_PUSH_TITLE = "DIRECT_NOTIFICATION" ;
/ * * r e m o v e i f t h e P u s h S u b s c r i p t i o n J S O N a p p r o a c h w o r k s
*
const auth = Buffer . from ( subscription . getKey ( "auth" ) ) ;
const authB64 = auth
. toString ( "base64" )
@ -278,6 +280,14 @@ export const sendTestThroughPushServer = async (
skipFilter ? "un" : ""
} filtered . ` ,
title : skipFilter ? DIRECT_PUSH_TITLE : "Your Web Push" ,
} ;
*
* * /
const newPayload = {
// eslint-disable-next-line prettier/prettier
message : ` Test, where you will see this message ${ skipFilter ? "un" : "" } filtered. ` ,
title : skipFilter ? DIRECT_PUSH_TITLE : "Your Web Push" ,
. . . subscription ,
} ;
console . log ( "Sending a test web push message:" , newPayload ) ;
const payloadStr = JSON . stringify ( newPayload ) ;