{"id":10021343,"date":"2026-04-25T14:28:41","date_gmt":"2026-04-25T06:28:41","guid":{"rendered":"https:\/\/itmax.cn\/?p=10021343"},"modified":"2026-04-25T14:28:41","modified_gmt":"2026-04-25T06:28:41","slug":"%e8%87%aa%e5%bb%ba%e5%ae%89%e5%8d%93%e6%b6%88%e6%81%af%e6%8e%a8%e9%80%81%e4%b8%8e%e9%80%9a%e7%9f%a5%e6%9c%8d%e5%8a%a1-ntfy%ef%bc%8c%e5%92%8cios%e7%9a%84bark%e5%b7%ae%e4%b8%8d%e5%a4%9a%e6%95%88","status":"publish","type":"post","link":"https:\/\/itmax.cn\/?p=10021343","title":{"rendered":"\u81ea\u5efa\u5b89\u5353\u6d88\u606f\u63a8\u9001\u4e0e\u901a\u77e5\u670d\u52a1 &#8211; ntfy\uff0c\u548ciOS\u7684Bark\u5dee\u4e0d\u591a\u6548\u679c"},"content":{"rendered":"<h2>\u6458\u8981<\/h2>\n<p>\u4e4b\u524d\u5199\u8fc7Gotify\uff1a<a href=\"https:\/\/segmentfault.com\/a\/1190000047531644\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/segmentfault.com\/a\/1190000047531644<\/a><\/p>\n<p>\u73b0\u5728\u53c8\u4e86\u89e3\u5230\u4e00\u4e2a\u65e0\u9700\u90e8\u7f72\u670d\u52a1\u7684\u6d88\u606f\u63a8\u9001 &#8211; ntfy<\/p>\n<p>\u76f8\u5173\u94fe\u63a5\uff1a<br \/><a href=\"https:\/\/link.segmentfault.com\/?enc=NSEW5IOk4MYqdPumincicg%3D%3D.b96zGVjiVe7Yq73GNdPsJXrqfPxqAnrb9OEb9InmFUrCHslNY9NyBR14kkpup8zevni95fGC49OQP30ae7Bnvg%3D%3D\" rel=\"nofollow noopener noreferrer\" target=\"_blank\">https:\/\/f-droid.org\/zh_Hans\/packages\/io.heckel.ntfy\/<\/a><br \/><a href=\"https:\/\/link.segmentfault.com\/?enc=UD6nkZqaxz6irCRKgtVhsA%3D%3D.nO7Eu6NMwTJ%2BGMTlg6faYuKnu6imqzzbMLmaA7iIWZc%3D\" rel=\"nofollow noopener noreferrer\" target=\"_blank\">https:\/\/ntfy.sh\/<\/a><\/p>\n<h2>\u4e0b\u8f7d\u5ba2\u6237\u7aef<\/h2>\n<p><a href=\"https:\/\/link.segmentfault.com\/?enc=trWBoLpK%2FWDbLX%2FrUiSWgA%3D%3D.so6PI1tDMdP7HnFIjhT3ZKzAmjkqXWZ7wIH0g0oqqj1wXAUM1ecOvKq%2FJYWHyo0%2Frv%2FpEpPQQdPgLxDb4gK2YA%3D%3D\" rel=\"nofollow noopener noreferrer\" target=\"_blank\">https:\/\/github.com\/binwiederhier\/ntfy-android\/releases<\/a><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"723\" height=\"347\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/bVdooPF\" alt=\"image.png\" title=\"image.png\"><\/p>\n<p>\u5b89\u88c5\u540e\uff0c\u6253\u5f00app\u521b\u5efa\u4e00\u4e2a\u8ba2\u9605\u4e3b\u9898\uff0c\u81ea\u5df1\u547d\u540d\uff0c\u5efa\u8bae\u590d\u6742\u4e00\u4e9b\uff0c\u4ee5\u514d\u548c\u522b\u4eba\u4e00\u6837\u3002<\/p>\n<p><img decoding=\"async\" width=\"723\" height=\"763\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/bVdooPV\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<h2>\u670d\u52a1\u7aef<\/h2>\n<p>\u53ea\u9700\u8981\u66ff\u6362\u4e0b\u65b9\u5ba2\u6237\u7aef\u7684\u4e3b\u9898\u540d\u79f0\u5c31\u884c\u3002<\/p>\n<pre><code>&lt;?php\n\n\/\/ \u83b7\u53d6\u53c2\u6570\n$topic    = $_GET['topic']    ?? '\u5ba2\u6237\u7aef\u7684\u4e3b\u9898\u540d\u79f0';\n$title    = $_GET['title']    ?? '';\n$message  = $_GET['message']  ?? '';\n\n\/\/ \u8fc7\u6ee4\u7a7a\u503c\n$data = array_filter([\n    &quot;topic&quot;    =&gt; $topic,\n    &quot;title&quot;    =&gt; $title,\n    &quot;message&quot;  =&gt; $message\n], fn($v) =&gt; $v !== '' &amp;&amp; $v !== null);\n\n\/\/ \u5fc5\u586b\u6821\u9a8c\nif (empty($data['title']) || empty($data['message'])) {\n    exit(json_encode([&quot;ok&quot;=&gt;false,&quot;error&quot;=&gt;&quot;title\/message \u5fc5\u586b&quot;], JSON_UNESCAPED_UNICODE));\n}\n\n\/\/ \u9ed8\u8ba4 priority\n$data['priority'] = $data['priority'] ?? 5;\n\n\/\/ \ud83d\udc49 \u5173\u952e\uff1a\u786e\u4fdd JSON \u7f16\u7801\u6210\u529f\n$json = json_encode($data, JSON_UNESCAPED_UNICODE);\n\nif ($json === false) {\n    exit(json_encode([\n        &quot;ok&quot; =&gt; false,\n        &quot;error&quot; =&gt; &quot;JSON\u7f16\u7801\u5931\u8d25: &quot; . json_last_error_msg()\n    ], JSON_UNESCAPED_UNICODE));\n}\n\n\/\/ \ud83d\udc49 \u7528\u5b57\u7b26\u4e32\u957f\u5ea6\u907f\u514d\u67d0\u4e9b\u670d\u52a1\u5668\u95ee\u9898\n$headers = [\n    &quot;Content-Type: application\/json&quot;,\n    &quot;Content-Length: &quot; . strlen($json)\n];\n\n\/\/ \u53d1\u9001\n$ch = curl_init(&quot;https:\/\/ntfy.sh&quot;);\n\ncurl_setopt_array($ch, [\n    CURLOPT_POST =&gt; true,\n    CURLOPT_POSTFIELDS =&gt; $json,\n    CURLOPT_HTTPHEADER =&gt; $headers,\n    CURLOPT_RETURNTRANSFER =&gt; true,\n    CURLOPT_TIMEOUT =&gt; 10\n]);\n\n$response = curl_exec($ch);\n\n\/\/ \u9519\u8bef\u5904\u7406\nif (curl_errno($ch)) {\n    $result = [&quot;ok&quot;=&gt;false,&quot;error&quot;=&gt;curl_error($ch)];\n} else {\n    $result = [&quot;ok&quot;=&gt;true,&quot;res&quot;=&gt;json_decode($response)];\n}\n\ncurl_close($ch);\n\nheader('Content-Type: application\/json');\necho json_encode($result, JSON_UNESCAPED_UNICODE);<\/code><\/pre>\n<p>\u7136\u540e\u6267\u884c\u4ee3\u7801\uff1a<\/p>\n<pre><code>https:\/xxx.com\/ntfy\/index.php?title=111&amp;message=222<\/code><\/pre>\n<p>\u5c31\u53ef\u4ee5PUSH\u6d88\u606f\u7ed9\u4f60\u624b\u673a\u4e86\u3002<\/p>\n<p>\u5f53\u7136\uff0c\u8bb0\u5f97\u5c06ntfy\u8bbe\u7f6e\u7535\u6c60\u4f18\u5316\u65e0\u9650\u5236\uff0c\u81ea\u542f\u52a8\uff0c\u540e\u53f0\u9501\u5b9a\u3002<\/p>\n<h2>\u672c\u6587\u4f5c\u8005<\/h2>\n<p>TANKING<\/p>\n<p><a href=\"https:\/\/segmentfault.com\/a\/1190000047722020\">https:\/\/segmentfault.com\/a\/1190000047722020<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6458\u8981 \u4e4b\u524d\u5199\u8fc7Gotify\uff1ahttps:\/\/segmentfault.com\/a\/11900000475316 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-10021343","post","type-post","status-publish","format-standard","hentry","category-share"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10021343","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10021343"}],"version-history":[{"count":0,"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10021343\/revisions"}],"wp:attachment":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10021343"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10021343"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10021343"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}