Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,22 @@ matrix:
node_js: "6"
jdk: oraclejdk8
script: npm run ci.tslint
- stage: "WebPack"
os: osx
env:
- Platform="iOS"
osx_image: xcode8.3
language: node_js
node_js: "6"
jdk: oraclejdk8
script: npm run build && cd ../demo && npm i && npm run build-ios-bundle && cd ../demo-angular && npm i && npm run build-ios-bundle
- language: android
os: linux
env:
- Platform="Android"
jdk: oraclejdk8
before_install: nvm install 6.10.3
script: cd src && npm run build && cd ../demo && npm i && npm run build-android-bundle && cd ../demo-angular && npm i && npm run build-android-bundle
- stage: "Build"
env:
- Android="23"
Expand Down
6 changes: 2 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,15 @@ Third-party patches are essential for keeping nativescript-facebook plugin great
git clone git@github.com:<your-username>/nativescript-facebook.git

* Make commits of logical units.
* Make sure your commit messages are in the proper format.
* Make sure your commit messages are in the proper format. We strongly recommend to use [semantic commit messages](https://seesparkbox.com/foundry/semantic_commit_messages)
* Add tests for your changes and make them pass. How to run tests you can find in [Testing section](#Testing)
* Push your changes to a topic branch in your fork of the repository.
* Submit a pull request to the **nativescript-facebook** repository.

## <a name='Testing'> Testing </a>
## Testing

There are three main points in order to get nativescript-facebook e2e UI tests running locally on iOS 10 Simulator and Android api 23 Emulator. Before that if you want to take a look at the tests and make some changes find them located in `demo/e2e-tests` folder.

Note, that all commands below assume you have installed npm packages in /src and /demo folders (`$ npm i`) and you are using OS X in order to use both iOS Simulator and Android emulator.

* Install Appium. Test execution depends on [nativescript-dev-appium](https://github.com/NativeScript/nativescript-dev-appium) plugin which is added as dev dependency in `demo` app folder and first command satisfies its requirement to have appium installed.

$ npm install -g appium@1.6.3
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ NativeScript : Facebook SDK ![apple](https://cdn3.iconfinder.com/data/icons/pico
- [Login Response](#login-response)
- [Graph API Example](#graph-api-example)
- [Release notes](#release-notes)
- [FAQ](#faq)
- [Contributing](#contributing)
- [License](#license)

<!-- /TOC -->
Expand Down Expand Up @@ -468,5 +470,8 @@ This sample is part of the demo apps and can be observed [here](https://github.c
## FAQ
Check out our FAQ section [here](https://github.com/NativeScript/nativescript-facebook/wiki/FAQ).

## Contributing
Check out our Contribution guide [here](https://github.com/NativeScript/nativescript-facebook/blob/master/CONTRIBUTING.md).

## License
[Apache 2.0](https://github.com/NativeScript/nativescript-facebook/blob/master/LICENSE)
2 changes: 1 addition & 1 deletion demo-angular/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { AppComponent } from "./app.component";
import { LoginModule } from "./pages/login/login.module";
import { HomeModule } from "./pages/home/home.module";
import { NativeScriptFacebookModule } from "nativescript-facebook/angular";
import * as application from 'application';
import * as application from 'tns-core-modules/application';
import { routes } from "./app.routing";
import { NavigationService } from "./services/navigation.service";

Expand Down
10 changes: 5 additions & 5 deletions demo-angular/app/pages/home/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { Component, ChangeDetectorRef } from "@angular/core";
import * as Facebook from "nativescript-facebook";
import { NavigationService } from "../../services/navigation.service";
import { config } from "../../app.config";
let http = require("http");
let appSettings = require("application-settings");
import * as http from "tns-core-modules/http";
import * as appSettings from "tns-core-modules/application-settings";

@Component({
selector: "home",
Expand All @@ -20,13 +20,13 @@ export class HomeComponent {
constructor(private ref: ChangeDetectorRef, private navigationService: NavigationService) {
// Get logged in user's info
http.getJSON(config.FACEBOOK_GRAPH_API_URL + "/me?access_token=" + this.accessToken).then((res) => {
this.username = res.name;
this.userId = res.id;
this.username = res["name"];
this.userId = res["id"];

// Get logged in user's avatar
// ref: https://github.com/NativeScript/NativeScript/issues/2176
http.getJSON(config.FACEBOOK_GRAPH_API_URL + "/" + this.userId + "/picture?type=large&redirect=false&access_token=" + this.accessToken).then((res) => {
this.avatarUrl = res.data.url;
this.avatarUrl = res["data"]["url"];
this.ref.detectChanges();
}, function (err) {
alert("Error getting user info: " + err);
Expand Down
2 changes: 1 addition & 1 deletion demo-angular/app/pages/login/login.component.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component, ChangeDetectorRef } from "@angular/core";
import * as Facebook from "nativescript-facebook";
import { NavigationService } from "../../services/navigation.service";
let appSettings = require("application-settings");
import * as appSettings from "tns-core-modules/application-settings";

@Component({
selector: "login",
Expand Down
6 changes: 3 additions & 3 deletions demo-angular/app/vendor-platform.android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
// At runtime the module gets loaded *before* the rest of the app code, so code
// placed here needs to be careful about its dependencies.

require("application");
require("ui/frame");
require("ui/frame/activity");
require("tns-core-modules/application");
require("tns-core-modules/ui/frame");
require("tns-core-modules/ui/frame/activity");

if (global.TNS_WEBPACK) {
global.__requireOverride = function (name, dir) {
Expand Down
17 changes: 9 additions & 8 deletions demo-angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"nativescript": {
"id": "org.nativescript.demoangular",
"tns-android": {
"version": "3.0.0"
"version": "3.0.1"
},
"tns-ios": {
"version": "3.0.1"
Expand All @@ -29,7 +29,7 @@
},
"devDependencies": {
"@angular/compiler-cli": "~4.0.0",
"@ngtools/webpack": "1.3.0",
"@ngtools/webpack": "~1.4.0",
"babel-traverse": "6.12.0",
"babel-types": "6.11.1",
"babylon": "6.8.4",
Expand All @@ -43,17 +43,18 @@
"lazy": "1.0.11",
"nativescript-css-loader": "~0.26.0",
"nativescript-dev-typescript": "^0.4.0",
"nativescript-dev-webpack": "^0.4.0",
"nativescript-dev-webpack": "^0.6.3",
"raw-loader": "~0.5.1",
"resolve-url-loader": "~2.0.2",
"typescript": "~2.2.2",
"webpack": "~2.3.3",
"webpack-sources": "~0.2.3"
"typescript": "~2.3.4",
"webpack": "~2.6.1",
"webpack-sources": "~1.0.1"
},
"scripts": {
"ns-bundle": "ns-bundle",
"start-android-bundle": "npm run ns-bundle --android --start-app",
"start-ios-bundle": "npm run ns-bundle --ios --start-app",
"publish-ios-bundle": "npm run ns-bundle --ios --publish-app",
"start-android-bundle": "npm run ns-bundle --android --run-app",
"start-ios-bundle": "npm run ns-bundle --ios --run-app",
"build-android-bundle": "npm run ns-bundle --android --build-app",
"build-ios-bundle": "npm run ns-bundle --ios --build-app"
}
Expand Down
1 change: 0 additions & 1 deletion demo-angular/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"baseUrl": ".",
"paths": {
"*": [
"./node_modules/tns-core-modules/*",
"./node_modules/*"
]
},
Expand Down
2 changes: 0 additions & 2 deletions demo-angular/webpack.android.js

This file was deleted.

151 changes: 0 additions & 151 deletions demo-angular/webpack.common.js

This file was deleted.

2 changes: 0 additions & 2 deletions demo-angular/webpack.ios.js

This file was deleted.

2 changes: 1 addition & 1 deletion demo/app/app.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import "./bundle-config";

import * as application from 'application';
import * as application from 'tns-core-modules/application';
import { init } from "nativescript-facebook";

application.on(application.launchEvent, function (args) {
Expand Down
2 changes: 1 addition & 1 deletion demo/app/bundle-config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
if ((<any>global).TNS_WEBPACK) {
require("bundle-entry-points");
require("tns-core-modules/bundle-entry-points");

global.registerModule("login-page", () => require("./login-page"));
global.registerModule("home-page", () => require("./home-page"));
Expand Down
10 changes: 5 additions & 5 deletions demo/app/home-view-model.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Observable } from 'data/observable';
import { Observable } from 'tns-core-modules/data/observable';
import { LoginEventData, logout as fbLogout } from "nativescript-facebook";

let frameModule = require("ui/frame");
let appSettings = require("application-settings");
let imageSource = require("image-source");
let http = require("http");
let frameModule = require("tns-core-modules/ui/frame");
let appSettings = require("tns-core-modules/application-settings");
let imageSource = require("tns-core-modules/image-source");
let http = require("tns-core-modules/http");
let config = require("./app.config").config;

export class HomeViewModel extends Observable {
Expand Down
6 changes: 3 additions & 3 deletions demo/app/login-view-model.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Observable } from 'data/observable';
import { Observable } from 'tns-core-modules/data/observable';
import { LoginEventData, login as fbLogin } from "nativescript-facebook";
let frameModule = require("ui/frame");
let appSettings = require("application-settings");
let frameModule = require("tns-core-modules/ui/frame");
let appSettings = require("tns-core-modules/application-settings");

export class LoginViewModel extends Observable {

Expand Down
2 changes: 1 addition & 1 deletion demo/app/vendor.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
require("./vendor-platform");

require("bundle-entry-points");
require("tns-core-modules/bundle-entry-points");
Loading