I have installed the last version of facebook plugin from Ionic Native page
I’m trying to open the share dialog and the pluggin is issuing the following error:
On Chrome
ERROR TypeError: Object(…) is not a function
at Facebook.showDialog (index.js:31)
at ContentDetailPage.webpackJsonp.948.ContentDetailPage.facebookShare (content-detail.ts:860)
at SafeSubscriber._next (content-detail.ts:826)
at SafeSubscriber.__tryOrUnsub (Subscriber.js:238)
at SafeSubscriber.next (Subscriber.js:185)
at Subscriber._next (Subscriber.js:125)
at Subscriber.next (Subscriber.js:89)
at SafeSubscriber._next (app-server.ts:180)
at SafeSubscriber.__tryOrUnsub (Subscriber.js:238)
at SafeSubscriber.next (Subscriber.js:185)
On Android
vendor.js:1704 ERROR TypeError: Object(…) is not a function
at Facebook.showDialog (vendor.js:82874)
at ContentDetailPage.webpackJsonp.948.ContentDetailPage.facebookShare (0.js:794)
at SafeSubscriber._next (0.js:769)
at SafeSubscriber.__tryOrUnsub (vendor.js:22574)
at SafeSubscriber.next (vendor.js:22521)
at Subscriber._next (vendor.js:22461)
at Subscriber.next (vendor.js:22425)
at SafeSubscriber._next (main.js:3732)
at SafeSubscriber.__tryOrUnsub (vendor.js:22574)
at SafeSubscriber.next (vendor.js:22521)
Here is my code:
this.fb.showDialog({
method: ‘share’,
href: url,
caption: ‘Your comment’
description: this.condes,
picture: this.coverurl
}).then((response) => {
console.log('Share response: ',response);
}).catch((error) => {
console.log('Share error: ',error);
})
Plugin versions:
Cordova Facebook
name=“cordova-plugin-facebook4” spec=“4.2.1”
Ionic Native Facebook
“_from”: “@ionic-native/facebook”,
“_id”: “@ionic-native/facebook@5.2.0”,
Here is my enviroment information:
Ionic:
ionic (Ionic CLI) : 4.12.0 (C:\Users\flavi\AppData\Roaming\npm\node_modules\ionic)
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, browser 5.0.4
Cordova Plugins : cordova-plugin-ionic-webview 1.1.1, (and 21 other plugins)
System:
Android SDK Tools : 26.1.1 (D:\Dev\Android\Android-sdk)
NodeJS : v8.9.4 (C:\Program Files\nodejs\node.exe)
npm : 6.4.1
OS : Windows 10
What can I do?
Thanks