亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

使用 Ionic 的社交分享插件的正確方法?

使用 Ionic 的社交分享插件的正確方法?

aluckdog 2022-07-08 18:19:29
我正在嘗試在我的應用程序中實現 Ionic 的社交分享插件,但我遇到了問題。這是我得到的錯誤:這是我的 component.tsimport {SocialSharing} from '@ionic-native/social-sharing/ngx';export class SettingsPage implements OnInit {  code: string = null;  constructor(    private socialSharing: SocialSharing  ) {}  ngOnInit() {}  shareCode(code) {    this.socialSharing.canShareViaEmail().then(() => {      // this.socialSharing      //   .share(`Here is your code: ${code}`)      //   .then(() => {      //     log.debug('code has been shared?');      //   });    });  }}這是我的 package.json{  "dependencies": {    "@angular/common": "^8.2.14",    "@angular/core": "^8.2.14",    "@angular/forms": "^8.2.14",    "@angular/http": "^7.2.16",    "@angular/platform-browser": "^8.2.14",    "@angular/platform-browser-dynamic": "^8.2.14",    "@angular/pwa": "^0.803.25",    "@angular/router": "^8.2.14",    "@angular/service-worker": "^8.2.14",    "@biesbjerg/ngx-translate-extract-marker": "^1.0.0",    "@fullcalendar/core": "^4.4.0",    "@fullcalendar/daygrid": "^4.4.0",    "@fullcalendar/interaction": "^4.4.0",    "@fullcalendar/resource-common": "^4.4.0",    "@fullcalendar/timegrid": "^4.4.0",    "@ionic-native/core": "^5.22.0",    "@ionic-native/in-app-browser": "^5.22.0",    "@ionic-native/social-sharing": "^5.22.0",    "@ionic-native/splash-screen": "^5.22.0",    "@ionic-native/status-bar": "^5.22.0",    "@ionic/angular": "^4.11.10",    "@ionic/pro": "2.0.4",    "@ionic/storage": "^2.2.0",    "@ngx-translate/core": "^12.1.2",    "@sentry/browser": "^4.6.6",    "angular2-counto": "^1.2.5",    "angularfire2": "^5.4.2",    "cordova": "^9.0.0",  }我已經嘗試了幾個小時的不同,但我只是不知道我錯過了什么。是否有要包含的特殊模塊或其他內容?
查看完整描述

2 回答

?
心有法竹

TA貢獻1866條經驗 獲得超5個贊

將社交分享添加到app.module.ts下providers。


import { SocialSharing } from '@ionic-native/social-sharing/ngx';


@NgModule({

  declarations: [AppComponent],

  entryComponents: [],

  imports: [],

  providers: [

    ...

    SocialSharing,

    ...

  ],

  bootstrap: [AppComponent]

})

export class AppModule {}


查看完整回答
反對 回復 2022-07-08
?
嗶嗶one

TA貢獻1854條經驗 獲得超8個贊

很重要!我解決了 Android 中的一個問題的更新,即:@dipesious

您將獲得一系列不同的包作為 .catch(error) 這意味著您沒有向清單添加 QUERY_ALL_PACKAGES 權限。將此添加到您的 Android 清單文件中:祝賀 BUG RESOLVED...


查看完整回答
反對 回復 2022-07-08
  • 2 回答
  • 0 關注
  • 151 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號