开发者

html email with a link that depends on the platform (Android device vs PC)

开发者 https://www.devze.com 2023-02-14 04:38 出处:网络
I\'m sending an email using new Intent(Intent.ACTION_SEND). In this mail there is the link for donwloading my application.

I'm sending an email using

new Intent(Intent.ACTION_SEND).

In this mail there is the link for donwloading my application.

The goal. I want that link is:

  1. If th开发者_如何学Pythone email is opened on a browser in the PC:

    https://market.android.com/details?id=com.myapplication

  2. If the email is opened on an Android device:

    market://details?id=com.myapplication

In this way I'm sure that the user that open the link using ad Android device is linked directly to the default Android Market applcation...

Cheers, B.


There is no way to detect from the email only if the user is on an android device, or a PC (or even an other smartphone).

You could give the two links directly and let the user click on the correct one.

You can't use JavaScript in your mail as it's ignored by most mail readers (for security purpose), but you may have a single link to a blank webpage (either JS, php or anything you're most familiar with), that will then detect if the user is on a phone or not, and redirect him accordingly.

0

精彩评论

暂无评论...
验证码 换一张
取 消