\XF::runLater(function()
{
$is_pwa = \XF::app()->request()->filter('_pwa', 'uint');
if ($is_pwa == 1)
{
$browser = \XF::app()->request()->getBrowser();
if ($browser['os'] == 'android')
{
$userId = intval(\XF::visitor()->user_id);
$ip = \XF::app()->request->getIp();
$binaryIp = \XF\Util\Ip::convertIpStringToBinary($ip);
$uniqueKey = ($userId ? $userId : $binaryIp);
\XF::db()->query("UPDATE xf_session_activity SET sc_is_pwa = ? WHERE user_id = ? AND unique_key = ?", [1, $userId, $uniqueKey]);
}
}
});