zoukankan      html  css  js  c++  java
  • ionic cordova social media sharing plugin

    https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin.git
    

      从上面的连接下载 插件

    1.肯定是要加入 下面的那个文件的吖 从这里下载 ngCordova.min.js

    2. 不要忘记了 在app.js 中注入 ngCordova 

    1 angular.module('starter', ['ionic', 'ngCordova'])

    3. 在控制器中  注意:不要忘记注入  $cordovaSocialSharing ,不然会报错的呀

    .controller("yourCtr", function($scope, $cordovaSocialSharing) {
     
        $scope.shareAnywhere = function() {
            $cordovaSocialSharing.share("This is your message", "This is your subject", "www/imagefile.png", "http://www.baidu.com");
        }
     
        $scope.shareViaTwitter = function(message, image, link) {
            $cordovaSocialSharing.canShareVia("twitter", message, image, link).then(function(result) {
                $cordovaSocialSharing.shareViaTwitter(message, image, link);
            }, function(error) {
                alert("Cannot share on Twitter");
            });
        }
     
    });

    4.your HTML 中call this function

    <button class="button" ng-click="shareAnywhere()">Share anywhere</button>
    <button class="button" ng-click="shareViaTwitter('some message', null, 'http:www.baidu.com')">Share on Twitter</button>

    5.好了  完成了....这个插件好像可以分享到QQ空间去的呢  当然前提是你的手机上有下载 QQ空间了...hahha

  • 相关阅读:
    LeetCode 264. Ugly Number II
    LeetCode 231. Power of Two
    LeetCode 263. Ugly Number
    LeetCode 136. Single Number
    LeetCode 69. Sqrt(x)
    LeetCode 66. Plus One
    LeetCode 70. Climbing Stairs
    LeetCode 628. Maximum Product of Three Numbers
    Leetcode 13. Roman to Integer
    大二暑假周进度报告03
  • 原文地址:https://www.cnblogs.com/xieyier/p/4061900.html
Copyright © 2011-2022 走看看