Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

188
Vistas
Llame a una función de proveedor Ionic desde el alcance global de javascript

Quiero llamar a una función (TagDataSubscriber.next) desde una función de JavaScript de alcance global. Es un puente entre la aplicación Flutter y mi aplicación Ionic. ¿Alguna idea de cómo lograr eso? Encontré un inyector de aplicaciones en algún lugar de Internet, pero no funciona.

Saludos, Markus

 import {Injector} from '@angular/core'; let appInjectorRef: Injector; export const AppInjector = (injector?: Injector): Injector => { if (injector) { appInjectorRef = injector; } return appInjectorRef; };

expediente del proveedor:

 import {Injectable} from '@angular/core'; import {Observable} from 'rxjs/Observable'; import {Subscriber} from 'rxjs/Subscriber'; import {AppInjector} from "../../app/app-injector"; /* function called by Flutter if a NFC tag was detected */ window["nfcTagReceived"] = function (nfcTag) { let injector = AppInjector(); let nfcService = injector.get(NfcServiceProvider); nfcService.TagDataSubscriber.next(nfcTag); } @Injectable() export class NfcServiceProvider { private nfcAvailable: boolean = false; private tagDataSubscriber: Subscriber<any>; private tagRead: Observable<number> = new Observable<number>( observer => this.tagDataSubscriber = observer ); public get TagDataSubscriber(): Subscriber<any> { return this.tagDataSubscriber; } public get TagRead(): Observable<number> { /*Uncomment*ReadNfcOnce.postMessage("");*Uncomment*/ return this.tagRead; } public get NfcAvailable(): boolean { return this.nfcAvailable; } constructor() { } }
about 4 years ago · Santiago Gelvez
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda