When I share a link to a post on whatsapp for example, it opens in the phone’s browser rather than the discourse hub app even though it’s installed and has the relevant forum connected. This means that they user needs to then log in through the phone’s browser rather than use the app.
Any way to share the link so it points to the App instead?
I’m not sure exactly how this works, do you know @pmusaraj?
Our iOS app has a share extension. It means that on most apps, you would see this when sharing a link:
If you can get whatsapp to show you that Share dialog, then you can send the link to our app. But I don’t seem to be able to do that on my phone on whatsapp.
@gordon_mrmoco さんはWhatsApp(またはテキストメッセージやその他のアプリ)内のリンクをクリックして、Discourse Hub が自動的に開かれるようにしたいのだと思います。
Android では App Links (https://developer.android.com/training/app-links/)、iOS では Universal Links (App Search Programming Guide: Support Universal Links) でこれが可能だと思います。
Android では: https://developer.android.com/studio/write/app-link-indexing
Android App Links は、ユーザーを Android アプリ内の特定のコンテンツに直接誘導する HTTP URL です。App Links は、アプリへのトラフィックを増やし、どのアプリ コンテンツが最も使用されているかを把握し、ユーザーがインストール済みアプリ内のコンテンツを共有したり見つけたりしやすくすることができます。
Android App Links のサポートを追加するには:
- マニフェストにインテント フィルターを作成します。
- 着信リンクを処理するコードをアプリのアクティビティに追加します。
- アプリとウェブサイトを Digital Asset Links で関連付けます。
Android Studio 2.3 以降の App Links Assistant は、以下に説明するステップバイステップのウィザードでプロセスを簡略化します。
iOS では:
ウェブサイトとアプリの間に安全な接続を確立するには、それらの間に信頼関係を確立します。この関係は 2 つの部分で確立されます。
- ウェブサイトに追加する
apple-app-site-associationファイル- アプリに追加する
com.apple.developer.associated-domains権限 (この部分は「Universal Links の処理のためにアプリを準備する」 (App Search Programming Guide: Support Universal Links) で説明されています)
設定はそれほど難しくないように思えますが、Discourse チームが設定する必要があると思います。設定が完了すれば、Discourse Hub がインストールされている場合にリンクが自動的に開かれるはずです。
編集: Discourse チームから提供される必要はなく、PR でも良いと思います ![]()
実際、これはDiscourseHubアプリでは難しいです。com.apple.developer.associated-domainsの権限に数千ものDiscourseサイトのドメイン名を追加する必要があります…ユニバーサルリンクシステムは、数千ものドメインをアプリに関連付けるようには作られておらず、数個のドメインをアプリに関連付けるようになっています。
(Androidでは、これはPWAでそのまま機能するはずです。)
うーん、残念です
これはAndroid PWAで機能しますか?将来のiOS PWAでも機能する可能性はありますか?
