Problem social-sharing ionic v 3

I get error when i use social-sharing on ionic3
this error :
error

my .html : <button ion-button full (click)=“shareTwitter()”>share

.ts : async shareTwitter() {
// Either URL or Image
this.socialSharing.shareViaTwitter(null, null, this.url).then(() => {

}).catch((e) => {
 
});

}

this my plugins

cordova plugin ls
cordova-plugin-device 2.0.2 “Device”
cordova-plugin-file 6.0.1 “File”
cordova-plugin-ionic-keyboard 2.1.3 “cordova-plugin-ionic-keyboard”
cordova-plugin-ionic-webview 2.2.5 “cordova-plugin-ionic-webview”
cordova-plugin-splashscreen 5.0.2 “Splashscreen”
cordova-plugin-statusbar 2.4.2 “StatusBar”
cordova-plugin-whitelist 1.3.3 “Whitelist”
cordova-plugin-x-socialsharing 5.4.3 “SocialSharing”
es6-promise-plugin 4.2.2 “Promise”

my ionic info
Ionic:

ionic (Ionic CLI) : 4.5.0 (C:\Users\ACER\AppData\Roaming\npm\node_modules\io
nic)
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.2.1

Cordova:

cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
Cordova Platforms : android 7.1.4
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-i
onic-webview 2.2.5, (and 6 other plugins)

System:

NodeJS : v10.14.0 (C:\Program Files\nodejs\node.exe)
npm : 6.4.1
OS : Windows 8.1

thankss

Hello,

Try this:

twitterShare() {
this.socialSharing.shareViaTwitter("Text ", “Image”, “URL”).then(() => {
console.log(“shareViaTwitter: Success”);
}).catch(() => {
console.error(“shareViaTwitter: failed”);
});
}

thanks… i have fixed this issues…

2 Likes

what is your solution? help!

my cordova is not installed yesterday…

I have problems Whit social-sharing i don’t hace use because not declarated as provider :sleepy:

hei check this :
must have ngx in folder social-sharing
image


TypeError: Object(…) is not a function
at SocialSharing.canShareViaEmail
declared in mi app.module.ts
import {SocialSharing} from ‘@ionic-native/social-sharing/ngx’;
providers[
SocialSharing
]

hei friend at import dont use ‘ngx’ i just want you to chect thats folder
and for ionic v 3 use “cordova-plugin-x-socialsharing”: “4.x.x”,

1 Like

Thanks I fixed my issues , sorry for my english is very bad :wink:

dont exist version 4 on npm :confused: