2

Does there exist some kind of plugin or lightweight method of determining whether

A. A user is using a mobile device
B. The user has a particular app
C. The user does not have a particular app.

And depending on what criteria the user satisfies, display a prompt (modal, overlay, pop-up) that allows the user to view the app (if installed) or to install it (if they do not have it installed).

I realize "A" can be achieved by using media queries but I am not sure how to configure the others.

I've seen this done on many many sites so I know that it is not uncommon (view screenshot). Ideally I just want to implement some quick solution. I'm looking for something similar to "Hello Bar" for mobile only, I suppose.

Any help will be appreciated.

Example: http://i.imgur.com/VkWKu.png (the prompt at the top of the browser)


I ended up finding this:

http://developer.apple.com/library/ios/#documentation/AppleApplications/Reference/SafariWebContent/PromotingAppswithAppBanners/PromotingAppswithAppBanners.html

Which is exactly what I was looking for and will work in tandem with the other solutions.

4

2 に答える 2

0

ユーザーがアプリをインストールしているかどうかを本当に知りたい場合は、このアプローチを試してみてください。

アプリをインストールして最初に実行するときに、Cookie を作成します。使用することを覚えておく必要がある唯一のことはCookieSyncManager、設定された Cookie がストレージではなく RAM に保存されるため、CookieSyncManagerこれら 2 つが同期されることです。

CookieSyncManager.createInstance(context)
CookieSyncManager.getInstance().sync()

Cookie を設定したら、ポップアップなどを表示する場合は、Web サイトで Cookie を読み取ることができます。モバイル デバイスの場合にのみ、このポップアップを表示します: http://www.quirksmode.org/js/detect .html

CookieSyncManager の Android デベロッパー: http://developer.android.com/reference/android/webkit/CookieSyncManager.html

CookieSyncManager の使用法を説明する Bolg の投稿: http://blog.tacticalnuclearstrike.com/2010/05/using-cookiesyncmanager/

iOSやWindowsではなくAndroidでこれを行う方法を知っています...

于 2012-12-19T17:50:18.200 に答える
0

これを行う標準的な方法はありません。

この投稿の最後を参照してください: http://blogs.msdn.com/b/ieinternals/archive/2011/07/14/url-protocols-application-protocols-and-asynchronous-pluggable-protocols-oh-my.aspx IE10 の JavaScript で利用できるメカニズムの 1 つです。

IE10 の Metro 環境はこれを提供します: http://blogs.msdn.com/b/ie/archive/2011/10/20/connect-your-web-site-to-your-windows-8-app.aspxしかし、私はしませんモバイル ブラウザには存在しないと思います。

于 2012-12-19T17:34:22.070 に答える