{"id":15893,"date":"2022-12-22T16:28:18","date_gmt":"2022-12-22T08:28:18","guid":{"rendered":"https:\/\/www.yimenapp.com\/kb-yimen\/?p=15893"},"modified":"2022-12-22T16:28:18","modified_gmt":"2022-12-22T08:28:18","slug":"notify-%e6%9c%ac%e5%9c%b0%e9%80%9a%e7%9f%a5-%e7%a4%ba%e4%be%8b%e4%ba%8c-app%e5%bc%80%e5%8f%91%e5%ae%9e%e7%8e%b0app%e6%9c%ac%e5%9c%b0%e9%80%9a%e7%9f%a5%e6%b6%88%e6%81%af%e5%8a%9f%e8%83%bd","status":"publish","type":"post","link":"https:\/\/www.yimenapp.com\/kb-yimen\/15893\/","title":{"rendered":"notify\u00a0\u672c\u5730\u901a\u77e5 \u793a\u4f8b\u4e8c  APP\u5f00\u53d1\u5b9e\u73b0APP\u672c\u5730\u901a\u77e5\u6d88\u606f\u529f\u80fd"},"content":{"rendered":"\n<p>notify\u00a0<span class=\"wpcom_tag_link\"><a href=\"https:\/\/www.yimenapp.com\/kb-yimen\/tag\/%e6%9c%ac%e5%9c%b0%e9%80%9a%e7%9f%a5\/\" title=\"\u672c\u5730\u901a\u77e5\" target=\"_blank\">\u672c\u5730\u901a\u77e5<\/a><\/span> \u793a\u4f8b\u4e8c  APP\u5f00\u53d1\u5b9e\u73b0<span class=\"wpcom_tag_link\"><a href=\"https:\/\/www.yimenapp.com\/kb-yimen\/tag\/app%e6%9c%ac%e5%9c%b0%e9%80%9a%e7%9f%a5\/\" title=\"APP\u672c\u5730\u901a\u77e5\" target=\"_blank\">APP\u672c\u5730\u901a\u77e5<\/a><\/span>\u6d88\u606f\u529f\u80fd<\/p>\n\n\n\n<p><strong>\u8bf7\u4ed4\u7ec6\u9605\u8bfb\u672c\u8bf4\u660e\uff1a<\/strong><br>\u2666 \u53d1\u9001\u5ef6\u65f6\uff08interval \u53c2\u6570\u5927\u4e8e 0 \u79d2\uff09\u6216\u5373\u65f6\u672c\u5730\u901a\u77e5\uff1b<br>\u2666 \u53d1\u9001\u540e\u8bf7\u6253\u5f00\u8bbe\u5907\u901a\u77e5\u680f\u67e5\u770b\uff1b<br>\u2666 \u70b9\u51fb\u901a\u77e5\u4f1a\u81ea\u52a8\u6fc0\u6d3bAPP\uff0c\u5982\u63d0\u4f9b\u4e86 url \u53c2\u6570\uff0c\u540c\u65f6\u4f1a\u6253\u5f00\u6b64\u94fe\u63a5\uff08openUrlInApp \u53c2\u6570\u4e3a true \u8868\u793a\u5728App\u5185\u6253\u5f00\uff0c\u5426\u5219\u5728\u7cfb\u7edf\u6d4f\u89c8\u5668\u6253\u5f00\uff09\uff1b<br>\u2666 \u6709\u672a\u8bfb\u901a\u77e5\u7684\u65f6\u5019\uff0c\u684c\u9762APP\u56fe\u6807\u4e00\u822c\u4f1a\u663e\u793a\u6570\u5b57\u89d2\u6807\uff08badge\uff09\uff1b<br>\u2666 \u90e8\u5206 Android \u8bbe\u5907\u9ed8\u8ba4\u662f\u7981\u7528\u901a\u77e5\u7684\uff0c\u53ef\u8c03\u7528 requestAuth \u68c0\u67e5\u662f\u5426\u5141\u8bb8\u901a\u77e5\uff1b<br>\u2666 \u5982\u672a\u5141\u8bb8\u901a\u77e5\uff0c\u53ef\u8c03\u7528 jsBridge.<span class=\"wpcom_keyword_link\"><a href=\"https:\/\/www.yimenapp.com\" target=\"_blank\" title=\"\u5f00\u53d1app\u4ece\u4e00\u95e8\u5f00\u59cb\">app<\/a><\/span>Settings() \u8df3\u8f6c\u5230APP\u8bbe\u7f6e\u754c\u9762\uff0c\u8ba9\u7528\u6237\u5f00\u542f\u901a\u77e5\uff1b<br>\u2666 \u5982\u9700\u663e\u793a\u60ac\u6d6e\u6216\u9501\u5c4f\u901a\u77e5\uff0c\u90e8\u5206\u8bbe\u5907\u53ef\u80fd\u9700\u8981\u4eba\u5de5\u5f00\u542f\u5bf9\u5e94\u6743\u9650\uff1b<br>\u2666 \u5728\u5ef6\u65f6\u7ed3\u675f\u4e4b\u524d\uff08interval \u53c2\u6570\u6307\u5b9a\u7684\uff09\u53ef\u8c03\u7528 cancelAll \u53d6\u6d88\u901a\u77e5\uff0c\u8fd9\u6837\u5c31\u4e0d\u4f1a\u6536\u5230\u8fd8\u6ca1\u53d1\u9001\u7684\u901a\u77e5\u4e86\uff1b<br>\u2666 Android \u7279\u6027\uff1a\u5728 interval \u53c2\u6570\u5ef6\u8fdf\u7ed3\u675f\u4e4b\u95f4\u8981\u786e\u4fddAPP\u8fdb\u7a0b\u5904\u4e8e\u5b58\u6d3b\u72b6\u6001\uff0c\u5426\u5219\u53ef\u80fd\u6536\u4e0d\u5230\u901a\u77e5\uff1b<br>\u2666 iOS \u7279\u6027\uff1a\u5982\u679cAPP\u5904\u4e8e\u524d\u53f0\u6fc0\u6d3b\u72b6\u6001\uff0c\u4ec5\u5f39\u51fa\u901a\u77e5\u63d0\u793a\uff0c\u4e0d\u4f1a\u53d1\u9001\u5230\u901a\u77e5\u680f\uff1b\u5982\u679cAPP\u5904\u4e8e\u540e\u53f0\u3001\u6740\u6b7b\u6216\u9501\u5c4f\u72b6\u6001\uff0c\u4f1a\u53d1\u9001\u5230\u901a\u77e5\u680f\uff1b<\/p>\n\n\n\n<figure id=\"pid16585\" class=\"wp-block-table\"><table><tbody><tr><td>\u7528\u505a\u7f51\u9875\u7684\u6280\u672f\u505a<a rel=\"noreferrer noopener\" href=\"https:\/\/www.yimenapp.com\/\" target=\"_blank\">APP<\/a>\uff01<br><span class=\"wpcom_keyword_link\"><a href=\"https:\/\/www.yimenapp.com\" title=\"\u5f00\u53d1APP\u4ece\u4e00\u95e8\u5f00\u59cb\">\u4e00\u95e8<\/a><\/span>\u63d0\u4f9b\u6807\u51c6\u5316\u7684<strong>jsbridge-mini.js\u5e93<\/strong>\uff0c\u60a8\u53ea\u9700\u8981\u5728\u9875\u9762<strong>\u5f15\u7528<\/strong>\u5e76<strong>\u6267\u884c<\/strong>JS\u5373\u53ef\u5b9e\u73b0\u5404\u79cd<strong>\u539f\u751fAPP\u3001\u539f\u751fPC<\/strong>\u7684\u529f\u80fd\u80fd\u529b\u3002<br><br><strong>==================APP\u7aef==================<\/strong><br><strong>\u3010APP\u7aef\u3011\uff08\u5b89\u5353\u7248&amp;\u82f9\u679c\u7248\uff09<\/strong>\u76ee\u524d\u63d0\u4f9b200+\u539f\u751f\u529f\u80fd\uff0c2000+JS\u6620\u5c04\u63a5\u53e3\uff0c\u7528\u505a\u7f51\u7ad9\u7684\u6280\u672f\u5373\u53ef\u5b9e\u73b0\u5404\u79cd\u539f\u751fAPP\u80fd\u529b\u3001APP demo\u5730\u5740<a rel=\"noreferrer noopener\" href=\"https:\/\/www.yimenapp.com\/doc\/demo.cshtml\" target=\"_blank\">https:\/\/www.yimenapp.com\/doc\/demo.cshtml<\/a>\u4e0b\u8f7d\u6559\u7a0b\uff1a<br>\u2666\u00a0<strong>JS-SDK<\/strong>\u00a0\u5f15\u7528\u65b9\u5f0f\uff1a<br>\u2666 \u666e\u901a\u7f51\u9875 script \u65b9\u5f0f\u52a0\u8f7d\uff1a\u4e0b\u8f7d\u6700\u65b0\u7248\uff0c\u8bf7\u5728\u9875\u9762\u4e0a\u8c03\u7528 jsBridge \u63a5\u53e3\u4e4b\u524d\u5f15\u7528 jsbridge-mini.js \u5e93\uff1b<br>\u2666 js module \u65b9\u5f0f\u5f15\u7528\uff1anpm install ym-jsbridge\u00a0<a rel=\"noreferrer noopener\" href=\"https:\/\/www.npmjs.com\/package\/ym-jsbridge\" target=\"_blank\">\u5177\u4f53\u8bf7\u53c2\u8003 npm package<\/a><\/td><\/tr><\/tbody><\/table><figcaption>\u4e00\u95e8APP\u5f00\u53d1\u5e73\u53f0\u901a\u7528JS<\/figcaption><\/figure>\n\n\n\n<p>\u6838\u5fc3\u4ee3\u7801\u793a\u4f8b\uff0c\u8be6\u60c5\u53c2\u9605demo<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-js\" data-lang=\"JavaScript\"><code>\/\/iOS \u82f9\u679c\u7aef\u6267\u884c\u672c\u63a5\u53e3\u540e\u628aApp\u63a8\u5230\u540e\u53f0\u6216\u8005\u9501\u5c4f\u624b\u673a\uff0c3\u79d2\u540e\u4f1a\u6536\u5230\u901a\u77e5\u3002\njsBridge.notification.notify({\n  title  : &quot;\u6253\u5f00\u767e\u5ea6\u7684\u901a\u77e5&quot;,\n  content: &quot;\u8fd9\u662f\u901a\u77e5\u5185\u5bb9\u3002\u70b9\u51fb\u5728\u7cfb\u7edf\u6d4f\u89c8\u5668\u4e2d\u6253\u5f00\u767e\u5ea6...&quot;,\n  url    : &quot;https:\/\/m.baidu.com&quot;,\n  openUrlInApp: false,\n  interval    : 3\n}, function(succ, data) {\n  if (succ) {\n    console.log(&quot;3\u79d2\u540e\u53d1\u9001\u901a\u77e5&quot;);\n  } else {\n    alert(JSON.stringify(data));\n  }\n});<\/code><\/pre><\/div>\n\n\n\n<p>A\u6807\u7b7e\u6267\u884cJS\u793a\u4f8b\u4ee3\u7801<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-html\" data-lang=\"HTML\"><code>&lt;a href=&quot;javascript:void(0)&quot; onclick=&quot;zhixing()&quot;&gt;\u6267\u884c&lt;\/a&gt; \n&lt;!-- \u5199\u5165\u4e00\u4e2aA\u6807\u7b7ehref\u503c\u4e3a&quot;javascript:void(0)&quot;\uff0c\u5b9a\u4e49\u70b9\u51fb\u4e8b\u4ef6onclick\uff1b--&gt;\n&lt;script src=&quot;\u60a8\u7684\u670d\u52a1\u5668URL\/jsbridge-mini.js&quot;&gt;&lt;\/script&gt;\n&lt;!-- \u5728\u60a8\u7684\u670d\u52a1\u5668\u5f15\u5165\u4e00\u95e8JS\u5730\u5740\uff0c\u8bf7\u4e0b\u8f7djsbridge-mini.js\u4e0a\u4f20\u60a8\u81ea\u5df1\u7684\u670d\u52a1\u5668\u83b7\u53d6\u94fe\u63a5\uff1b--&gt;\n&lt;script type=&quot;text\/javascript&quot;&gt;\nfunction zhixing() {\n\n\n&lt;!--\u8fd9\u91cc\u53ef\u4ee5\u76f4\u63a5\u590d\u5236JS\u6838\u5fc3\u4ee3\u7801\u5230\u6b64{}\u62ec\u53f7\u5185--&gt;\n\/\/iOS \u82f9\u679c\u7aef\u6267\u884c\u672c\u63a5\u53e3\u540e\u628aApp\u63a8\u5230\u540e\u53f0\u6216\u8005\u9501\u5c4f\u624b\u673a\uff0c3\u79d2\u540e\u4f1a\u6536\u5230\u901a\u77e5\u3002\njsBridge.notification.notify({\n  title  : &quot;\u6253\u5f00\u767e\u5ea6\u7684\u901a\u77e5&quot;,\n  content: &quot;\u8fd9\u662f\u901a\u77e5\u5185\u5bb9\u3002\u70b9\u51fb\u5728\u7cfb\u7edf\u6d4f\u89c8\u5668\u4e2d\u6253\u5f00\u767e\u5ea6...&quot;,\n  url    : &quot;https:\/\/m.baidu.com&quot;,\n  openUrlInApp: false,\n  interval    : 3\n}, function(succ, data) {\n  if (succ) {\n    console.log(&quot;3\u79d2\u540e\u53d1\u9001\u901a\u77e5&quot;);\n  } else {\n    alert(JSON.stringify(data));\n  }\n});\n\n}\n&lt;\/script&gt;\n&lt;!--\u6267\u884c\u6838\u5fc3\u4ee3\u7801\uff1b\n\/\/\u5982\u679c\u9700\u8981\u8fdb\u5165\u9875\u9762\u5c31\u6267\u884c\uff0c\u53bb\u6389\u70b9\u51fb\u4e8b\u4ef6\u5373\u53ef\uff1b--&gt;<\/code><\/pre><\/div>\n\n\n\n<p>\u6309\u94ae\u6267\u884cJS\u793a\u4f8b\u4ee3\u7801<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-html\" data-lang=\"HTML\"><code>&lt;button onclick=&quot;zhixing()&quot; &gt;\u6267\u884c&lt;\/button&gt;\n&lt;!-- \/\/\u5199\u4e00\u4e2a\u6309\u94ae\uff0c\u5b9a\u4e49\u70b9\u51fb\u6267\u884c\u4e8b\u4ef6\uff1b --&gt;\n&lt;script src=&quot;\u60a8\u7684\u670d\u52a1\u5668URL\/jsbridge-mini.js&quot;&gt;&lt;\/script&gt;\n&lt;!-- \/\/\u5728\u60a8\u7684\u670d\u52a1\u5668\u5f15\u5165\u4e00\u95e8JS\u5730\u5740\uff0c\u8bf7\u4e0b\u8f7djsbridge-mini.js\u4e0a\u4f20\u60a8\u81ea\u5df1\u7684\u670d\u52a1\u5668\u83b7\u53d6\u94fe\u63a5\uff1b --&gt;\n&lt;script type=&quot;text\/javascript&quot;&gt;\nfunction zhixing() {\n\n\n&lt;!--\u8fd9\u91cc\u53ef\u4ee5\u76f4\u63a5\u590d\u5236JS\u6838\u5fc3\u4ee3\u7801\u5230\u6b64{}\u62ec\u53f7\u5185--&gt;\n\/\/iOS \u82f9\u679c\u7aef\u6267\u884c\u672c\u63a5\u53e3\u540e\u628aApp\u63a8\u5230\u540e\u53f0\u6216\u8005\u9501\u5c4f\u624b\u673a\uff0c3\u79d2\u540e\u4f1a\u6536\u5230\u901a\u77e5\u3002\njsBridge.notification.notify({\n  title  : &quot;\u6253\u5f00\u767e\u5ea6\u7684\u901a\u77e5&quot;,\n  content: &quot;\u8fd9\u662f\u901a\u77e5\u5185\u5bb9\u3002\u70b9\u51fb\u5728\u7cfb\u7edf\u6d4f\u89c8\u5668\u4e2d\u6253\u5f00\u767e\u5ea6...&quot;,\n  url    : &quot;https:\/\/m.baidu.com&quot;,\n  openUrlInApp: false,\n  interval    : 3\n}, function(succ, data) {\n  if (succ) {\n    console.log(&quot;3\u79d2\u540e\u53d1\u9001\u901a\u77e5&quot;);\n  } else {\n    alert(JSON.stringify(data));\n  }\n});\n\n}\n&lt;\/script&gt;\n&lt;!-- \/\/\u6267\u884c\u6838\u5fc3\u4ee3\u7801\uff1b\n\/\/\u5982\u679c\u9700\u8981\u8fdb\u5165\u9875\u9762\u5c31\u6267\u884c\uff0c\u53bb\u6389\u70b9\u51fb\u4e8b\u4ef6\u5373\u53ef\uff1b --&gt;<\/code><\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u70b9\u51fb\u901a\u77e5\u4f1a\u81ea\u52a8\u6fc0\u6d3bAPP\uff0c\u5982\u63d0\u4f9b\u4e86 url \u53c2\u6570\uff0c\u540c\u65f6\u4f1a\u6253\u5f00\u6b64\u94fe\u63a5\uff08openUrlInApp \u53c2\u6570\u4e3a true \u8868\u793a\u5728App\u5185\u6253\u5f00\uff0c\u5426\u5219\u5728\u7cfb\u7edf\u6d4f\u89c8\u5668\u6253\u5f00<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[698],"tags":[7412,1666,5213,7414,1718],"special":[],"attr":[],"class_list":{"0":"post-15893","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-app84","7":"tag-app","10":"tag-7414","11":"tag-1718","12":"entry"},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/posts\/15893","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/comments?post=15893"}],"version-history":[{"count":1,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/posts\/15893\/revisions"}],"predecessor-version":[{"id":15894,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/posts\/15893\/revisions\/15894"}],"wp:attachment":[{"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/media?parent=15893"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/categories?post=15893"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/tags?post=15893"},{"taxonomy":"special","embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/special?post=15893"},{"taxonomy":"attr","embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/attr?post=15893"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}