Redirecting to a deeplink

I have created an endpoint so that when sending email to users they will be able to open the app from the link. I needed this since gmail is removing links that does not contain https.
The endpoint is supposed to redirect to deeplink (appname://test/’.$id) but it does not work with any of the ways I tried below:

tried with header location:

$app_url = "appname://test/'.$id";
header('Location: ' . $app_url);

tried with symfony redirect:

return $this->redirect('appname://test/'.$id);

tried with js on php function:

echo "<script type='text/javascript'>
    window.onload = function() {
        window.location = 'appname://test/$id'; }
    </script>";

Any idea how could I redirect the user to app once clicked the link from gmail?
Thank you,

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *