Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

330
Views
¿Hay alguna manera de lanzar una URL de blob en Flutter?

Tengo una aplicación web que, a pedido del usuario, consulta una API de back-end para un pdf y luego lo muestra en una pestaña separada del navegador. El código para esto funciona (ruta de código cuando isFlutterApp=false ) y se ve así:

 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);

La aplicación web también puede ejecutarse en una aplicación Flutter (en una vista web flutter) y luego el código anterior envía la URL del archivo a la aplicación Flutter en lugar de llamar a window.open. En ese caso, uso url_launcher y abro el mismo fileUrl a través de Flutter:

 //fileURL is (eg) 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';

Esto no funciona, me sale:

 -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)

Solo he probado esto en ios hasta ahora, y he agregado en info.plist la siguiente entrada:

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

Cual podría ser el problema aquí?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!