我正在使用NgCordova的插件cordovaSocialShare在我的应用程序中在社交网络上进行共享。问题是我没有返回操作,并且在分析ADB日志时,它返回以下错误:
if ( str.startsWith("00") && ! str.startsWith("000") ) {
// ..
}
查看代码:
HTML
I / chromium (3635): [INFO: ISLAND (20306)] "TypeError: Can not call method 'canShareVia' of undefined
I / chromium (3635): Scope at $ scope.shareViaWhatsapp. (File: ///android_asset/www/js/app.js: 22: 31)
AngularJS
<ion-option-button class="button-dark button-facebook" ng-click="shareAnywhere()">
<i class="icon ion-social-facebook icon-facebook"></i>
</ion-option-button>
有人可以帮我吗?
答案 0 :(得分:2)
无论如何,我再一次自己决定了这个问题......
结果:
在命令行中:
ionic plugin add cordova-plugin-SocialSharing
AngularJS:
$scope.share = function($title, $excerpt, $permalink) {
$ionicListDelegate.closeOptionButtons();
window.plugins.socialsharing.share($title, $excerpt, null, $permalink);
}
HTML:
<ion-option-button class="button-positive button-share" ng-click="share('{{item.title}}', '{{item.excerpt}}', '{{item.permalink}}')">
<i class="icon ion-android-share-alt"></i>
</ion-option-button>