forked from bosagora/dms-osx
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add logging message in the Notification
- Loading branch information
1 parent
b99ddc5
commit fc0bc98
Showing
4 changed files
with
35 additions
and
33 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { NotificationSender } from "../src/delegator/NotificationSender"; | ||
|
||
import { Config } from "../src/common/Config"; | ||
import { ContractUtils } from "../src/utils/ContractUtils"; | ||
|
||
async function main() { | ||
// Create with the arguments and read from file | ||
const config = new Config(); | ||
config.readFromFile("config/config.yaml"); | ||
const notification: NotificationSender = new NotificationSender(config, undefined); | ||
|
||
const ids = ["ExponentPushToken[s__I-xJSSmcJCfLRPSobU_]", "ExponentPushToken[gr9g1_GA_54W9mUfYMYPtG]"]; | ||
|
||
for (let idx = 0; idx < 100; idx++) { | ||
await send(notification, ids[idx % 2]); | ||
await ContractUtils.delay(10); | ||
} | ||
} | ||
|
||
async function send(notification: NotificationSender, to: string) { | ||
await notification.send(to, "테스트", "구매처 : 마이클2, 구매 금액 : 100 PHP, 포인트 사용 : 100 POINT", { | ||
type: "info", | ||
}); | ||
} | ||
|
||
main().catch((error) => { | ||
console.error(error); | ||
process.exitCode = 1; | ||
}); |
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