0

I am trying to follow the tutorial example in ionic with the line

window.plugins.socialsharing.shareWithOptions(options, onSuccess, onError);

but I keep getting

ionic.bundle.js:20306 TypeError: Cannot read property 'socialsharing' of undefined

I guess I am missing something in the app.js to include the library?

angular.module('starter', ['ionic','leaflet-directive', 'ngCordova', ... ?

Do I need to load it in the above line? Do I have to load it into the controller as a module? I didnt find that on the tutorial and it's not clear?

I tried cordova plugin add multiple times, either as the package name or through git

4

1 回答 1

0

原来我正在查看错误的文档。如果使用 ionic,请查看ngCordova文档而不是官方包文档。它们不一致。

我必须添加$cordovaSocialSharing到我的控制器,它可以在设备上运行,而不是在模拟器中,也不是在我的开发浏览器 chrome 中。

于 2016-07-15T22:03:14.987 回答