Browse Source

share event works fine

master
arnaucode 7 years ago
parent
commit
3df4de2b9b
6 changed files with 26 additions and 23 deletions
  1. +1
    -0
      config.xml
  2. +3
    -3
      plugins/android.json
  3. +8
    -8
      plugins/fetch.json
  4. +2
    -2
      www/js/app.js
  5. +4
    -4
      www/js/event.js
  6. +8
    -6
      www/js/events.js

+ 1
- 0
config.xml

@ -20,4 +20,5 @@
<param name="ios-package" onload="true" value="CDVStatusBar" />
</feature>
<plugin name="cordova-plugin-x-socialsharing" spec="~5.1.6" />
<plugin name="cordova-plugin-whitelist" spec="~1.3.1" />
</widget>

+ 3
- 3
plugins/android.json

@ -19,14 +19,14 @@
"cordova-plugin-statusbar": {
"PACKAGE_NAME": "com.ionicframework.openeventsplatformapp652778"
},
"cordova-plugin-whitelist": {
"PACKAGE_NAME": "com.ionicframework.openeventsplatformapp652778"
},
"cordova-plugin-x-socialsharing": {
"PACKAGE_NAME": "com.ionicframework.openeventsplatformapp652778"
},
"ionic-plugin-keyboard": {
"PACKAGE_NAME": "com.ionicframework.openeventsplatformapp652778"
},
"cordova-plugin-whitelist": {
"PACKAGE_NAME": "com.ionicframework.openeventsplatformapp652778"
}
},
"dependent_plugins": {}

+ 8
- 8
plugins/fetch.json

@ -1,12 +1,4 @@
{
"cordova-plugin-whitelist": {
"source": {
"type": "registry",
"id": "cordova-plugin-whitelist@1.3.1"
},
"is_top_level": true,
"variables": {}
},
"cordova-plugin-statusbar": {
"source": {
"type": "registry",
@ -54,5 +46,13 @@
},
"is_top_level": true,
"variables": {}
},
"cordova-plugin-whitelist": {
"source": {
"type": "registry",
"id": "cordova-plugin-whitelist@1.3.1"
},
"is_top_level": true,
"variables": {}
}
}

+ 2
- 2
www/js/app.js

@ -137,8 +137,8 @@ angular.module('app', [
.factory('api', function($http) {
return {
init: function() {
$http.defaults.headers.common['X-Access-Token'] = localStorage.getItem("cim_app_token");
$http.defaults.headers.post['X-Access-Token'] = localStorage.getItem("cim_app_token");
$http.defaults.headers.common['X-Access-Token'] = localStorage.getItem("events_app_token");
$http.defaults.headers.post['X-Access-Token'] = localStorage.getItem("events_app_token");
}
};
})

+ 4
- 4
www/js/event.js

@ -56,12 +56,12 @@ angular.module('app.event', ['pascalprecht.translate', 'ui-leaflet'])
$scope.share = function(event){
var message = event.description;
var subject = event.title;
var file= ['',''];
var message = "[" + event.title + "]" + event.description;
/*var subject = event.title;
var file= ['',''];*/
var link = "http://duckduckgo.com";
$cordovaSocialSharing
.share(message, subject, file, link) // Share via native share sheet
.share(message, link) // Share via native share sheet
.then(function(result) {
// Success!
}, function(err) {

+ 8
- 6
www/js/events.js

@ -1,13 +1,15 @@
angular.module('app.events', ['pascalprecht.translate'])
.controller('EventsCtrl', function($scope, $http, $ionicModal, $timeout, $ionicLoading, $filter) {
.controller('EventsCtrl', function($scope, $http, $ionicModal,
$timeout, $ionicLoading, $filter) {
$scope.events=[];
$scope.page=0;
$scope.doRefresh = function() {
/* events refresh: */
$http.get(urlapi + 'events?page=' + $scope.page)
//$http.get(urlapi + 'events?page=' + $scope.page)
$http.get(urlapi + 'events')
.then(function(data){
console.log('data success events');
console.log(data); // for browser console
@ -25,12 +27,12 @@ angular.module('app.events', ['pascalprecht.translate'])
$scope.doRefresh();
$scope.share = function(event){
var message = event.description;
var subject = event.title;
var file= ['',''];
var message = "[" + event.title + "]" + event.description;
/*var subject = event.title;
var file= ['',''];*/
var link = "http://duckduckgo.com";
$cordovaSocialSharing
.share(message, subject, file, link) // Share via native share sheet
.share(message, link) // Share via native share sheet
.then(function(result) {
// Success!
}, function(err) {

Loading…
Cancel
Save