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

331
Visualizações
Is there a way to launch a blob url on Flutter?

I have a web app which, on user request, queries a backend api for a pdf and then displays it in a separate browser tab. The code for this works (code path when isFlutterApp=false) and looks like this:

let pdf = await Api.getReceiptAsPdf(receipt.id);
var file = new Blob([pdf], {type: 'application/pdf'});
var fileURL = URL.createObjectURL(file);
//fileURL looks like: blob:https://my.example.com/2e48a922-513d-4cb4-8e1f-148d6b7d2640

if (isFlutterApp) sendFlutterNotification(fileURL);
else window.open(fileURL);

The web app may also run in a Flutter App (in a flutter web view) and then the code above sends the fileURL to the Flutter App instead of calling window.open. In that case I use url_launcher and open the same fileUrl via Flutter:

//fileURL is (e.g.) blob:https://my.example.com/2e48a922-513d-4cb4-8e1f-148d6b7d2640
void _launchURL(u) async =>
      await canLaunch(u) ? await launch(u) : throw 'Could not launch $u'; 

This does not work, I get:

-canOpenURL: failed for URL: "blob:https://my.example.com/2e48a922-513d-4cb4-8e1f-148d6b7d2640" - error: "The operation couldn’t be completed. (OSStatus error -10814.)"
[VERBOSE-2:ui_dart_state.cc(186)] Unhandled Exception: Could not launch blob:https://my.example.com/2e48a922-513d-4cb4-8e1f-148d6b7d2640
#0      _MyState._launchURL (package:flutterwrapper/main.dart:173:46) 

I have only tested this on ios so far, and have added in info.plist the following entry:

<key>LSApplicationQueriesSchemes</key>
<array>
<string>blob</string>
</array>

What could be the problem here?

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