ionic5+angular+cordova外部网页与App内部发消息

卫烨
2023-12-01

前提:需要在App内部打开多个外部网页,并需要互相传值

使用Cordova提供的 InAppBrowser

下面事App内部的处理:

import {Injectable} from '@angular/core';
//引入InAppBrowser 
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
@Injectable()
export class CommonAdService {
    accNbr: string;
    // eslint-disable-next-line max-len
    urlArray = ['http://192.168.1.999:999/msg/xxx/xxx/xxx.html','http://192.168.1.999:999/msg/xxx/xxx/xxx.html','http://192.168.1.999:999/msg/xxx/xxx/xxx.html'];
  constructor(
//声明全局变量
    private iab: InAppBrowser,
    ) {
        this.accNbr = this.utilService.getDto().Code;
        // this.urlArray = this.utilService.getCommonAdUrlArray();
    }
    gogogo(a){
            console.log('==========&
 类似资料: