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>
getting error message when console log: Cannot read property 'socialSharing' of undefined at Module../src/app/video/video.page.ts (video.page.ts:19) at webpack_require (bootstrap:84) at Module../src/app/video/video-routing.module.ts (video-video-module.js:27)
have followed instruction on: https://enappd-apps.gitbook.io/apps/ionic-4-full-app/pro-pack-features/social-logins
Thanks for the response, but it is not really working. Getting error messages (see screenshots)enter image description here
![{ "resource": "/c:/Users/Owner/ionic4-background-video-app/src/app/video/video.page.ts", "owner": "typescript", "code": "2693", "severity": 8, "message": "'Body' only refers to a type, but is being used as a value here.", "source": "ts", "startLineNumber": 50, "startColumn": 34, "endLineNumber": 50, "endColumn": 38 }]1