Cannot read property 'socialSharing' of undefined in Ionic 4

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

If you’ve paid somebody for something, you might want to contact their support as well. All that I can say given what I see here is to reiterate the error message: it is telling you what exact line contains code that looks like foo.socialSharing, and your problem is that foo is undefined at that point.

still not working getting error message:
text is not an assignable paramater

import { Component, OnInit } from ‘@angular/core’;
import { SocialSharing } from ‘@ionic-native/social-sharing/ngx’;

import { url } from ‘inspector’;
import { Subject } from ‘rxjs/internal/Subject’;

@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.shareViaInstagram(Text, Image).then((res) => {
// Success
}).catch((e) => {
// Error!
});

this.socialSharing.shareViaFacebook(Text, Image, URL).then((res) => {
// Success
}).catch((e) => {
// Error!
});

this.socialSharing.shareViaTwitter(Text, Image, url).then((res) => {
// Success
}).catch((e) => {
// Error!
});

}
}

I really think your best bet remains asking the vendor for assistance, as the things that are likely necessary for volunteers unfamiliar with their products (like me and probably most everybody else here) may well run afoul of the licensing terms you agreed to with them.

If this is your code, so what are Text or Image? You must provide your text or image there.

1 Like