{"id":1988,"date":"2022-11-25T18:00:47","date_gmt":"2022-11-25T10:00:47","guid":{"rendered":"https:\/\/app.applebyme.cn\/cloud\/appshangjia\/1988.html"},"modified":"2022-11-25T18:00:47","modified_gmt":"2022-11-25T10:00:47","slug":"%e5%b0%8f%e7%b1%b3%e6%89%8b%e6%9c%baapp%e6%a1%8c%e9%9d%a2%e5%ba%94%e7%94%a8%e8%a7%92%e6%a0%87%e9%80%82%e9%85%8d%e8%af%b4%e6%98%8e","status":"publish","type":"post","link":"https:\/\/app.applebyme.cn\/cloud\/appshangjia\/1988.html","title":{"rendered":"\u5c0f\u7c73\u624b\u673aAPP\u684c\u9762\u5e94\u7528\u89d2\u6807\u9002\u914d\u8bf4\u660e"},"content":{"rendered":"<p>\u5c0f\u7c73\u624b\u673a\u684c\u9762\u5e94\u7528<span class=\"wpcom_tag_link\">\u89d2\u6807<\/span>\u9002\u914d\u8bf4\u660e<\/p>\n<h2 id=\"_0\">1. \u9ed8\u8ba4\u903b\u8f91<\/h2>\n<p>\u5f53\u5e94\u7528\u5411\u901a\u77e5\u680f\u53d1\u9001\u4e86\u4e00\u6761\u901a\u77e5 \uff08\u9664\u4e86\u8fdb\u5ea6\u6761\u6837\u5f0f\u548c\u5e38\u9a7b\u901a\u77e5\u5916\uff09\uff0c\u5e94\u7528\u56fe\u6807\u7684\u53f3\u4e0a\u89d2\u5c31\u4f1a\u663e\u793a\u300c1\u300d\u3002\u89d2\u6807\u7684\u6570\u5b57\u4ee3\u8868\u5e94\u7528\u7684\u901a\u77e5\u6570\uff0c\u5373\u5e94\u7528\u53d1\u9001\u4e86\u300cx\u300d\u6761\u901a\u77e5\uff0c\u89d2\u6807\u5c31\u4f1a\u663e\u793a\u4e3a\u300cx\u300d\u3002<\/p>\n<h2 id=\"_1\">2. \u5f00\u53d1\u8005\u5982\u4f55\u8bbe\u7f6e\u684c\u9762\u89d2\u6807<\/h2>\n<h3 id=\"_1_0\">2.1 MIUI6-MIUI11\u684c\u9762\u5e94\u7528\u89d2\u6807\u9002\u914d\u65b9\u6cd5<\/h3>\n<p>\u53ef\u901a\u8fc7\u53cd\u5c04\u8c03\u7528\u8bbe\u7f6e\u684c\u9762\u89d2\u6807\uff0c\u53c2\u8003\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<pre class=\"wp-block-code\"><code><strong>try<\/strong> {\n    Field field = notification.getClass().getDeclaredField(\u201cextraNotification\u201d);\n    Object extraNotification = field.get(notification);\n    Method method = extraNotification.getClass().getDeclaredMethod(\u201csetMessageCount\u201d, <strong>int<\/strong>.class);\n    method.invoke(extraNotification, mCount);\n} <strong>catch<\/strong> (Exception e) {\n    e.printStackTrace();\n}<\/code><\/pre>\n<h3 id=\"_1_1\">2.2 MIUI12\u53ca\u4ee5\u540e\u684c\u9762\u5e94\u7528\u89d2\u6807\u9002\u914d\u65b9\u6cd5<\/h3>\n<p>\u7531\u4e8eGoogle\u5c4f\u853d\u4e86hideAPI\u7684\u53cd\u5c04\u8c03\u7528\uff0c\u56e0\u6b64MIUI12\u53ca\u4ee5\u540e\u53ef\u4ee5\u4f7f\u7528notification.number\uff0c\u53ef\u53c2\u7167<span class=\"wpcom_keyword_link\">Android\u5f00\u53d1<\/span>\u8005\u6587\u6863https:\/\/developer.android.google.cn\/reference\/android\/app\/Notification#number\uff0c\u53c2\u8003\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<pre class=\"wp-block-code\"><code>Notification notification = <strong>new<\/strong> Notification.Builder(context, CHANNEL_ID)\n            .setSmallIcon(R.drawable.notification_icon)\n            .setContentTit<a href=\"https:\/\/app.applebyme.cn\/shengcheng-114.html\">app\u6253\u5305\u5de5\u5177<\/a>le(textTitle)\n            .setContentText(textContent)\n            .setNumber(<strong>int<\/strong> number)\n            .build();<\/code><\/pre>\n<h2 id=\"_2\">3. \u5982\u4f55\u5224\u65adMIUI\u7248\u672c<\/h2>\n<p>\u53ef\u53c2\u8003\u6587\u6863https:\/\/dev.mi.com\/console\/doc\/detail?pId=1312\uff0c\u5176\u4e2d6.1\u8282\u6709\u5177\u4f53\u65b9\u6cd5\u8bf4\u660e\u3002<\/p>\n<p>                           <a href=\"https:\/\/app.applebyme.cn\/shengcheng-53.html\">\u6e90\u7801\u751f\u6210app\u8f6f\u4ef6<\/a>                             <\/p>\n<p>\u7f16\u8f91\uff1ayimen\uff0c\u5982\u82e5\u8f6c\u8f7d\uff0c\u8bf7\u6ce8\u660e\u51fa\u5904\uff1ahttps:\/\/www.yimenapp.com\/kb-yimen\/12216\/<\/p>\n<p>\u90e8\u5206\u5185\u5bb9\u6765\u81ea\u7f51\u7edc\u6295\u7a3f\uff0c\u5982\u6709\u4fb5\u6743\u8054\u7cfb\u7acb\u5220<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5c0f\u7c73\u624b\u673a\u684c\u9762\u5e94\u7528\u89d2\u6807\u9002\u914d\u8bf4\u660e1. \u9ed8\u8ba4\u903b\u8f91\u5f53\u5e94\u7528\u5411\u901a\u77e5\u680f\u53d1\u9001\u4e86\u4e00\u6761\u901a\u77e5 \uff08\u9664\u4e86\u8fdb\u5ea6\u6761\u6837\u5f0f\u548c\u5e38\u9a7b\u901a\u77e5\u5916\uff09\uff0c\u5e94\u7528\u56fe\u6807\u7684\u53f3\u4e0a\u89d2\u5c31\u4f1a\u663e\u793a\u300c1\u300d\u3002\u89d2\u6807\u7684\u6570\u5b57\u4ee3\u8868\u5e94\u7528\u7684\u901a\u77e5\u6570\uff0c\u5373\u5e94\u7528\u53d1\u9001\u4e86\u300cx\u300d\u6761\u901a\u77e5\uff0c\u89d2\u6807\u5c31\u4f1a\u663e\u793a\u4e3a\u300cx\u300d\u30022. \u5f00\u53d1\u8005\u5982\u4f55\u8bbe\u7f6e\u684c\u9762\u89d2\u68072.1 MIUI6-MIUI11\u684c\u9762\u5e94\u7528\u89d2\u6807\u9002\u914d\u65b9\u6cd5\u53ef\u901a\u8fc7\u53cd<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[548,861,1011],"class_list":["post-1988","post","type-post","status-publish","format-standard","hentry","category-appshangjia","tag-548","tag-861","tag-1011"],"_links":{"self":[{"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/posts\/1988","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/comments?post=1988"}],"version-history":[{"count":0,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/posts\/1988\/revisions"}],"wp:attachment":[{"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/media?parent=1988"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/categories?post=1988"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/tags?post=1988"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}