From eeff6d4c0569fc4ffd0f2dec9be5891ae46d714c Mon Sep 17 00:00:00 2001 From: Juan Leyva Date: Sat, 2 Sep 2023 11:42:32 +0200 Subject: [PATCH] MDL-79242 tool_mobile: Pass site as installation referrer for the app --- admin/tool/mobile/lib.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/admin/tool/mobile/lib.php b/admin/tool/mobile/lib.php index 3014c9dbc27..3ecf96402c1 100644 --- a/admin/tool/mobile/lib.php +++ b/admin/tool/mobile/lib.php @@ -83,6 +83,12 @@ function tool_mobile_create_app_download_url() { $downloadurl->param('androidappid', $mobilesettings->androidappid); } + // For privacy reasons, add siteurl param only if the site is registered. + // This is to implement Google Play Referrer (so the site url is automatically populated in the app after installation). + if (\core\hub\registration::is_registered()) { + $downloadurl->param('siteurl', $CFG->wwwroot); + } + return $downloadurl; }