Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

216
Visualizações
How to open contact app from web page and prefill the details of the user phone in reactjs?

I am trying to create a page where when users visit it will open the contact app on the mobile like when someone opens /details page on phone then it will redirect to the contact app and it's only valid for mobile-only. here I am not able to open the .vcf file directly on the contact app here what I am trying to do here is the vcf file that I am getting from a route

BEGIN:VCARD
VERSION:3.0
FN;CHARSET=UTF-8:xander Nesser
N;CHARSET=UTF-8:Nesser;fgff;;;
TEL;TYPE=WORK,VOICE:+91123456789
TITLE;CHARSET=UTF-8:Software Developer
ORG;CHARSET=UTF-8:xyz
URL;CHARSET=UTF-8:https://google.com
REV:2022-06-27T11:54:28.192Z
END:VCARD

and the to open my code I am trying this code

 useEffect(() => {
  

    const requestOption = {
      method: "GET",
      headers: new Headers({ "content-type": "application/json" }),
      body: undefined,
      redirect: "follow",
    };
    fetch("https://apizz.com/api/profiles", requestOption)
      .then((response) => response.text())
      .then((result) => {
        console.log(typeof result);
        console.log(result);
         var url = 'data:text/x-vcard;charset=utf-8,' + encodeURIComponent((result));
         document.location.href = url;
     
      })
      .catch((error) => {
        console.log("error", error);
      });
  }, []);

but it's downloading instead of opening directly

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda