Hi Jeremy and thanks for your reply!A_pwa=1
query param is added to the start URL, so I think you should be able to check for this and store the state in the session.
\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]);
}
}
});
\XF::session()->set('fromPwa', true)
\XF\ControllerPlugin\Login::completeLogin
to check the value before and set it on the new session after.We use essential cookies to make this site work, and optional cookies to enhance your experience.