# Discourse 自定义应用横幅

**URL:** https://meta.discourse.org/t/discourse-custom-app-banner/99638
**Category:** Plugin
**Created:** [2018年十月16日 14:29 UTC](https://meta.discourse.org/t/discourse-custom-app-banner/99638 "2018-10-16T14:29:03Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [2018年十月16日 14:29 UTC](https://meta.discourse.org/t/discourse-custom-app-banner/99638/1 "2018-10-16T14:29:03Z")

</div>

如果您有自定义的 Discourse 应用或公司应用，您可能希望向用户展示自定义应用横幅。Discourse 目前仅支持通过“其他”-\> `native app install banner` 站点设置引导用户前往 Discourse 应用，示例如下：

![afbeelding](https://global.discourse-cdn.com/meta/original/3X/e/a/eaaa1979d4fbbfa85923fd0d7f1e417e2f98c387.jpeg)

discourse-custom-app-banner 插件允许您配置自己的 iTunes 或 Android 应用，并展示相应的横幅。

该插件位于：[GitHub - communiteq/discourse-custom-app-banner · GitHub](https://github.com/communiteq/discourse-custom-app-banner)

本插件是为 [RZIM Connect](https://connect.rzim.org/) 开发的，感谢 @outofthebox 慷慨允许我们将其实体开源。

---

<div class="post-metadata">

### Author: ![outofthebox](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/outofthebox/32/83708_2.png) [@outofthebox](https://meta.discourse.org/u/outofthebox)
#### Post date: [2018年十月16日 16:00 UTC](https://meta.discourse.org/t/discourse-custom-app-banner/99638/2 "2018-10-16T16:00:50Z")

</div>

Richard, I’m grateful for your professionalism, speed, and expertise on the Discourse platform.

This plugin provides our members with a better experience. Thank you!

I’m also grateful that you wanted to share this plugin with the Discourse community, which speaks to your character and loyalty. I am very happy to be able, through your hard work, to contribute a tiny bit back to this outstanding product and community.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [2018年十月16日 16:10 UTC](https://meta.discourse.org/t/discourse-custom-app-banner/99638/3 "2018-10-16T16:10:23Z")

</div>

I think it’s very reasonable to merge this functionality into core.

Two hidden site settings, that allow you to input `android_app_id` and `ios_app_id` and default to the current values.

I thought about doing this way, but back then there was just one Discourse app 😉

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2018年十月17日 00:29 UTC](https://meta.discourse.org/t/discourse-custom-app-banner/99638/4 "2018-10-17T00:29:16Z")

</div>

Agreed, this is totally fine to merge in. We do not want to forcefully tie people to the one app, that’s not intentional.

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [2021年三月3日 15:00 UTC](https://meta.discourse.org/t/discourse-custom-app-banner/99638/5 "2021-03-03T15:00:21Z")

</div>

这是一个针对尝试使用此插件用户的快速教程。该功能现已集成到核心中。  
有两个隐藏的网站设置：`ios_app_id` 和 `android_app_id`。

要设置这些，请打开 Rails 控制台并输入：

```
SiteSetting.ios_app_id = XXX
SiteSetting.android_app_id = YYY

```

其中 XXX 和 YYY 是相应的应用 ID。

然后，您可以在“管理 - 设置”界面中启用 `native_app_install_banner_ios` 和 `native_app_install_banner_android` 设置。
