首页 > 解决方案 > 离子分享功能无法在安卓设备中使用

问题描述

我的离子共享功能在 ios 和 prod android 真实设备中工作。但是上传到playstore的分享按钮根本不起作用。有谁知道如何解决这个问题?

const {Share} = Plugins;
import {Plugins} from '@capacitor/core';
        
constructor(
    private socialSharing: SocialSharing
) {}


async share() {
      const propertyName = this.pass.unit.property.name;
      await Share.share({
        title: propertyName + ' Guest Pass ',
        text: 'my text,
        url: this.pass.share_url,
        dialogTitle: 'Share to your guests',
      })
        .then(res => {
          res.this.ui.presentAlert('Share successful!');
        })
        .catch(err => {
          console.log(err);
        });
      }

这是离子包版本

"@angular/common": "~11.2.0",
    "@angular/core": "~11.2.0",
    "@angular/forms": "~11.2.0",
    "@angular/platform-browser": "~11.2.0",
    "@angular/platform-browser-dynamic": "~11.2.0",
    "@angular/router": "~11.2.0",
    "@capacitor/android": "^2.4.7",
    "@capacitor/core": "^2.4.7",
    "@capacitor/ios": "^2.4.7",
    "@ionic-native/file-opener": "^5.32.1",
    "@ionic/angular": "^5.6.3",
    "@ionic/pwa-elements": "^3.0.2",
    "capacitor-app-tracking-transparency": "^1.1.5",
    "cordova-plugin-file-opener2": "^3.0.5",

标签: typescriptionic-frameworkshare

解决方案


推荐阅读