通过电子邮件进行社交分享cordova onsen angularjs

时间:2016-01-28 20:15:14

标签: android angularjs cordova onsen-ui

我使用Onsen UI,角度JS和cordova plataform构建Android应用程序。我使用此插件https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin.git通过电子邮件分享一些信息。我的代码是:

controller.js



var app = ons.bootstrap('my-app', ['onsen','ngCordova']);


app.controller('PageController', function($scope) {
        ons.ready(function() {
          // Init code here
        });
      });
app.controller("ExampleController", function($scope, $cordovaSocialSharing) {
 
     $scope.shareviaemail = function() {
        $cordovaSocialSharing.shareViaEmail("i like you","exams", ['to@person1.com'], ['cc@person1.com'],null, "www/antonis.jpg")
   }
 
 
});

<!DOCTYPE html>
<html >
  <head>
    <meta charset="UTF-8">
    <title>my app</title>
    
    
    
<link rel='stylesheet prefetch' href='css/onsenui.css'>
<link rel='stylesheet prefetch' href='css/onsen-css-components.css'>

<link rel="stylesheet" href="css/onsen-css-components-blue-basic-theme.css">
<link rel="stylesheet" href="styles/list_avatars.css">
<link rel="stylesheet" href="styles/list.css">
<link rel="stylesheet" href="styles/list_thumbnails.css">
 <script src='js/angular/angular.js'></script>
 <script src='js/onsenui.js'></script> 
<script src='scripts/controller.js'></script> 
  <script src="js/ng-cordova.min.js"></script>
 <script src="cordova.js"></script>
</head>

  <body ng-controller="PageController">

  <ons-page ng-controller="ExampleController">


<ons-button ng-click="shareviaemail()">Share email</ons-button>

</ons-page>
    
  </body>
</html>
&#13;
&#13;
&#13;

它运行得很完美,但是当你必须选择要用来分享电子邮件的应用程序时,打开很多应用程序,如viber,skype等。我想只选择电子邮件等outlook,gmail

0 个答案:

没有答案