The email apps won't display non-http schemes as clickable links, so

go with html and encode both the invite and install links as php refs
that get redirected.  Works, but eliminates SMS as sending mechanism.
This commit is contained in:
Andy2 2011-08-06 02:57:14 -07:00
parent cd6aa8fe98
commit 9c298a16e7
4 changed files with 30 additions and 8 deletions

View file

@ -558,8 +558,13 @@
that many people.)</string>
<string name="invite_subject">Let\'s play Crosswords</string>
<string name="invite_bodyf">Tap on this link to start a game:
%1$s .</string>
<string name="invite_bodyf">\u003ca href=\"%1$s\"\u003ETap here to
accept\u003c/a\u003E my invitation and join this
game.\u003cbr\u003E \u003ca
href=\"http://eehouse.org/market.php\"\u003E
Tap here to install Crosswords\u003c/a\u003E if you haven\'t
already.</string>
<string name="invite_chooser">Send invitation via</string>
<string name="no_download_warning">Unable to download. Do you have

View file

@ -38,6 +38,7 @@ import java.util.concurrent.locks.Lock;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Random;
import android.text.Html;
import junit.framework.Assert;
@ -412,13 +413,13 @@ public class GameUtils {
if ( null != gameUri ) {
Intent intent = new Intent( Intent.ACTION_SEND );
intent.setType( "text/plain" );
intent.setType("text/html");
intent.putExtra( Intent.EXTRA_SUBJECT,
context.getString( R.string.invite_subject ) );
String format = context.getString( R.string.invite_bodyf );
String message = String.format( format, gameUri.toString() );
intent.putExtra( Intent.EXTRA_TEXT, message );
intent.putExtra( Intent.EXTRA_TEXT, Html.fromHtml(message) );
String chooserMsg = context.getString( R.string.invite_chooser );
context.startActivity( Intent.createChooser( intent, chooserMsg ) );

View file

@ -0,0 +1,20 @@
<?php
print <<<EOF
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Crosswords install redirect</title>
<meta http-equiv="REFRESH"
content="0;url=market://search?q=pname:org.eehouse.android.xw4">
</head>
<body>
<p>Redirecting to the market...</p>
</body>
</html>
EOF;
?>

View file

@ -30,10 +30,6 @@ print <<<EOF
If this fails it's probably because you don't have a new enough version of Crosswords installed.
</p>
<p>
<a href="market://search?q=pname:org.eehouse.android.xw4">Tap here</a> to fix that.
</p>
</div>
</body>