";
}
}
$g_androidStrings = array( "android", );
$scheme = "newxwgame";
$host = "10.0.2.2";
$lang = $_REQUEST["lang"];
$room = $_REQUEST["room"];
$np = $_REQUEST["np"];
$id = $_REQUEST["id"];
$wl = $_REQUEST["wl"];
$agent = $_SERVER['HTTP_USER_AGENT'];
$onAndroid = false;
for ( $ii = 0; $ii < count($g_androidStrings) && !$onAndroid; ++$ii ) {
$needle = $g_androidStrings[$ii];
$onAndroid = 0 != stripos( $agent, $needle );
}
$onFire = 0 != stripos( $agent, 'silk' );
$localurl = "$scheme://$host?room=$room&lang=$lang&np=$np";
if ( $id != "" ) {
$localurl .= "&id=$id";
}
if ( $wl != "" ) {
$localurl .= "&wl=$wl";
}
if ( $onAndroid || $onFire ) {
print << If this fails it's probably because you don't have a new enough
version of Crosswords installed.
It appears you're running on a Kindle Fire, whose non-standard (from
an Android perspective) OS doesn't support the custom schemes on which
Crosswords invitations depend. If you want to accept this invitation
you'll need to do it the manual way:
Tap this link to launch Crosswords with
your new game.
I'm sorry this is so complicated. I'm trying to find a workaround for this limitation in the Kindle Fire's operating system but for now this is all I can offer.
(Just in case Amazon's fixed the problem, here is the link that should open your new game.)
EOF; } else { $subject = "Android device not identified"; $body = htmlentities("My browser is running on an android device but" . " says its user agent is: \"$agent\". Please fix your script to recognize" . " this as an Android browser."); print <<This page is meant to be viewed on a browser on your Android device. Please open the email that sent you here on that device and revisit this link to complete the invitation process.
(If you are viewing this on an Android device, you've found a bug! Please email me (and be sure to leave the user agent string in the email body.)
EOF; } ?>