Skip to content

Commit 60e302b

Browse files
author
Lukas Narusevicius
committed
Merge
2 parents 1f1abc3 + 6621292 commit 60e302b

41 files changed

Lines changed: 603 additions & 753 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.travis.yml

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ matrix:
1919
- stage: "Lint"
2020
language: node_js
2121
os: linux
22-
node_js: "8"
22+
node_js: "10"
2323
script: cd src && npm run ci.tslint && cd ../demo && npm run ci.tslint && cd ../demo-angular && npm run ci.tslint
2424
- stage: "WebPack and Build"
2525
os: osx
@@ -28,7 +28,7 @@ matrix:
2828
- Type="VanillaJS"
2929
osx_image: xcode10.0
3030
language: node_js
31-
node_js: "8"
31+
node_js: "10"
3232
jdk: oraclejdk8
3333
before_script: pod repo update
3434
script:
@@ -42,7 +42,7 @@ matrix:
4242
- Type="VueJS"
4343
osx_image: xcode10.0
4444
language: node_js
45-
node_js: "8"
45+
node_js: "10"
4646
jdk: oraclejdk8
4747
before_script: pod repo update
4848
script:
@@ -56,7 +56,7 @@ matrix:
5656
- Type="Angular"
5757
osx_image: xcode10.0
5858
language: node_js
59-
node_js: "8"
59+
node_js: "10"
6060
jdk: oraclejdk8
6161
before_script: pod repo update
6262
script:
@@ -65,54 +65,61 @@ matrix:
6565
- npm i && tns build ios --bundle --env.uglify --env.aot
6666
- language: android
6767
os: linux
68+
dist: trusty
6869
env:
6970
- WebpackAndroid="28"
7071
- Type="VanillaJS"
7172
jdk: oraclejdk8
72-
before_install: nvm install 8
73+
before_install: nvm install 10
7374
script:
7475
- cd src && npm run build
7576
- cd ../demo && npm i && tns build android --bundle --env.uglify --env.snapshot --copy-to "./outputs/app-debug.apk"
7677
- "curl -u $SAUCE_USER:$SAUCE_KEY -X POST -H 'Content-Type: application/octet-stream' $ANDROID_SAUCE_STORAGE/$ANDROID_PACKAGE_JS?overwrite=true --data-binary @$ANDROID_PACKAGE_FOLDER_JS/app-debug.apk"
7778
- language: android
7879
os: linux
80+
dist: trusty
7981
env:
8082
- WebpackAndroid="28"
8183
- Type="VueJS"
8284
jdk: oraclejdk8
83-
before_install: nvm install 8
85+
before_install: nvm install 10
8486
script:
8587
- cd src && npm run build
8688
- cd ../demo-vue && npm i && tns build android --bundle --env.uglify --copy-to "./outputs/app-debug.apk"
8789
- "curl -u $SAUCE_USER:$SAUCE_KEY -X POST -H 'Content-Type: application/octet-stream' $ANDROID_SAUCE_STORAGE/$ANDROID_PACKAGE_VUE?overwrite=true --data-binary @$ANDROID_PACKAGE_FOLDER_VUE/app-debug.apk"
8890
- language: android
8991
os: linux
92+
dist: trusty
9093
env:
9194
- WebpackAndroid="28"
9295
- Type="Angular"
9396
jdk: oraclejdk8
94-
before_install: nvm install 8
97+
before_install: nvm install 10
9598
script:
9699
- cd src && npm run build
97100
- cd ../publish && sh pack.sh
98101
- cd ../demo-angular && tns plugin add ../publish/package/*.tgz
99102
- npm i && tns build android --bundle --env.uglify --env.snapshot --env.aot
100103
- language: android
104+
os: linux
105+
dist: trusty
101106
env:
102107
- BuildAndroid="28"
103108
- Type="VanillaJS"
104-
os: linux
109+
105110
jdk: oraclejdk8
106-
before_install: nvm install 8.11.4
111+
before_install: nvm install 10
107112
script:
108113
- cd demo && npm run ci.android.build
109114
- language: android
115+
os: linux
116+
dist: trusty
110117
env:
111118
- BuildAndroid="28"
112119
- Type="Angular"
113-
os: linux
120+
114121
jdk: oraclejdk8
115-
before_install: nvm install 8.11.4
122+
before_install: nvm install 10
116123
script:
117124
- cd demo-angular && npm run ci.android.build
118125
- os: osx
@@ -122,7 +129,7 @@ matrix:
122129
- Type="VanillaJS"
123130
osx_image: xcode10.0
124131
language: node_js
125-
node_js: "8"
132+
node_js: "10"
126133
jdk: oraclejdk8
127134
before_script: pod repo update
128135
script:
@@ -134,7 +141,7 @@ matrix:
134141
- Type="Angular"
135142
osx_image: xcode10.0
136143
language: node_js
137-
node_js: "8"
144+
node_js: "10"
138145
jdk: oraclejdk8
139146
before_script: pod repo update
140147
script:
@@ -145,7 +152,7 @@ matrix:
145152
- Type="VanillaJS"
146153
language: node_js
147154
os: linux
148-
node_js: "8"
155+
node_js: "10"
149156
script:
150157
- npm i -g appium
151158
- cd demo && npm i
@@ -156,7 +163,7 @@ matrix:
156163
- Type="VueJS"
157164
language: node_js
158165
os: linux
159-
node_js: "8"
166+
node_js: "10"
160167
script:
161168
- npm i -g appium
162169
- cd demo-vue && npm i
@@ -166,7 +173,7 @@ matrix:
166173
- iOS="12.0"
167174
- Type="VanillaJS"
168175
language: node_js
169-
node_js: "8"
176+
node_js: "10"
170177
script:
171178
- npm i -g appium
172179
- cd demo && npm i
@@ -176,7 +183,7 @@ matrix:
176183
- iOS="12.0"
177184
- Type="VueJS"
178185
language: node_js
179-
node_js: "8"
186+
node_js: "10"
180187
script:
181188
- npm i -g appium
182189
- cd demo-vue && npm i
@@ -195,6 +202,6 @@ before_install:
195202
- sudo pip install six
196203

197204
install:
198-
- npm install -g nativescript
205+
- echo no | npm install -g nativescript
199206
- tns usage-reporting disable
200207
- tns error-reporting disable

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,11 +348,17 @@ If the Messenger app is not installed, the Send button will be hidden. Be sure t
348348

349349
### Show Share Dialog Programmatically
350350

351-
**Note** The share dialog will try fallback to browse page sharing if user doesn't have Facebook installed (only for linkContent)
351+
**Note** The share dialog will try fallback to browse page sharing if user doesn't have Facebook installed (only for linkContent)
352352

353353
```TypeScript
354354
showShareDialog(this.linkContent);
355355
showMessageDialog(this.linkContent);
356+
showShareDialog(this.linkContent, (error:Error, result:ShareCallbackResult) => {
357+
if(!error){
358+
console.log(result.android); // com.facebook.share.Sharer.Result
359+
console.log(result.ios); // (NSDictionary * ) The results from the sharer. This may be nil or empty.
360+
}
361+
});
356362
```
357363

358364
### Hide Custom Button If Can't share
@@ -558,6 +564,12 @@ If the Messenger app is not installed, the Send button will be hidden. Be sure t
558564
```TypeScript
559565
showShareDialog(this.linkContent);
560566
showMessageDialog(this.linkContent);
567+
showShareDialog(this.linkContent, (error:Error, result:ShareCallbackResult) => {
568+
if(!error){
569+
console.log(result.android); // com.facebook.share.Sharer.Result
570+
console.log(result.ios); // (NSDictionary * ) The results from the sharer. This may be nil or empty.
571+
}
572+
});
561573
```
562574

563575
### Hide Custom Button If Can't share

demo-angular/app/app.module.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,14 @@ import { NgModule, NO_ERRORS_SCHEMA } from "@angular/core";
22
import { NativeScriptModule } from "nativescript-angular/nativescript.module";
33
import { NativeScriptRouterModule } from "nativescript-angular/router";
44
import { AppComponent } from "./app.component";
5-
import { LoginModule } from "./pages/login/login.module";
6-
import { HomeModule } from "./pages/home/home.module";
75
import { NativeScriptFacebookModule } from "nativescript-facebook/angular";
86
import * as application from 'tns-core-modules/application';
97
import { routes } from "./app.routing";
108
import { NavigationService } from "./services/navigation.service";
11-
import { init, initAnalytics, LoginBehavior } from "nativescript-facebook";
9+
import { init, initAnalytics } from "nativescript-facebook";
1210

1311
application.on(application.launchEvent, function (args) {
14-
init("1771472059772879", LoginBehavior.LoginBehaviorWeb);
12+
init("1771472059772879");
1513
initAnalytics();
1614
});
1715

demo-angular/app/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,5 @@
33
"v8Flags": "--expose_gc",
44
"requireModules": ["nativescript-facebook"]
55
},
6-
"main": "main.js",
7-
"name": "tns-template-hello-world-ng",
8-
"version": "2.5.0"
6+
"main": "main.js"
97
}

demo-angular/app/pages/login/login.component.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,13 @@ export class LoginComponent {
9999
}
100100

101101
onShareDialog() {
102-
Facebook.showShareDialog(this.linkContent);
102+
Facebook.showShareDialog(this.linkContent, (error, result) => {
103+
if (error) {
104+
console.error(error);
105+
return;
106+
}
107+
alert('Successfully shared');
108+
});
103109
}
104110

105111
onShareDialogPhotos() {

demo-angular/package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,27 @@
44
"nativescript": {
55
"id": "org.nativescript.demoangular",
66
"tns-ios": {
7-
"version": "5.1.0"
7+
"version": "5.4.0"
88
},
99
"tns-android": {
10-
"version": "5.1.0"
10+
"version": "5.4.0"
1111
}
1212
},
1313
"dependencies": {
14-
"@angular/common": "~7.1.0",
15-
"@angular/compiler": "~7.1.0",
16-
"@angular/core": "~7.1.0",
17-
"@angular/forms": "~7.1.0",
18-
"@angular/http": "~7.1.0",
19-
"@angular/platform-browser": "~7.1.0",
20-
"@angular/platform-browser-dynamic": "~7.1.0",
21-
"@angular/router": "~7.1.0",
22-
"nativescript-angular": "~7.1.0",
14+
"@angular/common": "~7.2.0",
15+
"@angular/compiler": "~7.2.0",
16+
"@angular/core": "~7.2.0",
17+
"@angular/forms": "~7.2.0",
18+
"@angular/http": "~7.2.0",
19+
"@angular/platform-browser": "~7.2.0",
20+
"@angular/platform-browser-dynamic": "~7.2.0",
21+
"@angular/router": "~7.2.0",
22+
"nativescript-angular": "~7.2.0",
2323
"nativescript-facebook": "../src",
2424
"nativescript-theme-core": "^1.0.4",
2525
"nativescript-unit-test-runner": "^0.3.4",
2626
"rxjs": "^6.3.3",
27-
"tns-core-modules": "^5.1.0",
27+
"tns-core-modules": "^5.0.0",
2828
"zone.js": "^0.8.4"
2929
},
3030
"devDependencies": {
@@ -33,8 +33,8 @@
3333
"karma-jasmine": "^1.0.2",
3434
"karma-nativescript-launcher": "^0.4.0",
3535
"nativescript-css-loader": "~0.26.0",
36-
"nativescript-dev-typescript": "~0.7.0",
37-
"nativescript-dev-webpack": "~0.18.0",
36+
"nativescript-dev-typescript": "~0.9.0",
37+
"nativescript-dev-webpack": "~0.22.0",
3838
"tslint": "~5.11.0"
3939
},
4040
"scripts": {

demo-vue/app/app.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@ import Login from "./components/Login";
55
import {
66
init,
77
initAnalytics,
8-
LoginBehavior
98
} from 'nativescript-facebook';
109

10+
import FacebookPlugin from "nativescript-facebook/vue";
11+
Vue.use(FacebookPlugin);
12+
1113
Vue.config.silent = true;
1214

1315
application.on(application.launchEvent, function (args) {
14-
init("1771472059772879", LoginBehavior.LoginBehaviorWeb);
16+
init("1771472059772879");
1517
initAnalytics();
1618
});
1719

demo-vue/app/components/Login.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,13 @@
125125
});
126126
},
127127
onShareDialog: function() {
128-
showShareDialog(this.linkContent);
128+
showShareDialog(this.linkContent, (error, result) => {
129+
if (error) {
130+
console.error(error);
131+
return;
132+
}
133+
alert('Successfully shared');
134+
});
129135
},
130136
onShareDialogPhotos: function() {
131137
showShareDialog(this.photosContent);

demo-vue/e2e/config/appium.capabilities.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,7 @@
1818
"platformVersion": "7.0",
1919
"deviceName": "Android GoogleAPI Emulator",
2020
"appiumVersion": "1.9.1",
21-
"noReset": true,
22-
"lt": 60000,
23-
"newCommandTimeout": 720,
24-
"appium-version": "1.9.1",
25-
"fullReset": false,
26-
"idleTimeout": 120,
27-
"automationName": "Appium"
21+
"noReset": true
2822
},
2923
"android25": {
3024
"platformName": "Android",

demo-vue/e2e/config/mocha.opts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
--timeout 800000
22
--recursive e2e
3+
--reporter mocha-multi
4+
--reporter-options mochawesome=-,mocha-junit-reporter=test-results.xml
35
--exit

0 commit comments

Comments
 (0)