Poes

一个 Swift 命令行工具,可以轻松地向 iOS 模拟器发送推送通知。

Twitter: @twannl

Poes 可以帮助你:

要求

用法

$ poes --help
OVERVIEW: A Swift command-line tool to easily test push notifications to the
iOS simulator

USAGE: poes <subcommand>

OPTIONS:
  -h, --help              Show help information.

SUBCOMMANDS:
  send                    Send a push notification to an app installed on the
                          iOS Simulator
$ poes send --help
OVERVIEW: Send a push notification to an app installed on the iOS Simulator

USAGE: poes send <bundle-identifier> [--title <title>] [--body <body>] [--badge <badge>] [--is-mutable] [--verbose]

ARGUMENTS:
  <bundle-identifier>     The bundle identifier of the app to push to 

OPTIONS:
  -t, --title <title>     The title of the Push notification (default: Default
                          Title)
  -b, --body <body>       The body of the Push notification (default: Default
                          Body)
  -b, --badge <badge>     The number to display in a badge on your app’s icon 
  -i, --is-mutable        Adds the mutable-content key to the payload 
  --verbose               Show extra logging for debugging purposes 
  -h, --help              Show help information.

bundle identifier 是强制性的,所有其他参数都有默认值。 以下命令足以发送一个通知

$ poes send com.wetransfer.app --verbose
Generated payload:

{
  "aps" : {
    "alert" : {
      "title" : "Default title",
      "body" : "Default body"
    },
    "mutable-content" : false
  }
}

Sending push notification...
Push notification sent successfully

使用 Mint 安装

您可以使用 Mint 安装 Poes,如下所示

$ mint install AvdLee/Poes

开发

swift run Poes --help

常见问题

为什么它被称为 "Poes"?

Poes 在荷兰语中是母猫的意思。 它的发音与 "Push" 相同,而推送通知正是我们在这里所做的事情!

为什么会有一个 PoesCore 框架?

这使得最终创建一个带有 UI 的 Mac 应用程序变得非常容易 🚀

我如何自己创建一个 Swift Package?

请查看我的博客文章 在 Xcode 中创建 Swift Package 框架

我可以了解更多关于在 iOS 模拟器上测试推送通知的信息吗?

是的! 我写了一篇关于此的详细博客文章: 在 iOS 模拟器上测试推送通知