import { Component, OnInit } from '@angular/core';
import { SocialSharing } from '@ionic-native/social-sharing/ngx';
@Component({
selector: 'app-video',
templateUrl: './video.page.html',
styleUrls: ['./video.page.scss'],
})
export class VideoPage implements OnInit {
constructor(private socialSharing: SocialSharing) { }
ngOnInit() {
}
}
this.socialSharing.shareViaWhatsApp(Text, Image, URL).then((res) => {
// Success
}).catch((e) => {
// Error!
});
this.socialSharing.shareViaFacebook(Text, Image, URL).then((res) => {
// Success
}).catch((e) => {
// Error!
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.7.5/angular.min.js"></script>
控制台日志时收到错误消息:无法在模块的webpack_require (bootstrap:84) 处读取模块../src/app/video/video.page.ts (video.page.ts:19) 处未定义的属性“socialSharing” 。 ./src/app/video/video-routing.module.ts (video-video-module.js:27)
已遵循以下说明: https ://enappd-apps.gitbook.io/apps/ionic-4-full-app/pro-pack-features/social-logins