├── src ├── platforms │ ├── ios │ │ ├── build.xcconfig │ │ ├── Podfile │ │ ├── Info.plist │ │ └── README.md │ └── android │ │ ├── AndroidManifest.xml │ │ └── include.gradle ├── .gitignore ├── angular │ ├── index.ts │ ├── index.d.ts │ ├── package.json │ ├── nativescript-facebook-module.d.ts │ ├── nativescript-facebook-directives.d.ts │ ├── nativescript-facebook-module.ts │ └── nativescript-facebook-directives.ts ├── login-response.d.ts ├── app-events.d.ts ├── login-response.ts ├── .npmignore ├── vue │ ├── package.json │ └── facebook-vue-directives.ts ├── facebook-access-token.d.ts ├── deep-linking.d.ts ├── deep-linking.common.ts ├── facebook-access-token.ts ├── login-event-data.ts ├── index.android.ts ├── login-event-data.d.ts ├── ui │ ├── share-button.d.ts │ ├── login-button.android.ts │ ├── login-button.d.ts │ ├── share-button.common.ts │ ├── login-button.common.ts │ ├── share-button.ios.ts │ ├── share-button.android.ts │ └── login-button.ios.ts ├── index.d.ts ├── references.d.ts ├── tsconfig.json ├── app-events.ios.ts ├── app-events.android.ts ├── index.ios.ts ├── deep-linking.ios.ts ├── share-manager.common.d.ts ├── share-manager.common.ts ├── login-manager.d.ts ├── package.json ├── deep-linking.android.ts ├── login-manager.ios.ts └── share-manager.d.ts ├── demo ├── app │ ├── app-root.xml │ ├── app.config.ts │ ├── App_Resources │ │ ├── iOS │ │ │ ├── Assets.xcassets │ │ │ │ ├── Contents.json │ │ │ │ ├── AppIcon.appiconset │ │ │ │ │ ├── icon-29.png │ │ │ │ │ ├── icon-40.png │ │ │ │ │ ├── icon-50.png │ │ │ │ │ ├── icon-57.png │ │ │ │ │ ├── icon-72.png │ │ │ │ │ ├── icon-76.png │ │ │ │ │ ├── icon-29@2x.png │ │ │ │ │ ├── icon-29@3x.png │ │ │ │ │ ├── icon-40@2x.png │ │ │ │ │ ├── icon-40@3x.png │ │ │ │ │ ├── icon-50@2x.png │ │ │ │ │ ├── icon-57@2x.png │ │ │ │ │ ├── icon-60@2x.png │ │ │ │ │ ├── icon-60@3x.png │ │ │ │ │ ├── icon-72@2x.png │ │ │ │ │ ├── icon-76@2x.png │ │ │ │ │ ├── icon-83.5@2x.png │ │ │ │ │ └── Contents.json │ │ │ │ ├── LaunchImage.launchimage │ │ │ │ │ ├── Default.png │ │ │ │ │ ├── Default@2x.png │ │ │ │ │ ├── Default-568h@2x.png │ │ │ │ │ ├── Default-667h@2x.png │ │ │ │ │ ├── Default-736h@3x.png │ │ │ │ │ ├── Default-Landscape.png │ │ │ │ │ ├── Default-Portrait.png │ │ │ │ │ ├── Default-Landscape@2x.png │ │ │ │ │ ├── Default-Landscape@3x.png │ │ │ │ │ ├── Default-Portrait@2x.png │ │ │ │ │ └── Contents.json │ │ │ │ ├── LaunchScreen.Center.imageset │ │ │ │ │ ├── LaunchScreen-Center.png │ │ │ │ │ ├── LaunchScreen-Center@2x.png │ │ │ │ │ └── Contents.json │ │ │ │ └── LaunchScreen.AspectFill.imageset │ │ │ │ │ ├── LaunchScreen-AspectFill.png │ │ │ │ │ ├── LaunchScreen-AspectFill@2x.png │ │ │ │ │ └── Contents.json │ │ │ ├── logo.png │ │ │ ├── build.xcconfig │ │ │ ├── Info.plist │ │ │ └── LaunchScreen.storyboard │ │ └── Android │ │ │ ├── src │ │ │ └── main │ │ │ │ ├── res │ │ │ │ ├── drawable-hdpi │ │ │ │ │ ├── icon.png │ │ │ │ │ ├── logo.png │ │ │ │ │ └── background.png │ │ │ │ ├── drawable-ldpi │ │ │ │ │ ├── icon.png │ │ │ │ │ ├── logo.png │ │ │ │ │ └── background.png │ │ │ │ ├── drawable-mdpi │ │ │ │ │ ├── icon.png │ │ │ │ │ ├── logo.png │ │ │ │ │ └── background.png │ │ │ │ ├── drawable-xhdpi │ │ │ │ │ ├── icon.png │ │ │ │ │ ├── logo.png │ │ │ │ │ └── background.png │ │ │ │ ├── drawable-xxhdpi │ │ │ │ │ ├── icon.png │ │ │ │ │ ├── logo.png │ │ │ │ │ └── background.png │ │ │ │ ├── drawable-xxxhdpi │ │ │ │ │ ├── icon.png │ │ │ │ │ ├── logo.png │ │ │ │ │ └── background.png │ │ │ │ ├── values │ │ │ │ │ ├── strings.xml │ │ │ │ │ ├── colors.xml │ │ │ │ │ └── styles.xml │ │ │ │ └── drawable-nodpi │ │ │ │ │ └── splash_screen.xml │ │ │ │ └── AndroidManifest.xml │ │ │ └── app.gradle │ ├── package.json │ ├── app.ts │ ├── home-page.ts │ ├── login-page.ts │ ├── tests │ │ └── tests.js │ ├── app.css │ ├── home-page.xml │ ├── login-page.xml │ ├── home-view-model.ts │ └── login-view-model.ts ├── .gitignore ├── references.d.ts ├── package.json └── tsconfig.json ├── demo-angular ├── app │ ├── app.component.html │ ├── app.module.ngfactory.d.ts │ ├── app.config.ts │ ├── App_Resources │ │ ├── iOS │ │ │ ├── Assets.xcassets │ │ │ │ ├── Contents.json │ │ │ │ ├── AppIcon.appiconset │ │ │ │ │ ├── icon-29.png │ │ │ │ │ ├── icon-40.png │ │ │ │ │ ├── icon-50.png │ │ │ │ │ ├── icon-57.png │ │ │ │ │ ├── icon-72.png │ │ │ │ │ ├── icon-76.png │ │ │ │ │ ├── icon-29@2x.png │ │ │ │ │ ├── icon-29@3x.png │ │ │ │ │ ├── icon-40@2x.png │ │ │ │ │ ├── icon-40@3x.png │ │ │ │ │ ├── icon-50@2x.png │ │ │ │ │ ├── icon-57@2x.png │ │ │ │ │ ├── icon-60@2x.png │ │ │ │ │ ├── icon-60@3x.png │ │ │ │ │ ├── icon-72@2x.png │ │ │ │ │ ├── icon-76@2x.png │ │ │ │ │ ├── icon-83.5@2x.png │ │ │ │ │ └── Contents.json │ │ │ │ ├── LaunchImage.launchimage │ │ │ │ │ ├── Default.png │ │ │ │ │ ├── Default@2x.png │ │ │ │ │ ├── Default-568h@2x.png │ │ │ │ │ ├── Default-667h@2x.png │ │ │ │ │ ├── Default-736h@3x.png │ │ │ │ │ ├── Default-Landscape.png │ │ │ │ │ ├── Default-Portrait.png │ │ │ │ │ ├── Default-Landscape@2x.png │ │ │ │ │ ├── Default-Landscape@3x.png │ │ │ │ │ ├── Default-Portrait@2x.png │ │ │ │ │ └── Contents.json │ │ │ │ ├── LaunchScreen.Center.imageset │ │ │ │ │ ├── LaunchScreen-Center.png │ │ │ │ │ ├── LaunchScreen-Center@2x.png │ │ │ │ │ └── Contents.json │ │ │ │ └── LaunchScreen.AspectFill.imageset │ │ │ │ │ ├── LaunchScreen-AspectFill.png │ │ │ │ │ ├── LaunchScreen-AspectFill@2x.png │ │ │ │ │ └── Contents.json │ │ │ ├── logo.png │ │ │ ├── build.xcconfig │ │ │ ├── Info.plist │ │ │ └── LaunchScreen.storyboard │ │ └── Android │ │ │ ├── src │ │ │ └── main │ │ │ │ ├── res │ │ │ │ ├── values-v21 │ │ │ │ │ ├── colors.xml │ │ │ │ │ └── styles.xml │ │ │ │ ├── drawable-hdpi │ │ │ │ │ ├── icon.png │ │ │ │ │ ├── logo.png │ │ │ │ │ └── background.png │ │ │ │ ├── drawable-ldpi │ │ │ │ │ ├── icon.png │ │ │ │ │ ├── logo.png │ │ │ │ │ └── background.png │ │ │ │ ├── drawable-mdpi │ │ │ │ │ ├── icon.png │ │ │ │ │ ├── logo.png │ │ │ │ │ └── background.png │ │ │ │ ├── drawable-xhdpi │ │ │ │ │ ├── icon.png │ │ │ │ │ ├── logo.png │ │ │ │ │ └── background.png │ │ │ │ ├── drawable-xxhdpi │ │ │ │ │ ├── icon.png │ │ │ │ │ ├── logo.png │ │ │ │ │ └── background.png │ │ │ │ ├── drawable-xxxhdpi │ │ │ │ │ ├── icon.png │ │ │ │ │ ├── logo.png │ │ │ │ │ └── background.png │ │ │ │ ├── values │ │ │ │ │ ├── colors.xml │ │ │ │ │ └── styles.xml │ │ │ │ └── drawable-nodpi │ │ │ │ │ └── splash_screen.xml │ │ │ │ └── AndroidManifest.xml │ │ │ └── app.gradle │ ├── pages │ │ ├── login │ │ │ ├── login.component.css │ │ │ ├── login.module.ts │ │ │ └── login.component.html │ │ └── home │ │ │ ├── home.component.css │ │ │ ├── home.module.ts │ │ │ ├── home.component.html │ │ │ └── home.component.ts │ ├── package.json │ ├── main.ts │ ├── main.aot.ts │ ├── app.component.ts │ ├── app.routing.ts │ ├── app.css │ ├── services │ │ └── navigation.service.ts │ └── app.module.ts ├── .gitignore ├── tsconfig.json └── package.json ├── demo-vue ├── app │ ├── fonts │ │ └── FontAwesome.ttf │ ├── App_Resources │ │ ├── iOS │ │ │ ├── Assets.xcassets │ │ │ │ ├── Contents.json │ │ │ │ ├── AppIcon.appiconset │ │ │ │ │ ├── icon-1024.png │ │ │ │ │ ├── icon-29.png │ │ │ │ │ ├── icon-40.png │ │ │ │ │ ├── icon-76.png │ │ │ │ │ ├── icon-29@2x.png │ │ │ │ │ ├── icon-29@3x.png │ │ │ │ │ ├── icon-40@2x.png │ │ │ │ │ ├── icon-40@3x.png │ │ │ │ │ ├── icon-60@2x.png │ │ │ │ │ ├── icon-60@3x.png │ │ │ │ │ ├── icon-76@2x.png │ │ │ │ │ ├── icon-83.5@2x.png │ │ │ │ │ └── Contents.json │ │ │ │ ├── LaunchImage.launchimage │ │ │ │ │ ├── Default.png │ │ │ │ │ ├── Default@2x.png │ │ │ │ │ ├── Default-1125h.png │ │ │ │ │ ├── Default-568h@2x.png │ │ │ │ │ ├── Default-667h@2x.png │ │ │ │ │ ├── Default-736h@3x.png │ │ │ │ │ ├── Default-Portrait.png │ │ │ │ │ ├── Default-Landscape-X.png │ │ │ │ │ ├── Default-Landscape.png │ │ │ │ │ ├── Default-Portrait@2x.png │ │ │ │ │ ├── Default-Landscape@2x.png │ │ │ │ │ └── Default-Landscape@3x.png │ │ │ │ ├── LaunchScreen.Center.imageset │ │ │ │ │ ├── LaunchScreen-Center.png │ │ │ │ │ ├── LaunchScreen-Center@2x.png │ │ │ │ │ └── Contents.json │ │ │ │ └── LaunchScreen.AspectFill.imageset │ │ │ │ │ ├── LaunchScreen-AspectFill.png │ │ │ │ │ ├── LaunchScreen-AspectFill@2x.png │ │ │ │ │ └── Contents.json │ │ │ ├── logo.png │ │ │ ├── build.xcconfig │ │ │ ├── Info.plist │ │ │ └── LaunchScreen.storyboard │ │ └── Android │ │ │ ├── src │ │ │ └── main │ │ │ │ ├── res │ │ │ │ ├── values-v21 │ │ │ │ │ ├── colors.xml │ │ │ │ │ └── styles.xml │ │ │ │ ├── drawable-hdpi │ │ │ │ │ ├── icon.png │ │ │ │ │ ├── logo.png │ │ │ │ │ └── background.png │ │ │ │ ├── drawable-ldpi │ │ │ │ │ ├── icon.png │ │ │ │ │ ├── logo.png │ │ │ │ │ └── background.png │ │ │ │ ├── drawable-mdpi │ │ │ │ │ ├── icon.png │ │ │ │ │ ├── logo.png │ │ │ │ │ └── background.png │ │ │ │ ├── drawable-xhdpi │ │ │ │ │ ├── icon.png │ │ │ │ │ ├── logo.png │ │ │ │ │ └── background.png │ │ │ │ ├── drawable-xxhdpi │ │ │ │ │ ├── icon.png │ │ │ │ │ ├── logo.png │ │ │ │ │ └── background.png │ │ │ │ ├── drawable-xxxhdpi │ │ │ │ │ ├── icon.png │ │ │ │ │ ├── logo.png │ │ │ │ │ └── background.png │ │ │ │ ├── values │ │ │ │ │ ├── colors.xml │ │ │ │ │ └── styles.xml │ │ │ │ └── drawable-nodpi │ │ │ │ │ └── splash_screen.xml │ │ │ │ └── AndroidManifest.xml │ │ │ └── app.gradle │ ├── package.json │ ├── _app-common.scss │ ├── app.scss │ ├── app.js │ ├── _app-variables.scss │ └── components │ │ └── Home.vue ├── README.md ├── .gitignore ├── tsconfig.json └── package.json ├── tests ├── e2e │ ├── config │ │ ├── mocha.opts │ │ └── appium.capabilities.json │ ├── setup.ts │ ├── tsconfig.json │ └── helper.ts └── package.json ├── publish ├── publish.sh ├── package.json └── pack.sh ├── .gitignore ├── .github └── issue_template.md ├── tslint.json ├── DevelopmentWorkflow.md └── CONTRIBUTING.md /src/platforms/ios/build.xcconfig: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /demo/app/app-root.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | **/*.js 3 | **/*.metadata.json 4 | -------------------------------------------------------------------------------- /src/angular/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./nativescript-facebook-module"; -------------------------------------------------------------------------------- /src/angular/index.d.ts: -------------------------------------------------------------------------------- 1 | export * from "./nativescript-facebook-module"; 2 | -------------------------------------------------------------------------------- /demo-angular/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /demo-angular/app/app.module.ngfactory.d.ts: -------------------------------------------------------------------------------- 1 | export const AppModuleNgFactory: any; -------------------------------------------------------------------------------- /demo/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | platforms 3 | hooks 4 | app/**/*.js 5 | report 6 | -------------------------------------------------------------------------------- /demo-angular/.gitignore: -------------------------------------------------------------------------------- 1 | platforms 2 | node_modules 3 | hooks 4 | app/**/*.js 5 | report 6 | -------------------------------------------------------------------------------- /src/angular/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nativescript-facebook", 3 | "main": "index.js" 4 | } -------------------------------------------------------------------------------- /src/angular/nativescript-facebook-module.d.ts: -------------------------------------------------------------------------------- 1 | export declare class NativeScriptFacebookModule { 2 | } 3 | -------------------------------------------------------------------------------- /demo/app/app.config.ts: -------------------------------------------------------------------------------- 1 | export const config = { 2 | FACEBOOK_GRAPH_API_URL: "https://graph.facebook.com/v2.9" 3 | }; -------------------------------------------------------------------------------- /demo-angular/app/app.config.ts: -------------------------------------------------------------------------------- 1 | export const config = { 2 | FACEBOOK_GRAPH_API_URL: "https://graph.facebook.com/v2.9" 3 | }; -------------------------------------------------------------------------------- /src/platforms/ios/Podfile: -------------------------------------------------------------------------------- 1 | pod 'FBSDKCoreKit', '~> 5.0' 2 | pod 'FBSDKLoginKit', '~> 5.0' 3 | pod 'FBSDKShareKit', '~> 5.0' 4 | -------------------------------------------------------------------------------- /src/login-response.d.ts: -------------------------------------------------------------------------------- 1 | export declare class LoginResponse { 2 | token: string; 3 | constructor(token: string); 4 | } 5 | -------------------------------------------------------------------------------- /demo-vue/app/fonts/FontAwesome.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-vue/app/fonts/FontAwesome.ttf -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/iOS/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo/app/App_Resources/iOS/logo.png -------------------------------------------------------------------------------- /demo/references.d.ts: -------------------------------------------------------------------------------- 1 | /// Needed for autocompletion and compilation. -------------------------------------------------------------------------------- /src/app-events.d.ts: -------------------------------------------------------------------------------- 1 | export declare function initAnalytics(): void; 2 | export declare function logEvent(name: string, parameters?: any): void; -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /demo-angular/app/pages/login/login.component.css: -------------------------------------------------------------------------------- 1 | .login-buttons { 2 | margin-left: 30; 3 | margin-right: 30; 4 | margin-top: 10; 5 | } -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/iOS/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-vue/app/App_Resources/iOS/logo.png -------------------------------------------------------------------------------- /src/login-response.ts: -------------------------------------------------------------------------------- 1 | export class LoginResponse { 2 | token: string; 3 | 4 | constructor(token: string) { 5 | this.token = token; 6 | } 7 | } -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-angular/app/App_Resources/iOS/logo.png -------------------------------------------------------------------------------- /src/.npmignore: -------------------------------------------------------------------------------- 1 | *.log 2 | *.map 3 | *.ts 4 | !*.d.ts 5 | /platforms/android/**/* 6 | !platforms/android/include.gradle 7 | !platforms/android/nativescript_facebook.aar -------------------------------------------------------------------------------- /src/vue/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "facebook-vue-directives", 3 | "main" : "facebook-vue-directives", 4 | "typings" : "facebook-vue-directives.d.ts" 5 | } -------------------------------------------------------------------------------- /demo/app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "main": "app.js", 3 | "android": { 4 | "v8Flags": "--expose_gc", 5 | "requireModules": ["nativescript-facebook"] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /demo-angular/app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "android": { 3 | "v8Flags": "--expose_gc", 4 | "requireModules": ["nativescript-facebook"] 5 | }, 6 | "main": "main.js" 7 | } -------------------------------------------------------------------------------- /demo-vue/app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "main": "app.js", 3 | "android": { 4 | "v8Flags": "--expose_gc", 5 | "requireModules": ["nativescript-facebook"] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /tests/e2e/config/mocha.opts: -------------------------------------------------------------------------------- 1 | --timeout 800000 2 | --recursive e2e 3 | --reporter mocha-multi 4 | --reporter-options mochawesome=-,mocha-junit-reporter=test-results.xml 5 | --exit -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/Android/src/main/res/values-v21/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3d5afe 4 | -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/Android/src/main/res/values-v21/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3d5afe 4 | -------------------------------------------------------------------------------- /src/facebook-access-token.d.ts: -------------------------------------------------------------------------------- 1 | export declare class FacebookAccessToken { 2 | accessToken: string; 3 | userId: string; 4 | refreshDate: string; 5 | expirationDate: string; 6 | } -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/src/main/res/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo/app/App_Resources/Android/src/main/res/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/src/main/res/drawable-hdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo/app/App_Resources/Android/src/main/res/drawable-hdpi/logo.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/src/main/res/drawable-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo/app/App_Resources/Android/src/main/res/drawable-ldpi/icon.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/src/main/res/drawable-ldpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo/app/App_Resources/Android/src/main/res/drawable-ldpi/logo.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/src/main/res/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo/app/App_Resources/Android/src/main/res/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/src/main/res/drawable-mdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo/app/App_Resources/Android/src/main/res/drawable-mdpi/logo.png -------------------------------------------------------------------------------- /src/deep-linking.d.ts: -------------------------------------------------------------------------------- 1 | export * from './deep-linking.common'; 2 | 3 | export declare function initDeepLinking(appId: string): void; 4 | export declare function fetchDeferredAppLink(): Promise; -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/src/main/res/drawable-xhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo/app/App_Resources/Android/src/main/res/drawable-xhdpi/icon.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/src/main/res/drawable-xhdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo/app/App_Resources/Android/src/main/res/drawable-xhdpi/logo.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/src/main/res/drawable-xxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo/app/App_Resources/Android/src/main/res/drawable-xxhdpi/icon.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/src/main/res/drawable-xxhdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo/app/App_Resources/Android/src/main/res/drawable-xxhdpi/logo.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/icon.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/logo.png -------------------------------------------------------------------------------- /publish/publish.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | PACK_DIR=package; 4 | 5 | publish() { 6 | cd $PACK_DIR 7 | echo 'Publishing to npm...' 8 | npm publish *.tgz 9 | } 10 | 11 | ./pack.sh && publish -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/Android/src/main/res/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-vue/app/App_Resources/Android/src/main/res/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/Android/src/main/res/drawable-hdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-vue/app/App_Resources/Android/src/main/res/drawable-hdpi/logo.png -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/Android/src/main/res/drawable-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-vue/app/App_Resources/Android/src/main/res/drawable-ldpi/icon.png -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/Android/src/main/res/drawable-ldpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-vue/app/App_Resources/Android/src/main/res/drawable-ldpi/logo.png -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/Android/src/main/res/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-vue/app/App_Resources/Android/src/main/res/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/Android/src/main/res/drawable-mdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-vue/app/App_Resources/Android/src/main/res/drawable-mdpi/logo.png -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/Android/src/main/res/drawable-xhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-vue/app/App_Resources/Android/src/main/res/drawable-xhdpi/icon.png -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/Android/src/main/res/drawable-xhdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-vue/app/App_Resources/Android/src/main/res/drawable-xhdpi/logo.png -------------------------------------------------------------------------------- /src/angular/nativescript-facebook-directives.d.ts: -------------------------------------------------------------------------------- 1 | export declare class FacebookLoginButtonDirective { 2 | constructor(); 3 | } 4 | export declare const DIRECTIVES: typeof FacebookLoginButtonDirective[]; 5 | -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/Android/src/main/res/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-angular/app/App_Resources/Android/src/main/res/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/Android/src/main/res/drawable-hdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-angular/app/App_Resources/Android/src/main/res/drawable-hdpi/logo.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/Android/src/main/res/drawable-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-angular/app/App_Resources/Android/src/main/res/drawable-ldpi/icon.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/Android/src/main/res/drawable-ldpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-angular/app/App_Resources/Android/src/main/res/drawable-ldpi/logo.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/Android/src/main/res/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-angular/app/App_Resources/Android/src/main/res/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/Android/src/main/res/drawable-mdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-angular/app/App_Resources/Android/src/main/res/drawable-mdpi/logo.png -------------------------------------------------------------------------------- /demo-angular/app/main.ts: -------------------------------------------------------------------------------- 1 | import { platformNativeScriptDynamic } from "nativescript-angular/platform"; 2 | import { AppModule } from "./app.module"; 3 | 4 | platformNativeScriptDynamic().bootstrapModule(AppModule); 5 | -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/Android/src/main/res/drawable-xxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-vue/app/App_Resources/Android/src/main/res/drawable-xxhdpi/icon.png -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/Android/src/main/res/drawable-xxhdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-vue/app/App_Resources/Android/src/main/res/drawable-xxhdpi/logo.png -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-vue/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/icon.png -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-vue/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/logo.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/src/main/res/drawable-hdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo/app/App_Resources/Android/src/main/res/drawable-hdpi/background.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/src/main/res/drawable-ldpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo/app/App_Resources/Android/src/main/res/drawable-ldpi/background.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/src/main/res/drawable-mdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo/app/App_Resources/Android/src/main/res/drawable-mdpi/background.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/src/main/res/drawable-xhdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo/app/App_Resources/Android/src/main/res/drawable-xhdpi/background.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/src/main/res/drawable-xxhdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo/app/App_Resources/Android/src/main/res/drawable-xxhdpi/background.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/Android/src/main/res/drawable-xhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-angular/app/App_Resources/Android/src/main/res/drawable-xhdpi/icon.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/Android/src/main/res/drawable-xhdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-angular/app/App_Resources/Android/src/main/res/drawable-xhdpi/logo.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/Android/src/main/res/drawable-xxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-angular/app/App_Resources/Android/src/main/res/drawable-xxhdpi/icon.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/Android/src/main/res/drawable-xxhdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-angular/app/App_Resources/Android/src/main/res/drawable-xxhdpi/logo.png -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/Android/src/main/res/drawable-hdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-vue/app/App_Resources/Android/src/main/res/drawable-hdpi/background.png -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/Android/src/main/res/drawable-ldpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-vue/app/App_Resources/Android/src/main/res/drawable-ldpi/background.png -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/Android/src/main/res/drawable-mdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-vue/app/App_Resources/Android/src/main/res/drawable-mdpi/background.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/background.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-angular/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/icon.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-angular/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/logo.png -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/Android/src/main/res/drawable-xhdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-vue/app/App_Resources/Android/src/main/res/drawable-xhdpi/background.png -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/Android/src/main/res/drawable-xxhdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-vue/app/App_Resources/Android/src/main/res/drawable-xxhdpi/background.png -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-vue/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/background.png -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-vue/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-1024.png -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-vue/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-vue/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-vue/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/Android/src/main/res/drawable-hdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-angular/app/App_Resources/Android/src/main/res/drawable-hdpi/background.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/Android/src/main/res/drawable-ldpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-angular/app/App_Resources/Android/src/main/res/drawable-ldpi/background.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/Android/src/main/res/drawable-mdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-angular/app/App_Resources/Android/src/main/res/drawable-mdpi/background.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/Android/src/main/res/drawable-xhdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-angular/app/App_Resources/Android/src/main/res/drawable-xhdpi/background.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-vue/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-vue/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-vue/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-vue/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-vue/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-vue/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-vue/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default@2x.png -------------------------------------------------------------------------------- /publish/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nativescript-publish", 3 | "version": "1.0.0", 4 | "description": "Publish helper", 5 | "devDependencies": { 6 | "ncp": "^2.0.0", 7 | "rimraf": "^2.5.0" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/deep-linking.common.ts: -------------------------------------------------------------------------------- 1 | export class DeepLink { 2 | 3 | constructor(data?: Partial) { 4 | Object.assign(this, data); 5 | } 6 | target: string; 7 | ref: string; 8 | promoCode: string; 9 | } -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/Android/src/main/res/drawable-xxhdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-angular/app/App_Resources/Android/src/main/res/drawable-xxhdpi/background.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-angular/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/background.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50@2x.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57@2x.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72@2x.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-vue/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-vue/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default.png -------------------------------------------------------------------------------- /demo-vue/app/_app-common.scss: -------------------------------------------------------------------------------- 1 | // Place any CSS rules you want to apply on both iOS and Android here. 2 | // This is where the vast majority of your CSS code goes. 3 | 4 | //Font icon 5 | .fa { 6 | font-family: "FontAwesome"; 7 | } 8 | -------------------------------------------------------------------------------- /src/facebook-access-token.ts: -------------------------------------------------------------------------------- 1 | export class FacebookAccessToken { 2 | public accessToken: string = ""; 3 | public userId: string = ""; 4 | public refreshDate: string = ""; 5 | public expirationDate: string = ""; 6 | } -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default.png -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-vue/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png -------------------------------------------------------------------------------- /src/platforms/android/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default@2x.png -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-1125h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-vue/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-1125h.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | DemoApp 4 | DemoApp 5 | -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png -------------------------------------------------------------------------------- /demo-angular/app/main.aot.ts: -------------------------------------------------------------------------------- 1 | import { platformNativeScript } from "nativescript-angular/platform-static"; 2 | import { AppModuleNgFactory } from "./app.module.ngfactory"; 3 | 4 | platformNativeScript().bootstrapModuleFactory(AppModuleNgFactory); 5 | -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-vue/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-vue/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-vue/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-vue/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-X.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-vue/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-X.png -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-vue/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-vue/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-vue/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-vue/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png -------------------------------------------------------------------------------- /src/login-event-data.ts: -------------------------------------------------------------------------------- 1 | import { EventData } from "tns-core-modules/data/observable"; 2 | import { LoginResponse } from "./login-response"; 3 | 4 | export interface LoginEventData extends EventData { 5 | error: Error; 6 | loginResponse: LoginResponse; 7 | } -------------------------------------------------------------------------------- /tests/e2e/setup.ts: -------------------------------------------------------------------------------- 1 | import { startServer, stopServer } from "nativescript-dev-appium"; 2 | 3 | before("start server", async () => { 4 | await startServer(); 5 | }); 6 | 7 | after("stop server", async () => { 8 | await stopServer(); 9 | }); 10 | -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-vue/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png -------------------------------------------------------------------------------- /src/platforms/android/include.gradle: -------------------------------------------------------------------------------- 1 | /* Include.gradle configuration: http://docs.nativescript.org/plugins/plugins#includegradle-specification */ 2 | 3 | android { 4 | } 5 | 6 | dependencies { 7 | implementation 'com.facebook.android:facebook-android-sdk:[5,6)' 8 | } -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-vue/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png -------------------------------------------------------------------------------- /src/index.android.ts: -------------------------------------------------------------------------------- 1 | export * from "./login-manager"; 2 | export * from "./ui/login-button"; 3 | export * from "./login-event-data"; 4 | export * from './share-manager'; 5 | export * from "./ui/share-button"; 6 | export * from "./app-events"; 7 | export * from './deep-linking'; -------------------------------------------------------------------------------- /src/login-event-data.d.ts: -------------------------------------------------------------------------------- 1 | import { EventData } from "tns-core-modules/data/observable"; 2 | import { LoginResponse } from "./login-response"; 3 | 4 | export declare interface LoginEventData extends EventData { 5 | error: Error; 6 | loginResponse: LoginResponse; 7 | } -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png -------------------------------------------------------------------------------- /demo-angular/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, ChangeDetectorRef } from "@angular/core"; 2 | import * as Facebook from "nativescript-facebook"; 3 | 4 | @Component({ 5 | selector: "ns-app", 6 | templateUrl: "app.component.html", 7 | }) 8 | export class AppComponent {} 9 | -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-vue/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-vue/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NativeScript/nativescript-facebook/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png -------------------------------------------------------------------------------- /src/ui/share-button.d.ts: -------------------------------------------------------------------------------- 1 | import {View} from 'tns-core-modules/ui/core/view'; 2 | 3 | export declare class ShareButton extends View { 4 | nativeView: any; 5 | content: any; 6 | } 7 | 8 | 9 | export declare class SendButton extends View { 10 | nativeView: any; 11 | content: any; 12 | } -------------------------------------------------------------------------------- /src/index.d.ts: -------------------------------------------------------------------------------- 1 | export * from "./login-manager"; 2 | export * from "./ui/login-button"; 3 | export * from "./login-response"; 4 | export * from "./login-event-data"; 5 | export * from './share-manager'; 6 | export * from "./ui/share-button"; 7 | export * from "./app-events"; 8 | export * from './deep-linking'; 9 | -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #F5F5F5 4 | #757575 5 | #33B5E5 6 | #272734 7 | -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/Android/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #F5F5F5 4 | #757575 5 | #33B5E5 6 | #272734 7 | -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/Android/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #F5F5F5 4 | #757575 5 | #33B5E5 6 | #272734 7 | -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/build.xcconfig: -------------------------------------------------------------------------------- 1 | // You can add custom settings here 2 | // for example you can uncomment the following line to force distribution code signing 3 | // CODE_SIGN_IDENTITY = iPhone Distribution 4 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 5 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 6 | -------------------------------------------------------------------------------- /demo-vue/app/app.scss: -------------------------------------------------------------------------------- 1 | // Import app variables 2 | @import 'app-variables'; 3 | 4 | // Import the theme’s main ruleset - both index and platform specific. 5 | @import '~nativescript-theme-core/scss/index'; 6 | @import '~nativescript-theme-core/scss/platforms/index.android'; 7 | 8 | // Import common styles 9 | @import 'app-common'; 10 | -------------------------------------------------------------------------------- /demo/app/app.ts: -------------------------------------------------------------------------------- 1 | import * as application from 'tns-core-modules/application'; 2 | import { init, initAnalytics } from "nativescript-facebook"; 3 | 4 | application.on(application.launchEvent, function (args) { 5 | init("1771472059772879"); 6 | initAnalytics(); 7 | }); 8 | 9 | application.run({ moduleName: "app-root" }); 10 | 11 | -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/src/main/res/drawable-nodpi/splash_screen.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /demo-angular/app/app.routing.ts: -------------------------------------------------------------------------------- 1 | export const routes = [ 2 | { 3 | path: "home", 4 | loadChildren: "./pages/home/home.module#HomeModule" 5 | }, 6 | { 7 | path: "login", 8 | loadChildren: "./pages/login/login.module#LoginModule" 9 | }, 10 | { 11 | path: "", 12 | redirectTo: "login", 13 | pathMatch: "full" 14 | } 15 | 16 | ]; -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/Android/src/main/res/drawable-nodpi/splash_screen.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/Android/src/main/res/drawable-nodpi/splash_screen.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/ui/login-button.android.ts: -------------------------------------------------------------------------------- 1 | // NativeScript modules 2 | import * as applicationModule from "tns-core-modules/application"; 3 | import { LoginButtonBase } from './login-button.common'; 4 | 5 | declare let com: any; 6 | 7 | export class LoginButton extends LoginButtonBase { 8 | public createNativeView() { 9 | return new com.facebook.login.widget.LoginButton(this._context); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/vue/facebook-vue-directives.ts: -------------------------------------------------------------------------------- 1 | const FacebookPlugin = { 2 | install(Vue, options) { 3 | Vue.registerElement("FacebookLoginButton", () => require("../").LoginButton); 4 | Vue.registerElement("FacebookShareButton", () => require('../').ShareButton); 5 | Vue.registerElement("FacebookSendButton", () => require('../').SendButton); 6 | } 7 | }; 8 | 9 | export default FacebookPlugin; -------------------------------------------------------------------------------- /src/ui/login-button.d.ts: -------------------------------------------------------------------------------- 1 | import { LoginEventData } from './../login-event-data'; 2 | import { EventData } from "tns-core-modules/data/observable"; 3 | import { View } from "tns-core-modules/ui/core/view"; 4 | 5 | export declare class LoginButton extends View { 6 | on(event: "login", callback: (data: LoginEventData) => void, thisArg?: any); 7 | on(eventNames: string, callback: (data: EventData) => void, thisArg?: any); 8 | } 9 | -------------------------------------------------------------------------------- /demo/app/home-page.ts: -------------------------------------------------------------------------------- 1 | import { EventData } from 'tns-core-modules/data/observable'; 2 | import { Page } from 'tns-core-modules/ui/page'; 3 | import { HomeViewModel } from './home-view-model'; 4 | 5 | // Event handler for Page 'loaded' event attached in main-page.xml 6 | export function pageLoaded(args: EventData) { 7 | // Get the event sender 8 | let page = args.object; 9 | page.bindingContext = new HomeViewModel(); 10 | } 11 | -------------------------------------------------------------------------------- /demo/app/login-page.ts: -------------------------------------------------------------------------------- 1 | import { EventData } from 'tns-core-modules/data/observable'; 2 | import { Page } from 'tns-core-modules/ui/page'; 3 | import { LoginViewModel } from './login-view-model'; 4 | 5 | // Event handler for Page 'loaded' event attached in main-page.xml 6 | export function pageLoaded(args: EventData) { 7 | // Get the event sender 8 | let page = args.object; 9 | page.bindingContext = new LoginViewModel(); 10 | } 11 | -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/app.gradle: -------------------------------------------------------------------------------- 1 | // Add your native dependencies here: 2 | 3 | // Uncomment to add recyclerview-v7 dependency 4 | //dependencies { 5 | // compile 'com.android.support:recyclerview-v7:+' 6 | //} 7 | 8 | android { 9 | defaultConfig { 10 | generatedDensities = [] 11 | applicationId = "org.nativescript.demo" 12 | } 13 | aaptOptions { 14 | additionalParameters "--no-version-vectors" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/references.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | /// 4 | /// 5 | /// 6 | /// -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/Android/app.gradle: -------------------------------------------------------------------------------- 1 | // Add your native dependencies here: 2 | 3 | // Uncomment to add recyclerview-v7 dependency 4 | //dependencies { 5 | // compile 'com.android.support:recyclerview-v7:+' 6 | //} 7 | 8 | android { 9 | defaultConfig { 10 | generatedDensities = [] 11 | applicationId = "org.nativescript.demoangular" 12 | } 13 | aaptOptions { 14 | additionalParameters "--no-version-vectors" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /demo-vue/README.md: -------------------------------------------------------------------------------- 1 | # Example for using nativescript-facebook plugin 2 | ## This example demonstrates how to use plugin with vue 3 | 4 | If you want to test it out on an emulator or a device you can follow the instructions below: 5 | 6 | `git clone https://github.com/NativeScript/nativescript-facebook.git` 7 | `cd nativescript-facebook/demo-vue` 8 | `npm run build.plugin && npm install` 9 | `tns run android --bundle` or `tns run ios --bundle` depending on the platform you want to test -------------------------------------------------------------------------------- /demo-angular/app/pages/home/home.component.css: -------------------------------------------------------------------------------- 1 | .label { 2 | font-size: 10; 3 | font-weight: bold; 4 | padding-top: 10; 5 | } 6 | 7 | .home { 8 | margin-left: 30; 9 | margin-right: 30; 10 | margin-top: 15%; 11 | } 12 | 13 | .home .buttons { 14 | margin-top: 10%; 15 | } 16 | 17 | .home .info { 18 | margin-top: 20; 19 | horizontal-align: center; 20 | } 21 | 22 | .avatar { 23 | border-radius: 100; 24 | width: 150; 25 | height: auto; 26 | } -------------------------------------------------------------------------------- /demo/app/tests/tests.js: -------------------------------------------------------------------------------- 1 | var Facebook = require("nativescript-facebook").Facebook; 2 | var facebook = new Facebook(); 3 | 4 | // TODO replace 'functionname' with an acual function name of your plugin class and run with 'npm test ' 5 | describe("greet function", function() { 6 | it("exists", function() { 7 | expect(facebook.greet).toBeDefined(); 8 | }); 9 | 10 | it("returns a string", function() { 11 | expect(facebook.greet()).toEqual("Hello, NS"); 12 | }); 13 | }); -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchScreen-Center.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchScreen-Center@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchScreen-Center.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchScreen-Center@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchScreen-Center.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchScreen-Center@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchScreen-AspectFill.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchScreen-AspectFill@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /demo-vue/.gitignore: -------------------------------------------------------------------------------- 1 | # NativeScript 2 | hooks/ 3 | !hooks/after-createProject/*.js 4 | node_modules/ 5 | platforms/ 6 | 7 | # NativeScript Template 8 | *.js.map 9 | *.css 10 | 11 | # Logs 12 | logs 13 | *.log 14 | npm-debug.log* 15 | yarn-debug.log* 16 | yarn-error.log* 17 | 18 | # General 19 | .DS_Store 20 | .AppleDouble 21 | .LSOverride 22 | .idea 23 | .cloud 24 | .project 25 | tmp/ 26 | typings/ 27 | 28 | # Visual Studio Code 29 | .vscode/* 30 | !.vscode/settings.json 31 | !.vscode/tasks.json 32 | !.vscode/launch.json 33 | !.vscode/extensions.json 34 | -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchScreen-AspectFill.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchScreen-AspectFill@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchScreen-AspectFill.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchScreen-AspectFill@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/iOS/build.xcconfig: -------------------------------------------------------------------------------- 1 | // You can add custom settings here 2 | // for example you can uncomment the following line to force distribution code signing 3 | // CODE_SIGN_IDENTITY = iPhone Distribution 4 | // To build for device with Xcode 8 you need to specify your development team. More info: https://developer.apple.com/library/prerelease/content/releasenotes/DeveloperTools/RN-Xcode/Introduction.html 5 | // DEVELOPMENT_TEAM = YOUR_TEAM_ID; 6 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 7 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 8 | -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/build.xcconfig: -------------------------------------------------------------------------------- 1 | // You can add custom settings here 2 | // for example you can uncomment the following line to force distribution code signing 3 | // CODE_SIGN_IDENTITY = iPhone Distribution 4 | // To build for device with XCode 8 you need to specify your development team. More info: https://developer.apple.com/library/prerelease/content/releasenotes/DeveloperTools/RN-Xcode/Introduction.html 5 | // DEVELOPMENT_TEAM = YOUR_TEAM_ID; 6 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 7 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 8 | -------------------------------------------------------------------------------- /demo-angular/app/app.css: -------------------------------------------------------------------------------- 1 | /* 2 | In NativeScript, the app.css file is where you place CSS rules that 3 | you would like to apply to your entire application. Check out 4 | http://docs.nativescript.org/ui/styling for a full list of the CSS 5 | selectors and properties you can use to style UI components. 6 | 7 | /* 8 | In many cases you may want to use the NativeScript core theme instead 9 | of writing your own CSS rules. For a full list of class names in the theme 10 | refer to http://docs.nativescript.org/ui/theme. 11 | */ 12 | @import '~nativescript-theme-core/css/core.light.css'; 13 | 14 | -------------------------------------------------------------------------------- /tests/e2e/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es6", 5 | "experimentalDecorators": true, 6 | "emitDecoratorMetadata": true, 7 | "importHelpers": false, 8 | "sourceMap":true, 9 | "types": [ 10 | "node", 11 | "mocha", 12 | "chai" 13 | ], 14 | "lib": [ 15 | "dom", 16 | "es2015.core", 17 | "es2015.iterable", 18 | "es2016.array.include", 19 | "es2015" 20 | ] 21 | } 22 | } -------------------------------------------------------------------------------- /src/ui/share-button.common.ts: -------------------------------------------------------------------------------- 1 | import {Property, View} from 'tns-core-modules/ui/core/view'; 2 | 3 | export abstract class FacebookShareButtonBase extends View { 4 | content: any; 5 | 6 | abstract onContentChanged(oldValue: any, newValue: any): void; 7 | } 8 | 9 | export const contentProperty = new Property({ 10 | name: 'content', 11 | defaultValue: null, 12 | valueChanged: (target, oldValue, newValue) => { 13 | target.onContentChanged(oldValue, newValue); 14 | } 15 | }); 16 | 17 | contentProperty.register(FacebookShareButtonBase); -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode/ 2 | .idea/ 3 | node_modules/ 4 | *.js 5 | *.js.map 6 | *.esm.json 7 | *.tns.json 8 | *.metadata.json 9 | *.log 10 | demo/**/*.js 11 | !demo/karma.conf.js 12 | !demo/app/tests/*.js 13 | demo/*.d.ts 14 | !demo/references.d.ts 15 | demo/platforms/ 16 | demo-angular/**/*.js 17 | demo-angular/*.d.ts 18 | demo-angular/platforms/ 19 | !demo/e2e-tests/* 20 | !demo-vue/app/app.js 21 | /src/platforms/android/nativescript_facebook.aar 22 | /src/*.tgz 23 | /publish/package/*.tgz 24 | /publish/package/**/* 25 | test-results.xml 26 | **/outputs 27 | **/mochawesome-report 28 | tests/e2e/reports -------------------------------------------------------------------------------- /demo-vue/app/app.js: -------------------------------------------------------------------------------- 1 | import Vue from "nativescript-vue"; 2 | import * as application from 'tns-core-modules/application'; 3 | import Login from "./components/Login"; 4 | 5 | import { 6 | init, 7 | initAnalytics, 8 | } from 'nativescript-facebook'; 9 | 10 | import FacebookPlugin from "nativescript-facebook/vue"; 11 | Vue.use(FacebookPlugin); 12 | 13 | Vue.config.silent = true; 14 | 15 | application.on(application.launchEvent, function (args) { 16 | init("1771472059772879"); 17 | initAnalytics(); 18 | }); 19 | 20 | new Vue({ 21 | render: h => h('frame', [h(Login)]) 22 | }).$start(); 23 | 24 | -------------------------------------------------------------------------------- /src/angular/nativescript-facebook-module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from "@angular/core"; 2 | import { registerElement } from "nativescript-angular/element-registry"; 3 | 4 | import { DIRECTIVES } from "./nativescript-facebook-directives"; 5 | 6 | @NgModule({ 7 | declarations: [DIRECTIVES], 8 | exports: [DIRECTIVES], 9 | }) 10 | export class NativeScriptFacebookModule { } 11 | 12 | registerElement("FacebookLoginButton", () => require("../").LoginButton); 13 | registerElement('FacebookShareButton', () => require('../').ShareButton); 14 | registerElement('FacebookSendButton', () => require('../').SendButton); 15 | -------------------------------------------------------------------------------- /src/angular/nativescript-facebook-directives.ts: -------------------------------------------------------------------------------- 1 | import { Directive } from "@angular/core"; // TODO: check require .Directive without hacks 2 | 3 | @Directive({ 4 | selector: "FacebookLoginButton" 5 | }) 6 | export class FacebookLoginButtonDirective { } 7 | 8 | @Directive({ 9 | selector: "FacebookShareButton" 10 | }) 11 | export class FacebookShareButtonDirective { } 12 | 13 | @Directive({ 14 | selector: "FacebookSendButton" 15 | }) 16 | export class FacebookSendButtonDirective { } 17 | 18 | export const DIRECTIVES = [FacebookLoginButtonDirective, FacebookShareButtonDirective, FacebookSendButtonDirective]; 19 | -------------------------------------------------------------------------------- /src/platforms/ios/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | CFBundleVersion 8 | 1.0 9 | 10 | LSApplicationQueriesSchemes 11 | 12 | fbauth2 13 | fbapi 14 | fb-messenger-api 15 | fbshareextension 16 | 17 | 18 | -------------------------------------------------------------------------------- /demo/app/app.css: -------------------------------------------------------------------------------- 1 | @import '~nativescript-theme-core/css/core.light.css'; 2 | .login-buttons { 3 | margin-left: 30; 4 | margin-right: 30; 5 | } 6 | 7 | .label { 8 | font-size: 10; 9 | font-weight: bold; 10 | padding-top: 10; 11 | } 12 | 13 | .home { 14 | margin-left: 30; 15 | margin-right: 30; 16 | margin-top: 10%; 17 | } 18 | 19 | .home .buttons { 20 | margin-top: 15%; 21 | margin-bottom: 10%; 22 | } 23 | 24 | .home .info { 25 | margin-top: 20; 26 | horizontal-align: center; 27 | } 28 | 29 | .avatar { 30 | border-radius: 100; 31 | width: 150; 32 | height: auto; 33 | } -------------------------------------------------------------------------------- /tests/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "devDependencies": { 3 | "@types/chai": "^4.1.3", 4 | "@types/mocha": "^5.2.0", 5 | "@types/node": "^10.1.2", 6 | "babel-loader": "~8.0.0", 7 | "chai": "~4.1.2", 8 | "chai-as-promised": "~7.1.1", 9 | "karma": "^2.0.2", 10 | "karma-nativescript-launcher": "^0.4.0", 11 | "mocha": "^3.3.0", 12 | "mocha-junit-reporter": "^1.18.0", 13 | "mocha-multi": "1.1.0", 14 | "mochawesome": "^3.1.1", 15 | "nativescript-dev-appium": "~5.2.0", 16 | "typescript": "~3.5.3" 17 | }, 18 | "scripts": { 19 | "e2e": "tsc -p e2e && mocha --opts ./e2e/config/mocha.opts" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/Android/app.gradle: -------------------------------------------------------------------------------- 1 | // Add your native dependencies here: 2 | 3 | // Uncomment to add recyclerview-v7 dependency 4 | //dependencies { 5 | // implementation 'com.android.support:recyclerview-v7:+' 6 | //} 7 | 8 | // If you want to add something to be applied before applying plugins' include.gradle files 9 | // e.g. project.ext.googlePlayServicesVersion = "15.0.1" 10 | // create a file named before-plugins.gradle in the current directory and place it there 11 | 12 | android { 13 | defaultConfig { 14 | generatedDensities = [] 15 | } 16 | aaptOptions { 17 | additionalParameters "--no-version-vectors" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /demo-vue/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es5", 5 | "experimentalDecorators": true, 6 | "emitDecoratorMetadata": true, 7 | "noEmitHelpers": true, 8 | "noEmitOnError": true, 9 | "lib": [ 10 | "es6", 11 | "dom" 12 | ], 13 | "baseUrl": ".", 14 | "paths": { 15 | "~/*": [ 16 | "app/*" 17 | ], 18 | "*": [ 19 | "./node_modules/tns-core-modules/*", 20 | "./node_modules/*" 21 | ] 22 | } 23 | }, 24 | "exclude": [ 25 | "node_modules", 26 | "platforms" 27 | ] 28 | } -------------------------------------------------------------------------------- /src/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "lib": ["es6", "dom"], 6 | "baseUrl": ".", 7 | "removeComments": true, 8 | "noLib": false, 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "pretty": true, 12 | "noEmitHelpers": true, 13 | "skipLibCheck": true 14 | }, 15 | "exclude": [ 16 | "node_modules", 17 | "platforms", 18 | "hooks" 19 | ], 20 | "compileOnSave": false, 21 | "angularCompilerOptions": { 22 | "strictMetadataEmit": true, 23 | "skipTemplateCodegen": true, 24 | "genDir": "." 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /demo-angular/app/services/navigation.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from "@angular/core"; 2 | import { RouterExtensions } from "nativescript-angular/router"; 3 | 4 | @Injectable() 5 | export class NavigationService { 6 | 7 | constructor(private routerExtensions: RouterExtensions) { } 8 | 9 | go(route: Array, name?: string) { 10 | 11 | this 12 | .routerExtensions 13 | .navigate(route, { 14 | clearHistory: true, 15 | animated: true, 16 | transition: { 17 | name: name ? name : "slide", 18 | duration: 200, 19 | curve: "linear" 20 | } 21 | }); 22 | 23 | } 24 | } -------------------------------------------------------------------------------- /tests/e2e/helper.ts: -------------------------------------------------------------------------------- 1 | import { AppiumDriver, SearchOptions, createDriver, Direction, UIElement } from "nativescript-dev-appium"; 2 | 3 | 4 | export async function scrollToElement(driver: AppiumDriver, element: string, direction: Direction = Direction.down) { 5 | let listView: UIElement; 6 | if (driver.isAndroid) { 7 | listView = await driver.findElementByClassName("android.widget.FrameLayout"); 8 | } 9 | else { 10 | listView = await driver.findElementByClassName("XCUIElementTypeApplication"); 11 | } 12 | const listItem = await listView.scrollTo( 13 | direction, 14 | () => driver.findElementByText(element, SearchOptions.contains), 15 | 600 16 | ); 17 | return listItem; 18 | } 19 | -------------------------------------------------------------------------------- /src/platforms/ios/README.md: -------------------------------------------------------------------------------- 1 | # iOS permissions and dependencies 2 | 3 | 4 | * (Optional) Use Info.plist to describe any permissions, features or other configuration specifics required or used by your plugin for iOS. 5 | NOTE: The NativeScript CLI will not resolve any contradicting or duplicate entries during the merge. After the plugin is installed, you need to manually resolve such issues. 6 | * (Optional) Use build.xcconfig configuration to describe any plugin the native dependencies. If there are no such, this file can be removed. For more information, see the [build.xcconfig Specification section](http://docs.nativescript.org/plugins/plugins#buildxcconfig-specification). 7 | 8 | 9 | [Read more about nativescript plugins](http://docs.nativescript.org/plugins/plugins) -------------------------------------------------------------------------------- /demo-angular/app/pages/home/home.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule, NO_ERRORS_SCHEMA } from "@angular/core"; 2 | import { NativeScriptRouterModule } from "nativescript-angular/router"; 3 | import { HomeComponent } from "./home.component"; 4 | import { CommonModule } from "@angular/common"; 5 | 6 | import { NativeScriptFacebookModule } from "nativescript-facebook/angular"; 7 | 8 | export const routerConfig = [ 9 | { 10 | path: "", 11 | component: HomeComponent 12 | } 13 | ]; 14 | 15 | @NgModule({ 16 | imports: [ 17 | NativeScriptRouterModule, 18 | NativeScriptRouterModule.forChild(routerConfig), 19 | CommonModule 20 | ], 21 | declarations: [ HomeComponent ], 22 | schemas: [ NO_ERRORS_SCHEMA ] 23 | }) 24 | export class HomeModule { } 25 | -------------------------------------------------------------------------------- /src/app-events.ios.ts: -------------------------------------------------------------------------------- 1 | let application = require("tns-core-modules/application"); 2 | let iosApplication; 3 | let appEventsLogger; 4 | export function initAnalytics() { 5 | iosApplication = application.iosApplication; 6 | FBSDKAppEvents.activateApp(); 7 | } 8 | 9 | export function logEvent(name: string, parameters?: any) { 10 | if (name === undefined) { 11 | throw ("Argument 'name' is missing"); 12 | } 13 | 14 | if (parameters === undefined) { 15 | FBSDKAppEvents.logEvent(name); 16 | } else { 17 | const parametersDictionary = new (NSDictionary as any)( 18 | parameters.map(parameter => parameter.value), 19 | parameters.map(parameter => parameter.key)); 20 | 21 | FBSDKAppEvents.logEventParameters(name, parametersDictionary); 22 | } 23 | } -------------------------------------------------------------------------------- /demo-angular/app/pages/login/login.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule, NO_ERRORS_SCHEMA } from "@angular/core"; 2 | import { NativeScriptCommonModule } from "nativescript-angular/common"; 3 | import { NativeScriptRouterModule } from "nativescript-angular/router"; 4 | import { LoginComponent } from "./login.component"; 5 | 6 | import { NativeScriptFacebookModule } from "nativescript-facebook/angular"; 7 | 8 | export const routerConfig = [ 9 | { 10 | path: "", 11 | component: LoginComponent 12 | } 13 | ]; 14 | 15 | @NgModule({ 16 | imports: [ 17 | NativeScriptCommonModule, 18 | NativeScriptRouterModule, 19 | NativeScriptRouterModule.forChild(routerConfig) 20 | ], 21 | declarations: [ LoginComponent ], 22 | schemas: [ NO_ERRORS_SCHEMA ] 23 | }) 24 | export class LoginModule { } 25 | -------------------------------------------------------------------------------- /demo-angular/app/pages/home/home.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/app-events.android.ts: -------------------------------------------------------------------------------- 1 | let application = require("tns-core-modules/application"); 2 | let androidApplication; 3 | let appEventsLogger; 4 | export function initAnalytics() { 5 | androidApplication = application.android; 6 | appEventsLogger = com.facebook.appevents.AppEventsLogger.newLogger(androidApplication.context.getApplicationContext()); 7 | } 8 | 9 | export function logEvent(name: string, parameters?: any) { 10 | if (name === undefined) { 11 | throw ("Argument 'name' is missing"); 12 | } 13 | 14 | const bundle = new android.os.Bundle(); 15 | 16 | if (parameters !== undefined) { 17 | for (let p in parameters) { 18 | let param = parameters[p]; 19 | if (param.value !== undefined) { 20 | bundle.putString(param.key, param.value); 21 | } 22 | } 23 | } 24 | appEventsLogger.logEvent(name, bundle); 25 | } 26 | -------------------------------------------------------------------------------- /src/ui/login-button.common.ts: -------------------------------------------------------------------------------- 1 | import { View, Property } from "tns-core-modules/ui/core/view"; 2 | import * as loginManager from './../login-manager'; 3 | import { LoginResponse } from './../login-response'; 4 | import { LoginEventData } from './../login-event-data'; 5 | import { EventData } from "tns-core-modules/data/observable"; 6 | 7 | export abstract class LoginButtonBase extends View { 8 | public static loginEvent: string = "login"; 9 | public static logoutEvent: string = "logout"; 10 | 11 | initNativeView() { 12 | loginManager._registerLoginCallback((error: Error, loginResponse: LoginResponse) => { 13 | this.notify({ eventName: LoginButtonBase.loginEvent, object: this, error: error, loginResponse: loginResponse }); 14 | }); 15 | loginManager._registerLogoutCallback(() => { 16 | this.notify({ eventName: LoginButtonBase.logoutEvent, object: this }); 17 | }); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /demo/app/home-page.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /demo-vue/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "nativescript": { 3 | "id": "org.nativescript.demovue", 4 | "tns-android": { 5 | "version": "6.2.0" 6 | }, 7 | "tns-ios": { 8 | "version": "6.2.0" 9 | } 10 | }, 11 | "description": "NativeScript Application", 12 | "license": "SEE LICENSE IN ", 13 | "repository": "", 14 | "dependencies": { 15 | "nativescript-facebook": "../src", 16 | "nativescript-theme-core": "~1.0.4", 17 | "nativescript-vue": "~2.4.0", 18 | "tns-core-modules": "^6.0.0" 19 | }, 20 | "devDependencies": { 21 | "@babel/core": "~7.1.0", 22 | "@babel/preset-env": "~7.1.0", 23 | "babel-loader": "~8.0.0", 24 | "nativescript-dev-webpack": "^1.3.0", 25 | "nativescript-vue-template-compiler": "~2.4.0", 26 | "node-sass": "~4.12.0", 27 | "vue-loader": "~15.4.2", 28 | "typescript": "~3.5.3" 29 | }, 30 | "scripts": { 31 | "build.plugin": "cd ../src && npm run build" 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/Android/src/main/res/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 11 | 14 | 15 | 16 | 19 | 20 | 23 | -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/Android/src/main/res/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 11 | 14 | 15 | 16 | 19 | 20 | 23 | -------------------------------------------------------------------------------- /demo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "nativescript": { 3 | "id": "org.nativescript.demo", 4 | "tns-android": { 5 | "version": "6.2.0" 6 | }, 7 | "tns-ios": { 8 | "version": "6.2.0" 9 | } 10 | }, 11 | "dependencies": { 12 | "nativescript-facebook": "../src", 13 | "nativescript-theme-core": "^1.0.4", 14 | "nativescript-unit-test-runner": "0.7.0", 15 | "tns-core-modules": "^6.0.0" 16 | }, 17 | "devDependencies": { 18 | "nativescript-css-loader": "~0.26.1", 19 | "nativescript-dev-webpack": "^1.3.0", 20 | "tslint": "~5.11.0", 21 | "typescript": "~3.5.3", 22 | "karma-webpack": "3.0.5" 23 | }, 24 | "scripts": { 25 | "build.plugin": "cd ../src && npm run build", 26 | "ci.tslint": "npm i && tslint --config '../tslint.json' 'app/**/*.ts' --exclude '**/node_modules/**'", 27 | "ci.android.build": "cd ../src && npm run build && cd ../demo && tns build android", 28 | "ci.ios.build": "cd ../src && npm run build.iosOnly && cd ../demo && tns build ios", 29 | "generate-android-snapshot": "generate-android-snapshot --targetArchs arm,arm64,ia32 --install" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /demo-angular/app/pages/login/login.component.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /demo-angular/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule, NO_ERRORS_SCHEMA } from "@angular/core"; 2 | import { NativeScriptModule } from "nativescript-angular/nativescript.module"; 3 | import { NativeScriptRouterModule } from "nativescript-angular/router"; 4 | import { AppComponent } from "./app.component"; 5 | import { NativeScriptFacebookModule } from "nativescript-facebook/angular"; 6 | import * as application from 'tns-core-modules/application'; 7 | import { routes } from "./app.routing"; 8 | import { NavigationService } from "./services/navigation.service"; 9 | import { init, initAnalytics } from "nativescript-facebook"; 10 | 11 | application.on(application.launchEvent, function (args) { 12 | init("1771472059772879"); 13 | initAnalytics(); 14 | }); 15 | 16 | @NgModule({ 17 | bootstrap: [AppComponent], 18 | imports: [ 19 | NativeScriptModule, 20 | NativeScriptFacebookModule, 21 | NativeScriptRouterModule, 22 | NativeScriptRouterModule.forRoot(routes) 23 | ], 24 | providers: [ 25 | NavigationService 26 | ], 27 | declarations: [AppComponent], 28 | schemas: [NO_ERRORS_SCHEMA] 29 | }) 30 | export class AppModule { } 31 | -------------------------------------------------------------------------------- /src/ui/share-button.ios.ts: -------------------------------------------------------------------------------- 1 | import {FacebookShareButtonBase} from './share-button.common'; 2 | 3 | export class ShareButton extends FacebookShareButtonBase { 4 | nativeView: FBSDKShareButton; 5 | 6 | createNativeView() { 7 | const button = FBSDKShareButton.new(); 8 | this.nativeView = button; 9 | if (this.content) { 10 | this.nativeView.shareContent = this.content; 11 | } 12 | return button; 13 | } 14 | 15 | onContentChanged(oldValue: any, newValue: any): void { 16 | if (this.nativeView) { 17 | this.nativeView.shareContent = newValue; 18 | } 19 | } 20 | } 21 | 22 | 23 | export class SendButton extends FacebookShareButtonBase { 24 | nativeView: FBSDKSendButton; 25 | 26 | createNativeView() { 27 | const button = FBSDKSendButton.new(); 28 | this.nativeView = button; 29 | if (this.content) { 30 | this.nativeView.shareContent = this.content; 31 | } 32 | return button; 33 | } 34 | 35 | onContentChanged(oldValue: any, newValue: any): void { 36 | if (this.nativeView) { 37 | this.nativeView.shareContent = newValue; 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /publish/pack.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | CURRENT_DIR=$(pwd) 4 | SOURCE_DIR=../src; 5 | TO_SOURCE_DIR=src; 6 | PACK_DIR=package; 7 | ROOT_DIR=..; 8 | PUBLISH=--publish 9 | 10 | install(){ 11 | npm i 12 | } 13 | 14 | pack() { 15 | 16 | echo 'Clearing /src and /package...' 17 | node_modules/.bin/rimraf "$TO_SOURCE_DIR" 18 | node_modules/.bin/rimraf "$PACK_DIR" 19 | 20 | # build plugin 21 | echo 'Building plugin...' 22 | cd "$SOURCE_DIR" 23 | npm run build 24 | cd "$CURRENT_DIR" 25 | 26 | # copy plugin 27 | echo 'Copying plugin source...' 28 | node_modules/.bin/ncp "$SOURCE_DIR" "$TO_SOURCE_DIR" 29 | 30 | # copy README & LICENSE to src 31 | echo 'Copying README and LICENSE to /src...' 32 | node_modules/.bin/ncp "$ROOT_DIR"/LICENSE "$TO_SOURCE_DIR"/LICENSE 33 | node_modules/.bin/ncp "$ROOT_DIR"/README.md "$TO_SOURCE_DIR"/README.md 34 | 35 | echo 'Creating package...' 36 | # create package dir 37 | mkdir "$PACK_DIR" 38 | 39 | # create the package 40 | cd "$PACK_DIR" 41 | npm pack ../"$TO_SOURCE_DIR" 42 | 43 | # delete source directory used to create the package 44 | cd .. 45 | node_modules/.bin/rimraf "$TO_SOURCE_DIR" 46 | } 47 | 48 | install && pack -------------------------------------------------------------------------------- /src/ui/share-button.android.ts: -------------------------------------------------------------------------------- 1 | import {FacebookShareButtonBase} from './share-button.common'; 2 | 3 | export class ShareButton extends FacebookShareButtonBase { 4 | nativeView: com.facebook.share.widget.ShareButton; 5 | 6 | createNativeView() { 7 | this.nativeView = new com.facebook.share.widget.ShareButton(this._context); 8 | if (this.content) { 9 | this.nativeView.setShareContent(this.content); 10 | } 11 | return this.nativeView; 12 | } 13 | 14 | onContentChanged(oldValue: any, newValue: any): void { 15 | if (this.nativeView) { 16 | this.nativeView.setShareContent(newValue); 17 | } 18 | } 19 | } 20 | 21 | 22 | export class SendButton extends FacebookShareButtonBase { 23 | nativeView: com.facebook.share.widget.SendButton; 24 | 25 | createNativeView() { 26 | this.nativeView = new com.facebook.share.widget.SendButton(this._context); 27 | if (this.content) { 28 | this.nativeView.setShareContent(this.content); 29 | } 30 | return this.nativeView; 31 | } 32 | 33 | onContentChanged(oldValue: any, newValue: any): void { 34 | if (this.nativeView) { 35 | this.nativeView.setShareContent(newValue); 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /demo/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "declaration": false, 6 | "removeComments": true, 7 | "noLib": false, 8 | "sourceMap": true, 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "lib": [ 12 | "es6", 13 | "dom" 14 | ], 15 | "pretty": true, 16 | "allowUnreachableCode": false, 17 | "allowUnusedLabels": false, 18 | "noEmitHelpers": true, 19 | "noEmitOnError": false, 20 | "noImplicitAny": false, 21 | "noImplicitReturns": true, 22 | "noImplicitUseStrict": false, 23 | "noFallthroughCasesInSwitch": true, 24 | "skipLibCheck": true, 25 | "baseUrl": ".", 26 | "paths": { 27 | "*": [ 28 | "./node_modules/tns-core-modules/*", 29 | "./node_modules/*" 30 | ], 31 | "~/*": [ 32 | "app/*" 33 | ] 34 | } 35 | }, 36 | "include": [ 37 | "../src", 38 | "**/*" 39 | ], 40 | "exclude": [ 41 | "../src/node_modules", 42 | "node_modules", 43 | "platforms" 44 | ], 45 | "compileOnSave": false 46 | } -------------------------------------------------------------------------------- /demo-angular/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "declaration": false, 6 | "removeComments": true, 7 | "noLib": false, 8 | "emitDecoratorMetadata": true, 9 | "experimentalDecorators": true, 10 | "lib": [ 11 | "es6", 12 | "dom", 13 | "es2015.iterable" 14 | ], 15 | "pretty": true, 16 | "allowUnreachableCode": false, 17 | "allowUnusedLabels": false, 18 | "noEmitHelpers": true, 19 | "noEmitOnError": false, 20 | "noImplicitAny": false, 21 | "noImplicitReturns": true, 22 | "noImplicitUseStrict": false, 23 | "noFallthroughCasesInSwitch": true, 24 | "skipLibCheck": true, 25 | "baseUrl": ".", 26 | "paths": { 27 | "*": [ 28 | "./node_modules/tns-core-modules/*", 29 | "./node_modules/*" 30 | ], 31 | "~/*": [ 32 | "app/*" 33 | ] 34 | } 35 | }, 36 | "include": [ 37 | "../src", 38 | "**/*" 39 | ], 40 | "exclude": [ 41 | "../src/node_modules", 42 | "node_modules", 43 | "platforms" 44 | ], 45 | "compileOnSave": false 46 | } -------------------------------------------------------------------------------- /src/index.ios.ts: -------------------------------------------------------------------------------- 1 | import * as applicationModule from "tns-core-modules/application"; 2 | export * from "./ui/login-button"; 3 | export * from "./login-manager"; 4 | export * from "./login-event-data"; 5 | export * from './share-manager'; 6 | export * from "./ui/share-button"; 7 | export * from "./app-events"; 8 | export * from './deep-linking'; 9 | 10 | declare interface UIApplicationDelegate { } 11 | 12 | // TODO: Extend existing delegate if exists 13 | class BaseDelegate extends UIResponder implements UIApplicationDelegate { 14 | public static ObjCProtocols = [UIApplicationDelegate]; 15 | 16 | applicationDidFinishLaunchingWithOptions(application: UIApplication, launchOptions: NSDictionary): boolean { 17 | return FBSDKApplicationDelegate.sharedInstance.applicationDidFinishLaunchingWithOptions(application, launchOptions); 18 | } 19 | 20 | applicationOpenURLSourceApplicationAnnotation(application, url, sourceApplication, annotation) { 21 | return FBSDKApplicationDelegate.sharedInstance.applicationOpenURLSourceApplicationAnnotation(application, url, sourceApplication, annotation); 22 | } 23 | 24 | applicationDidBecomeActive(application: UIApplication): void { 25 | FBSDKAppEvents.activateApp(); 26 | } 27 | } 28 | 29 | if (!applicationModule.ios.delegate) { 30 | applicationModule.ios.delegate = BaseDelegate; 31 | } 32 | -------------------------------------------------------------------------------- /.github/issue_template.md: -------------------------------------------------------------------------------- 1 | ### Make sure to check the demo app(s) for sample usage 2 | 3 | ### Make sure to check the existing issues in this repository 4 | 5 | ### If the demo apps cannot help and there is no issue for your problem, tell us about it 6 | Please, ensure your title is less than 63 characters long and starts with a capital 7 | letter. 8 | 9 | ### Which platform(s) does your issue occur on? 10 | - iOS/Android/Both 11 | - iOS/Android versions 12 | - emulator or device. What type of device? 13 | 14 | ### Please, provide the following version numbers that your issue occurs with: 15 | 16 | - CLI: (run `tns --version` to fetch it) 17 | - Cross-platform modules: (check the 'version' attribute in the 18 | `node_modules/tns-core-modules/package.json` file in your project) 19 | - Runtime(s): (look for the `"tns-android"` and `"tns-ios"` properties in the `package.json` file of your project) 20 | - Plugin(s): (look for the version numbers in the `package.json` file of your 21 | project and paste your dependencies and devDependencies here) 22 | 23 | ### Please, tell us how to recreate the issue in as much detail as possible. 24 | Describe the steps to reproduce it. 25 | 26 | ### Is there any code involved? 27 | - provide a code example to recreate the problem 28 | - (EVEN BETTER) provide a .zip with application or refer to a repository with application where the problem is reproducible. 29 | -------------------------------------------------------------------------------- /src/deep-linking.ios.ts: -------------------------------------------------------------------------------- 1 | import { 2 | DeepLink 3 | } from './deep-linking.common'; 4 | import { ios } from 'tns-core-modules/application'; 5 | 6 | export function initDeepLinking(appId: string) { 7 | FBSDKSettings.autoInitEnabled = true; 8 | FBSDKSettings.appID = appId; 9 | } 10 | 11 | export function fetchDeferredAppLink(): Promise { 12 | return new Promise((resolve, reject) => { 13 | FBSDKAppLinkUtility.fetchDeferredAppLink((url, error) => { 14 | if (error) { 15 | reject(error); 16 | return; 17 | } 18 | if (!url) { 19 | resolve(null); 20 | return; 21 | } 22 | let deepLink = new DeepLink({ target: url.absoluteString }); 23 | resolve(deepLink); 24 | }); 25 | }); 26 | } 27 | 28 | export function registerDeepLinkCallback(callback): void { 29 | if (ios && ios.delegate) { 30 | const crtHandler = ios.delegate.prototype["applicationOpenURLOptions"]; 31 | ios.delegate.prototype["applicationOpenURLOptions"] = function () { 32 | const args = Array.from(arguments); 33 | if (crtHandler) { 34 | const result = crtHandler.apply(this, args); 35 | args.push(result); 36 | } 37 | return callback.apply(this, args); 38 | }; 39 | } 40 | } -------------------------------------------------------------------------------- /src/share-manager.common.d.ts: -------------------------------------------------------------------------------- 1 | export interface ShareAdditionContent { 2 | hashtag?: string; 3 | } 4 | 5 | export interface MessageActionButton { 6 | title: string; 7 | url: string; 8 | } 9 | 10 | export interface MessageGenericTemplateElement { 11 | title: string; 12 | subtitle?: string; 13 | imageUrl: string; 14 | button?: MessageActionButton; 15 | defaultAction?: MessageActionButton; 16 | } 17 | 18 | export interface MessageGenericTemplateContent { 19 | element: MessageGenericTemplateElement; 20 | imageAspectRatio?: MessageGenericTemplateImageAspectRatio; 21 | pageID?: string; 22 | isSharable?: boolean; 23 | } 24 | 25 | export enum MessageGenericTemplateImageAspectRatio { 26 | Horizontal = 0, 27 | Square = 1 28 | } 29 | 30 | export enum MessageMediaTemplateMediaType { 31 | Image = 0, 32 | Video = 1 33 | } 34 | 35 | export interface MessageMediaTemplateContent { 36 | mediaUrl?: string; 37 | attachmentID?: string; 38 | mediaType: MessageMediaTemplateMediaType; 39 | pageID: string; 40 | button?: MessageActionButton; 41 | } 42 | 43 | export interface ShareCallbackResult { 44 | android?: any; // com.facebook.share.Sharer.Result 45 | ios?: any; // (NSDictionary * ) The results from the sharer. This may be nil or empty. 46 | } 47 | 48 | export type ShareCallbackFunction = (error: Error | null, result?: ShareCallbackResult | null) => void; -------------------------------------------------------------------------------- /src/share-manager.common.ts: -------------------------------------------------------------------------------- 1 | export interface ShareAdditionContent { 2 | hashtag?: string; 3 | } 4 | 5 | export interface MessageActionButton { 6 | title: string; 7 | url: string; 8 | } 9 | 10 | export interface MessageGenericTemplateElement { 11 | title: string; 12 | subtitle?: string; 13 | imageUrl: string; 14 | button?: MessageActionButton; 15 | defaultAction?: MessageActionButton; 16 | } 17 | 18 | export interface MessageGenericTemplateContent { 19 | element: MessageGenericTemplateElement; 20 | imageAspectRatio?: MessageGenericTemplateImageAspectRatio; 21 | pageID?: string; 22 | isSharable?: boolean; 23 | } 24 | 25 | export enum MessageGenericTemplateImageAspectRatio { 26 | Horizontal = 0, 27 | Square = 1 28 | } 29 | 30 | export enum MessageMediaTemplateMediaType { 31 | Image = 0, 32 | Video = 1 33 | } 34 | 35 | export interface MessageMediaTemplateContent { 36 | mediaUrl?: string; 37 | attachmentID?: string; 38 | mediaType: MessageMediaTemplateMediaType; 39 | pageID: string; 40 | button?: MessageActionButton; 41 | } 42 | 43 | export interface ShareCallbackResult { 44 | android?: any; // com.facebook.share.Sharer.Result 45 | ios?: any; // (NSDictionary * ) The results from the sharer. This may be nil or empty. 46 | } 47 | 48 | export type ShareCallbackFunction = (error: Error | null, result?: ShareCallbackResult | null) => void; -------------------------------------------------------------------------------- /src/ui/login-button.ios.ts: -------------------------------------------------------------------------------- 1 | import * as applicationModule from "tns-core-modules/application"; 2 | import { LoginButtonBase } from './login-button.common'; 3 | import * as loginManager from './../login-manager'; 4 | 5 | declare let FBSDKLoginButton: any; 6 | declare class FBSDKLoginButtonDelegate { } 7 | 8 | export class LoginButton extends LoginButtonBase { 9 | 10 | public nativeView: any; 11 | private _localDelegate; 12 | 13 | constructor() { 14 | super(); 15 | this.nativeView = new FBSDKLoginButton(); 16 | this._localDelegate = LoginButtonDelegate.new(); 17 | } 18 | 19 | onLoaded() { 20 | super.onLoaded(); 21 | this.nativeView.delegate = this._localDelegate; 22 | } 23 | 24 | onUnloaded() { 25 | super.onUnloaded(); 26 | this.nativeView.delegate = undefined; 27 | } 28 | } 29 | 30 | class LoginButtonDelegate extends NSObject implements FBSDKLoginButtonDelegate { 31 | public static ObjCProtocols = [FBSDKLoginButtonDelegate]; 32 | 33 | loginButtonDidCompleteWithResultError(loginButton: any, result: any, error: NSError) { 34 | if (loginManager.onLoginCallback) { 35 | loginManager.onLoginCallback(result, error); 36 | } 37 | } 38 | 39 | loginButtonDidLogOut(loginButton: any) { 40 | if (loginManager.onLogoutCallback) { 41 | loginManager.onLogoutCallback(); 42 | } 43 | } 44 | 45 | loginButtonWillLogin(loginButton: any) { 46 | return true; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /demo/app/login-page.xml: -------------------------------------------------------------------------------- 1 | 4 | 17 | 18 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "class-name": true, 4 | "comment-format": [ 5 | true, 6 | "check-space" 7 | ], 8 | "indent": [ 9 | true, 10 | "spaces" 11 | ], 12 | "no-duplicate-variable": true, 13 | "no-eval": true, 14 | "no-internal-module": true, 15 | "no-trailing-whitespace": true, 16 | "no-var-keyword": true, 17 | "one-line": [ 18 | true, 19 | "check-open-brace", 20 | "check-whitespace" 21 | ], 22 | "quotemark": [ 23 | false, 24 | "double" 25 | ], 26 | "semicolon": [ 27 | true, 28 | "always" 29 | ], 30 | "triple-equals": [ 31 | true, 32 | "allow-null-check" 33 | ], 34 | "typedef-whitespace": [ 35 | true, 36 | { 37 | "call-signature": "nospace", 38 | "index-signature": "nospace", 39 | "parameter": "nospace", 40 | "property-declaration": "nospace", 41 | "variable-declaration": "nospace" 42 | } 43 | ], 44 | "variable-name": [ 45 | true, 46 | "ban-keywords" 47 | ], 48 | "whitespace": [ 49 | true, 50 | "check-branch", 51 | "check-decl", 52 | "check-operator", 53 | "check-separator", 54 | "check-type" 55 | ] 56 | } 57 | } -------------------------------------------------------------------------------- /demo-angular/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "NativeScript Facebook Sample Application With Angular", 3 | "license": "MIT", 4 | "nativescript": { 5 | "id": "org.nativescript.demoangular", 6 | "tns-ios": { 7 | "version": "6.2.0" 8 | }, 9 | "tns-android": { 10 | "version": "6.2.0" 11 | } 12 | }, 13 | "dependencies": { 14 | "@angular/common": "~8.2.0", 15 | "@angular/compiler": "~8.2.0", 16 | "@angular/core": "~8.2.0", 17 | "@angular/forms": "~8.2.0", 18 | "@angular/platform-browser": "~8.2.0", 19 | "@angular/platform-browser-dynamic": "~8.2.0", 20 | "@angular/router": "~8.2.0", 21 | "nativescript-angular": "~8.20.0", 22 | "nativescript-facebook": "../src", 23 | "nativescript-theme-core": "^1.0.4", 24 | "nativescript-unit-test-runner": "0.7.0", 25 | "rxjs": "^6.4.0", 26 | "tns-core-modules": "^6.0.0", 27 | "zone.js": "^0.9.1" 28 | }, 29 | "devDependencies": { 30 | "nativescript-css-loader": "~0.26.0", 31 | "nativescript-dev-webpack": "^1.3.0", 32 | "tslint": "~5.11.0", 33 | "typescript": "~3.5.3", 34 | "karma-webpack": "3.0.5" 35 | }, 36 | "scripts": { 37 | "build.plugin": "cd ../src && npm run build", 38 | "ci.tslint": "npm i && tslint --config '../tslint.json' 'app/**/*.ts' --exclude '**/node_modules/**'", 39 | "ci.android.build": "cd ../src && npm run build && cd ../demo-angular && tns build android", 40 | "ci.ios.build": "cd ../src && npm run build.iosOnly && cd ../demo-angular && tns build ios", 41 | "generate-android-snapshot": "generate-android-snapshot --targetArchs arm,arm64,ia32 --install" 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 13 | 16 | 17 | 18 | 19 | 20 | 26 | 27 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/Android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 13 | 16 | 17 | 18 | 19 | 20 | 21 | 27 | 28 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/Android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 13 | 16 | 17 | 18 | 19 | 20 | 21 | 27 | 28 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /src/login-manager.d.ts: -------------------------------------------------------------------------------- 1 | export declare function _registerLoginCallback(callback: Function): void; 2 | export declare function _registerLogoutCallback(callback: Function): void; 3 | export declare let onLoginCallback: Function; 4 | export declare let onLogoutCallback: Function; 5 | import { FacebookAccessToken } from "./facebook-access-token"; 6 | 7 | /** 8 | * Sets the Facebook application Id for the current app and init the native facebook sdk. 9 | * @param {string} fbAppId the application Id 10 | */ 11 | export declare function init(fbId: string): void; 12 | /** 13 | * Request the specified publish permissions. 14 | * @param {string[]} permissions Array of the requested publish permissions. 15 | * @param {Function} callback Function reference to be executed when the requested permissions are granted or denied. 16 | */ 17 | export declare function requestPublishPermissions(permissions: string[], callback: Function): void; 18 | /** 19 | * Request the specified read permissions. 20 | * @param {string[]} permissions Array of the requested read permissions. 21 | * @param {Function} callback Function reference to be executed when the requested permissions are granted or denied. 22 | */ 23 | export declare function requestReadPermissions(permissions: string[], callback: Function): void; 24 | /** 25 | * Trigger a login procedure by requesting the "public_profile" and "email" read permissions. 26 | * @param {Function} callback Function reference to be executed when the requested permissions are granted or denied. 27 | */ 28 | export declare function login(callback: Function): void; 29 | /** 30 | * Trigger a logout procedure. 31 | * @param {Function} callback Function reference to be executed when the logout is executed. 32 | */ 33 | export declare function logout(callback: Function): void; 34 | /** 35 | * Get the current access token. 36 | */ 37 | export declare function getCurrentAccessToken(): FacebookAccessToken; -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/Android/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 17 | 18 | 20 | 21 | 22 | 29 | 30 | 32 | 33 | 34 | 39 | 40 | 42 | 43 | -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | 21 | 22 | 23 | 31 | 32 | 34 | 35 | 36 | 42 | 43 | 45 | 46 | -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/Android/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | 21 | 22 | 23 | 31 | 32 | 34 | 35 | 36 | 42 | 43 | 45 | 46 | -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/iOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIRequiresFullScreen 28 | 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | CFBundleURLTypes 47 | 48 | 49 | CFBundleURLSchemes 50 | 51 | fb1771472059772879 52 | 53 | 54 | 55 | LSApplicationQueriesSchemes 56 | 57 | fbapi 58 | fb-messenger-share-api 59 | fbauth2 60 | fbshareextension 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIRequiresFullScreen 28 | 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | CFBundleURLTypes 47 | 48 | 49 | CFBundleURLSchemes 50 | 51 | fb1771472059772879 52 | 53 | 54 | 55 | LSApplicationQueriesSchemes 56 | 57 | fbapi 58 | fb-messenger-share-api 59 | fbauth2 60 | fbshareextension 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIRequiresFullScreen 28 | 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | CFBundleURLTypes 47 | 48 | 49 | CFBundleURLSchemes 50 | 51 | fb1771472059772879 52 | 53 | 54 | 55 | LSApplicationQueriesSchemes 56 | 57 | fbapi 58 | fb-messenger-share-api 59 | fbauth2 60 | fbshareextension 61 | 62 | 63 | -------------------------------------------------------------------------------- /demo-vue/app/_app-variables.scss: -------------------------------------------------------------------------------- 1 | // Import the theme’s variables. If you’re using a color scheme 2 | // other than “light”, switch the path to the alternative scheme, 3 | // for example '~nativescript-theme-core/scss/dark'. 4 | @import '~nativescript-theme-core/scss/light'; 5 | 6 | // Custom colors 7 | $background-dark: #F8F8F8 !default; 8 | $background-light: #FFFFFF !default; 9 | 10 | $blue-dark: #022734 !default; 11 | $blue-light: #02556E !default; 12 | $blue-50: rgba($blue-dark, 0.5) !default; 13 | $blue-20: rgba($blue-dark, 0.2) !default; 14 | $blue-10: rgba($blue-dark, 0.1) !default; 15 | 16 | $accent-dark: #3A53FF !default; 17 | $accent-light: #4781FE !default; 18 | 19 | $success-dark: #06CE6A !default; 20 | $success-light: #00E676 !default; 21 | 22 | $warning-dark: #f39c11 !default; 23 | $warning-light: #F2C112 !default; 24 | 25 | $error-dark: #D84039 !default; 26 | $error-light: #ED473F !default; 27 | 28 | $midnight-dark: #0F336D !default; 29 | $midnight-light: #14418B !default; 30 | 31 | $night-dark: #023141 !default; 32 | $night-light: #01526C !default; 33 | 34 | // Sizes 35 | $base-font-size: 11; 36 | 37 | $border-width: 1; 38 | $border-radius: 3; 39 | 40 | 41 | /** 42 | * Theme variables overrides 43 | **/ 44 | 45 | // Colors 46 | $background: #fff; 47 | $primary: lighten(#000, 13%); 48 | $secondary: lighten(#000, 46%); 49 | $disabled: lighten(#000, 62%); 50 | $accent: $accent-dark; 51 | $error: $error-light; 52 | 53 | // SideDrawer 54 | $item-color-android : #737373; 55 | $item-active-background: #F8F8F8; 56 | $item-active-color: $accent; 57 | $item-active-icon-color: $item-active-color; 58 | $item-color-ios: $blue-dark; 59 | $item-color-android: $blue-dark; 60 | 61 | $side-drawer-header-background: #fafafa; 62 | $side-drawer-header-brand: #737373; 63 | $side-drawer-background: #FFFFFF; 64 | 65 | // ActionBar 66 | $ab-background: $accent; 67 | $ab-color: $white; 68 | 69 | // Buttons 70 | $btn-color-inverse: $white; 71 | $btn-color: $accent; 72 | $btn-color-secondary: darken($btn-color, 10%); 73 | $btn-color-outline-highlighted: lighten($btn-color, 10%); 74 | 75 | //Text colors 76 | $headings-color: $blue-dark; 77 | $secondary: $blue-dark; 78 | $text-color: $blue-dark; -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "29x29", 5 | "idiom" : "iphone", 6 | "filename" : "icon-29.png", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "size" : "29x29", 11 | "idiom" : "iphone", 12 | "filename" : "icon-29@2x.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "icon-29@3x.png", 19 | "scale" : "3x" 20 | }, 21 | { 22 | "size" : "40x40", 23 | "idiom" : "iphone", 24 | "filename" : "icon-40@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "40x40", 29 | "idiom" : "iphone", 30 | "filename" : "icon-40@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "60x60", 35 | "idiom" : "iphone", 36 | "filename" : "icon-60@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "60x60", 41 | "idiom" : "iphone", 42 | "filename" : "icon-60@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "29x29", 47 | "idiom" : "ipad", 48 | "filename" : "icon-29.png", 49 | "scale" : "1x" 50 | }, 51 | { 52 | "size" : "29x29", 53 | "idiom" : "ipad", 54 | "filename" : "icon-29@2x.png", 55 | "scale" : "2x" 56 | }, 57 | { 58 | "size" : "40x40", 59 | "idiom" : "ipad", 60 | "filename" : "icon-40.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "40x40", 65 | "idiom" : "ipad", 66 | "filename" : "icon-40@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "76x76", 71 | "idiom" : "ipad", 72 | "filename" : "icon-76.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "76x76", 77 | "idiom" : "ipad", 78 | "filename" : "icon-76@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "83.5x83.5", 83 | "idiom" : "ipad", 84 | "filename" : "icon-83.5@2x.png", 85 | "scale" : "2x" 86 | }, 87 | { 88 | "size" : "1024x1024", 89 | "idiom" : "ios-marketing", 90 | "filename" : "icon-1024.png", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /demo/app/home-view-model.ts: -------------------------------------------------------------------------------- 1 | import { Observable } from 'tns-core-modules/data/observable'; 2 | import { LoginEventData, logout as fbLogout, logEvent, getCurrentAccessToken } from "nativescript-facebook"; 3 | 4 | let frameModule = require("tns-core-modules/ui/frame"); 5 | let appSettings = require("tns-core-modules/application-settings"); 6 | let imageSource = require("tns-core-modules/image-source"); 7 | let http = require("tns-core-modules/http"); 8 | let config = require("./app.config").config; 9 | 10 | export class HomeViewModel extends Observable { 11 | userId: string; 12 | accessToken: string = appSettings.getString("access_token"); 13 | eventCounter: 0; 14 | 15 | constructor() { 16 | super(); 17 | // Get logged in user's info 18 | http.getJSON(config.FACEBOOK_GRAPH_API_URL + "/me?access_token=" + this.accessToken).then((res) => { 19 | this.set("username", res.name); 20 | this.set("userId", res.id); 21 | 22 | // Get logged in user's avatar 23 | // ref: https://github.com/NativeScript/NativeScript/issues/2176 24 | console.log(config.FACEBOOK_GRAPH_API_URL + "/" + this.get("userId") + "/picture?type=large&redirect=false&access_token=" + this.accessToken); 25 | http.getJSON(config.FACEBOOK_GRAPH_API_URL + "/" + this.get("userId") + "/picture?type=large&redirect=false&access_token=" + this.accessToken).then((res) => { 26 | this.set("avatarUrl", res.data.url); 27 | }, function (err) { 28 | alert("Error getting user info: " + err); 29 | }); 30 | }, function (err) { 31 | alert("Error getting user info: " + err); 32 | }); 33 | } 34 | 35 | private _navigate(path: string) { 36 | let topmost = frameModule.topmost(); 37 | topmost.navigate({ 38 | moduleName: path, 39 | clearHistory: true 40 | }); 41 | } 42 | 43 | public onLogout() { 44 | appSettings.clear(); 45 | this._navigate("login-page"); 46 | } 47 | 48 | public logout() { 49 | fbLogout(() => { 50 | appSettings.clear(); 51 | this._navigate("login-page"); 52 | }); 53 | } 54 | 55 | public getCurrentAccessToken() { 56 | let accessToken = getCurrentAccessToken(); 57 | 58 | alert("Current access token: " + JSON.stringify(accessToken, null, '\t')); 59 | } 60 | 61 | public logEventAction() { 62 | this.eventCounter++; 63 | logEvent('Home', [{ 64 | key: 'counter', 65 | value: this.eventCounter.toString() 66 | }]); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nativescript-facebook", 3 | "version": "4.2.1", 4 | "description": "NativeScript plugin, wrapper of native Facebook SDK for Android and iOS.", 5 | "nativescript": { 6 | "platforms": { 7 | "android": "4.0.0", 8 | "ios": "4.0.0" 9 | } 10 | }, 11 | "scripts": { 12 | "tsc": "tsc -skipLibCheck", 13 | "ngc": "node --max-old-space-size=8192 ./node_modules/.bin/ngc", 14 | "build": "npm i && tsc && tns plugin build && npm run ngc", 15 | "build.iosOnly": "npm i && tsc && npm run ngc", 16 | "ci.tslint": "npm i && tslint '**/*.ts' --config '../tslint.json' --exclude '**/node_modules/**' --exclude '**/platforms/**'", 17 | "prepublishOnly": "npm run build", 18 | "plugin.tscwatch": "tsc -skipLibCheck -w", 19 | "demo.ios": "npm i && npm run tsc && cd ../demo && tns run ios", 20 | "demo.android": "npm i && npm run tsc && cd ../demo && tns run android", 21 | "demo.ng.ios": "npm i && npm run tsc && cd ../demo-angular && tns run ios", 22 | "demo.ng.android": "npm i && npm run tsc && cd ../demo-angular && tns run android", 23 | "demo.vue.ios": "npm i && npm run tsc && cd ../demo-vue && tns run ios", 24 | "demo.vue.android": "npm i && npm run tsc && cd ../demo-vue && tns run android" 25 | }, 26 | "repository": { 27 | "type": "git", 28 | "url": "https://github.com/NativeScript/nativescript-facebook.git" 29 | }, 30 | "keywords": [ 31 | "NativeScript", 32 | "TypeScript", 33 | "Android", 34 | "iOS", 35 | "Facebook" 36 | ], 37 | "author": "NativeScript Team", 38 | "bugs": { 39 | "url": "https://github.com/NativeScript/nativescript-facebook/issues" 40 | }, 41 | "license": "Apache 2.0", 42 | "typings": "index.d.ts", 43 | "homepage": "https://github.com/NativeScript/nativescript-facebook", 44 | "readmeFilename": "README.md", 45 | "devDependencies": { 46 | "tns-core-modules": "^6.0.0", 47 | "tns-platform-declarations": "^6.0.0", 48 | "typescript": "~3.5.3", 49 | "nativescript-angular": "~8.20.0", 50 | "nativescript-vue": "~2.4.0", 51 | "@angular/core": "~8.2.0", 52 | "@angular/common": "~8.2.0", 53 | "@angular/compiler": "~8.2.0", 54 | "@angular/compiler-cli": "~8.2.0", 55 | "rxjs": "^6.3.3", 56 | "zone.js": "~0.8.26", 57 | "tslint": "~5.11.0" 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /DevelopmentWorkflow.md: -------------------------------------------------------------------------------- 1 | # Development Workflow 2 | 3 | 4 | 5 | - [Prerequisites](#prerequisites) 6 | - [Develop locally](#develop-locally) 7 | - [Run UI Tests](#run-ui-tests) 8 | 9 | 10 | 11 | 12 | ## Prerequisites 13 | 14 | * Install your native toolchain and NativeScript as [described in the docs](https://docs.nativescript.org/start/quick-setup) 15 | 16 | * Review [NativeScript plugins documentation](https://docs.nativescript.org/plugins/plugins) for more details on plugins development 17 | 18 | 19 | ## Develop locally 20 | 21 | For local development we recommend using the npm commands provided in the plugin's package.json 22 | 23 | Basically executing a bunch of commands will be enough for you to start making changes to the plugin and see them live synced in the demo. It's up to you to decide which demo to use for development - TypeScript or TypeScript + Angular. 24 | 25 | 26 | To run and develop using TypeScript demo: 27 | ```bash 28 | $ cd nativescript-facebook/src 29 | $ npm run demo.ios 30 | $ npm run demo.android 31 | ``` 32 | 33 | To run and develop using TypeScript + Angular demo: 34 | ```bash 35 | $ cd nativescript-facebook/src 36 | $ npm run demo.ng.ios 37 | $ npm run demo.ng.android 38 | ``` 39 | 40 | After all the changes are done make sure to 41 | - test them in all the demo apps 42 | - run the UI tests. 43 | 44 | For details on plugins development workflow, read [NativeScript plugins documentation](https://docs.nativescript.org/plugins/building-plugins#step-2-set-up-a-development-workflow) covering that topic. 45 | 46 | 47 | ## Run UI Tests 48 | 49 | 1. Navigate to `demo/e2e` 50 | ``` bash 51 | cd demo/e2e 52 | ``` 53 | 54 | 2. Make sure to have an emulator set up or connect a physical Android/iOS device. 55 | 56 | 3. Build the app for Android or iOS 57 | ```bash 58 | tns build android 59 | tns build ios 60 | ``` 61 | 4. Install [appium](http://appium.io/) globally. 62 | ``` bash 63 | npm install -g appium 64 | ``` 65 | 66 | 5. Follow the instructions in the [nativescript-dev-appium](https://github.com/nativescript/nativescript-dev-appium#custom-appium-capabilities) plugin to add an appium capability for your device inside `appium.capabilities.json`. 67 | 68 | 7. Run the automated tests. The value of the `runType` argument should match the name of the capability that you just added. 69 | ``` bash 70 | npm run e2e -- --runType capabilityName 71 | ``` 72 | 73 | [Read more about UI testing](https://docs.nativescript.org/plugins/ui-tests). -------------------------------------------------------------------------------- /src/deep-linking.android.ts: -------------------------------------------------------------------------------- 1 | import * as application from "tns-core-modules/application"; 2 | import { DeepLink } from './deep-linking.common'; 3 | 4 | let androidApplication; 5 | 6 | export function initDeepLinking(appId: string) { 7 | com.facebook.FacebookSdk.setApplicationId(appId); 8 | androidApplication = application.android; 9 | try { 10 | // fb initialization 11 | com.facebook.FacebookSdk.sdkInitialize(androidApplication.context.getApplicationContext()); 12 | com.facebook.FacebookSdk.setAutoLogAppEventsEnabled(true); 13 | } 14 | catch (e) { 15 | console.log(e); 16 | } 17 | } 18 | 19 | export function fetchDeferredAppLink(): Promise { 20 | return new Promise((resolve, reject) => { 21 | try { 22 | com.facebook.applinks.AppLinkData.fetchDeferredAppLinkData(androidApplication.context.getApplicationContext(), new com.facebook.applinks.AppLinkData.CompletionHandler({ 23 | onDeferredAppLinkDataFetched: function (appLinkData) { 24 | // Process app link data 25 | if (!appLinkData) { 26 | resolve(null); 27 | return; 28 | } 29 | let targetUri = appLinkData.getTargetUri(); 30 | let target = null; 31 | if (targetUri) target = targetUri.toString(); 32 | let deepLink = new DeepLink({ target: target, ref: appLinkData.getRef(), promoCode: appLinkData.getPromotionCode() }); 33 | resolve(deepLink); 34 | } 35 | })); 36 | } 37 | catch (e) { 38 | reject(e); 39 | } 40 | }); 41 | } 42 | 43 | export function registerDeepLinkCallback(callback): void { 44 | application.android.on( 45 | application.AndroidApplication.activityNewIntentEvent, 46 | args => { 47 | const intent: android.content.Intent = args.activity.getIntent(); 48 | try { 49 | let data = intent.getData(); 50 | let url = null; 51 | if (data) { 52 | url = data.toString(); 53 | } 54 | if (url == null) { 55 | let appLink = com.facebook.applinks.AppLinkData.createFromAlApplinkData(intent); 56 | if (!appLink) return; 57 | url = appLink.getTargetUri(); 58 | } 59 | if (callback) 60 | callback(null, url, null); 61 | } catch (e) { 62 | console.error(e); 63 | } 64 | } 65 | ); 66 | } 67 | 68 | 69 | -------------------------------------------------------------------------------- /demo-angular/app/pages/home/home.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, ChangeDetectorRef } from "@angular/core"; 2 | import * as Facebook from "nativescript-facebook"; 3 | import { NavigationService } from "../../services/navigation.service"; 4 | import { config } from "../../app.config"; 5 | import * as http from "tns-core-modules/http"; 6 | import * as appSettings from "tns-core-modules/application-settings"; 7 | 8 | @Component({ 9 | selector: "home", 10 | moduleId: module.id, 11 | templateUrl: "home.component.html", 12 | styleUrls: ["home.component.css"] 13 | }) 14 | export class HomeComponent { 15 | accessToken: string = appSettings.getString("access_token"); 16 | userId: string; 17 | username: string; 18 | avatarUrl: string; 19 | eventCounter: number = 0; 20 | 21 | constructor(private ref: ChangeDetectorRef, private navigationService: NavigationService) { 22 | // Get logged in user's info 23 | http.getJSON(config.FACEBOOK_GRAPH_API_URL + "/me?access_token=" + this.accessToken).then((res) => { 24 | this.username = res["name"]; 25 | this.userId = res["id"]; 26 | 27 | // Get logged in user's avatar 28 | // ref: https://github.com/NativeScript/NativeScript/issues/2176 29 | http.getJSON(config.FACEBOOK_GRAPH_API_URL + "/" + this.userId + "/picture?type=large&redirect=false&access_token=" + this.accessToken).then((res) => { 30 | this.avatarUrl = res["data"]["url"]; 31 | this.ref.detectChanges(); 32 | }, function (err) { 33 | alert("Error getting user info: " + err); 34 | }); 35 | }, function (err) { 36 | alert("Error getting user info: " + err); 37 | }); 38 | } 39 | 40 | onLogout(eventData: Facebook.LoginEventData) { 41 | if (eventData.error) { 42 | alert("Error during login: " + eventData.error); 43 | } else { 44 | appSettings.clear(); 45 | this.navigationService.go(['login'], "slideRight"); 46 | } 47 | 48 | } 49 | 50 | logout() { 51 | Facebook.logout(() => { 52 | appSettings.clear(); 53 | this.navigationService.go(['login'], "slideRight"); 54 | }); 55 | } 56 | 57 | logEvent() { 58 | this.eventCounter++; 59 | Facebook.logEvent('Home', [{ 60 | key: 'counter', 61 | value: this.eventCounter.toString() 62 | }]); 63 | } 64 | 65 | public getCurrentAccessToken() { 66 | let accessToken = Facebook.getCurrentAccessToken(); 67 | 68 | alert("Current access token: " + JSON.stringify(accessToken, null, '\t')); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /tests/e2e/config/appium.capabilities.json: -------------------------------------------------------------------------------- 1 | { 2 | "android23.local": { 3 | "platformName": "Android", 4 | "platformVersion": "6.0", 5 | "deviceName": "Emulator_Api23_Default", 6 | "avd": "Emulator_Api23_Default", 7 | "noReset": true 8 | }, 9 | "android23": { 10 | "platformName": "Android", 11 | "platformVersion": "6.0", 12 | "deviceName": "Android Emulator", 13 | "appium-version": "1.7.1", 14 | "noReset": true 15 | }, 16 | "android24": { 17 | "platformName": "Android", 18 | "platformVersion": "7.0", 19 | "deviceName": "Android GoogleAPI Emulator", 20 | "appiumVersion": "1.9.1", 21 | "noReset": true 22 | }, 23 | "android24.local": { 24 | "platformName": "Android", 25 | "platformVersion": "7.0", 26 | "deviceName": "Emulator-Api24-Google", 27 | "avd":"Emulator-Api24-Google", 28 | "noReset": true, 29 | "lt": 60000, 30 | "newCommandTimeout": 720, 31 | "appiumVersion": "1.9.1", 32 | "appActivity": "com.tns.NativeScriptActivity", 33 | "fullReset": false, 34 | "app": "", 35 | "automationName": "UIAutomator2", 36 | "density": 3.2, 37 | "offsetPixels": 51 38 | }, 39 | "android25": { 40 | "platformName": "Android", 41 | "platformVersion": "7.1", 42 | "deviceName": "Android GoogleAPI Emulator", 43 | "appium-version": "1.7.1", 44 | "noReset": true 45 | }, 46 | "android28": { 47 | "platformName": "Android", 48 | "platformVersion": "9.0", 49 | "deviceName": "Android GoogleAPI Emulator", 50 | "appiumVersion": "1.9.1", 51 | "noReset": true 52 | }, 53 | "sim11iPhone6": { 54 | "platformName": "iOS", 55 | "platformVersion": "11.0", 56 | "deviceName": "iPhone 6", 57 | "appium-version": "1.7.1", 58 | "app": "" 59 | }, 60 | "sim12iPhoneX": { 61 | "platformName": "iOS", 62 | "platformVersion": "12.0", 63 | "deviceName": "iPhone X", 64 | "appiumVersion": "1.9.1", 65 | "app": "", 66 | "noReset": true, 67 | "fullReset": false, 68 | "density": 3, 69 | "offsetPixels": 87, 70 | "idleTimeout": 120 71 | }, 72 | "sim103iPhone6": { 73 | "browserName": "", 74 | "appium-version": "1.7.1", 75 | "platformName": "iOS", 76 | "platformVersion": "10.3", 77 | "deviceName": "iPhone 6", 78 | "app": "" 79 | }, 80 | "sim10iPhone6": { 81 | "platformName": "iOS", 82 | "platformVersion": "10.0", 83 | "deviceName": "iPhone 6", 84 | "appium-version": "1.7.1", 85 | "app": "" 86 | }, 87 | "sim_11.2_iPhone6": { 88 | "browserName": "", 89 | "appium-version": "1.7.1", 90 | "platformName": "iOS", 91 | "platformVersion": "11.2", 92 | "deviceName": "iPhone 6", 93 | "app": "" 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /src/login-manager.ios.ts: -------------------------------------------------------------------------------- 1 | import { LoginResponse } from './login-response'; 2 | import { FacebookAccessToken } from "./facebook-access-token"; 3 | 4 | const LOGIN_PERMISSIONS = ["public_profile", "email"]; 5 | 6 | // TODO: add getter and setter 7 | export let onLoginCallback; 8 | export let onLogoutCallback; 9 | 10 | let loginManager; 11 | 12 | export function init(fbId: string) { 13 | setAppId(fbId); 14 | loginManager = FBSDKLoginManager.alloc().init(); 15 | loginManager.loginBehavior = FBSDKLoginBehavior.Browser; 16 | } 17 | 18 | export function _registerLogoutCallback(callback: Function) { 19 | onLogoutCallback = callback; 20 | } 21 | 22 | export function _registerLoginCallback(callback: Function) { 23 | 24 | onLoginCallback = function (result: FBSDKLoginManagerLoginResult, error: NSError) { 25 | 26 | if (error) { 27 | callback(new Error(error.localizedDescription)); 28 | return; 29 | } 30 | 31 | if (!result) { 32 | callback(new Error("Fatal error")); 33 | return; 34 | } 35 | 36 | if (result.isCancelled) { 37 | callback(new Error('canceled')); 38 | return; 39 | } 40 | 41 | if (result.token) { 42 | let token = result.token.tokenString; 43 | let loginResponse = new LoginResponse(token); 44 | callback(null, loginResponse); 45 | } 46 | else { 47 | callback(new Error("Could not acquire an access token")); 48 | return; 49 | } 50 | }; 51 | } 52 | 53 | function setAppId(fbAppId: string) { 54 | FBSDKSettings.appID = fbAppId; 55 | } 56 | 57 | export function requestPublishPermissions(permissions: string[], callback: Function) { 58 | _registerLoginCallback(callback); 59 | loginManager.logInWithPublishPermissionsHandler(permissions, onLoginCallback); 60 | } 61 | 62 | export function requestReadPermissions(permissions: string[], callback: Function) { 63 | _registerLoginCallback(callback); 64 | loginManager.logInWithPermissionsFromViewControllerHandler(permissions, undefined, onLoginCallback); 65 | } 66 | 67 | export function login(callback: Function) { 68 | requestReadPermissions(LOGIN_PERMISSIONS, callback); 69 | } 70 | 71 | export function getCurrentAccessToken() { 72 | let sdkAccessToken = FBSDKAccessToken.currentAccessToken; 73 | let accessToken = null; 74 | 75 | if (sdkAccessToken) { 76 | accessToken = new FacebookAccessToken(); 77 | accessToken.accessToken = sdkAccessToken.tokenString; 78 | accessToken.userId = sdkAccessToken.userID; 79 | accessToken.refreshDate = sdkAccessToken.refreshDate; 80 | accessToken.expirationDate = sdkAccessToken.expirationDate; 81 | } 82 | 83 | return accessToken; 84 | } 85 | 86 | export function logout(callback: Function) { 87 | loginManager.logOut(); 88 | if (callback) { 89 | callback(); 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "29x29", 5 | "idiom" : "iphone", 6 | "filename" : "icon-29.png", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "size" : "29x29", 11 | "idiom" : "iphone", 12 | "filename" : "icon-29@2x.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "icon-29@3x.png", 19 | "scale" : "3x" 20 | }, 21 | { 22 | "size" : "40x40", 23 | "idiom" : "iphone", 24 | "filename" : "icon-40@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "40x40", 29 | "idiom" : "iphone", 30 | "filename" : "icon-40@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "57x57", 35 | "idiom" : "iphone", 36 | "filename" : "icon-57.png", 37 | "scale" : "1x" 38 | }, 39 | { 40 | "size" : "57x57", 41 | "idiom" : "iphone", 42 | "filename" : "icon-57@2x.png", 43 | "scale" : "2x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "icon-60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "icon-60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "29x29", 59 | "idiom" : "ipad", 60 | "filename" : "icon-29.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "29x29", 65 | "idiom" : "ipad", 66 | "filename" : "icon-29@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "40x40", 71 | "idiom" : "ipad", 72 | "filename" : "icon-40.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "40x40", 77 | "idiom" : "ipad", 78 | "filename" : "icon-40@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "50x50", 83 | "idiom" : "ipad", 84 | "filename" : "icon-50.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "50x50", 89 | "idiom" : "ipad", 90 | "filename" : "icon-50@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "72x72", 95 | "idiom" : "ipad", 96 | "filename" : "icon-72.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "72x72", 101 | "idiom" : "ipad", 102 | "filename" : "icon-72@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "76x76", 107 | "idiom" : "ipad", 108 | "filename" : "icon-76.png", 109 | "scale" : "1x" 110 | }, 111 | { 112 | "size" : "76x76", 113 | "idiom" : "ipad", 114 | "filename" : "icon-76@2x.png", 115 | "scale" : "2x" 116 | }, 117 | { 118 | "size" : "83.5x83.5", 119 | "idiom" : "ipad", 120 | "filename" : "icon-83.5@2x.png", 121 | "scale" : "2x" 122 | } 123 | ], 124 | "info" : { 125 | "version" : 1, 126 | "author" : "xcode" 127 | } 128 | } -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "29x29", 5 | "idiom" : "iphone", 6 | "filename" : "icon-29.png", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "size" : "29x29", 11 | "idiom" : "iphone", 12 | "filename" : "icon-29@2x.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "icon-29@3x.png", 19 | "scale" : "3x" 20 | }, 21 | { 22 | "size" : "40x40", 23 | "idiom" : "iphone", 24 | "filename" : "icon-40@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "40x40", 29 | "idiom" : "iphone", 30 | "filename" : "icon-40@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "57x57", 35 | "idiom" : "iphone", 36 | "filename" : "icon-57.png", 37 | "scale" : "1x" 38 | }, 39 | { 40 | "size" : "57x57", 41 | "idiom" : "iphone", 42 | "filename" : "icon-57@2x.png", 43 | "scale" : "2x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "icon-60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "icon-60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "29x29", 59 | "idiom" : "ipad", 60 | "filename" : "icon-29.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "29x29", 65 | "idiom" : "ipad", 66 | "filename" : "icon-29@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "40x40", 71 | "idiom" : "ipad", 72 | "filename" : "icon-40.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "40x40", 77 | "idiom" : "ipad", 78 | "filename" : "icon-40@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "50x50", 83 | "idiom" : "ipad", 84 | "filename" : "icon-50.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "50x50", 89 | "idiom" : "ipad", 90 | "filename" : "icon-50@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "72x72", 95 | "idiom" : "ipad", 96 | "filename" : "icon-72.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "72x72", 101 | "idiom" : "ipad", 102 | "filename" : "icon-72@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "76x76", 107 | "idiom" : "ipad", 108 | "filename" : "icon-76.png", 109 | "scale" : "1x" 110 | }, 111 | { 112 | "size" : "76x76", 113 | "idiom" : "ipad", 114 | "filename" : "icon-76@2x.png", 115 | "scale" : "2x" 116 | }, 117 | { 118 | "size" : "83.5x83.5", 119 | "idiom" : "ipad", 120 | "filename" : "icon-83.5@2x.png", 121 | "scale" : "2x" 122 | } 123 | ], 124 | "info" : { 125 | "version" : 1, 126 | "author" : "xcode" 127 | } 128 | } -------------------------------------------------------------------------------- /demo-vue/app/App_Resources/iOS/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to NativeScript Facebook 2 | 3 | :+1: First of all, thank you for taking the time to contribute! :+1: 4 | 5 | Here are some guides on how to do that: 6 | 7 | 8 | 9 | - [Code of Conduct](#code-of-conduct) 10 | - [Reporting Bugs](#reporting-bugs) 11 | - [Requesting Features](#requesting-features) 12 | - [Submitting a PR](#submitting-a-pr) 13 | - [Where to Start](#where-to-start) 14 | 15 | 16 | 17 | ## Code of Conduct 18 | Help us keep a healthy and open community. We expect all participants in this project to adhere to the [NativeScript Code Of Conduct](https://github.com/NativeScript/codeofconduct). 19 | 20 | 21 | ## Reporting Bugs 22 | 23 | 1. Always update to the most recent master release; the bug may already be resolved. 24 | 2. Search for similar issues in the issues list for this repo; it may already be an identified problem. 25 | 3. If this is a bug or problem that is clear, simple, and is unlikely to require any discussion -- it is OK to open an issue on GitHub with a reproduction of the bug including workflows and screenshots. If possible, submit a Pull Request with a failing test, entire application or module. If you'd rather take matters into your own hands, fix the bug yourself (jump down to the [Submitting a PR](#submitting-a-pr) section). 26 | 27 | ## Requesting Features 28 | 29 | 1. Use Github Issues to submit feature requests. 30 | 2. First, search for a similar request and extend it if applicable. This way it would be easier for the community to track the features. 31 | 3. When requesting a new feature, please provide as much detail as possible about why you need the feature in your apps. We prefer that you explain a need rather than explain a technical solution for it. That might trigger a nice conversation on finding the best and broadest technical solution to a specific need. 32 | 33 | ## Submitting a PR 34 | 35 | Before you begin make sure there is an issue for the bug or feature you will be working on. 36 | 37 | Following these steps is the best way to get your code included in the project: 38 | 39 | 1. Fork and clone the nativescript-facebook repo: 40 | ```bash 41 | git clone https://github.com//nativescript-facebook.git 42 | # Navigate to the newly cloned directory 43 | cd nativescript-facebook 44 | # Add an "upstream" remote pointing to the original repo. 45 | git remote add upstream https://github.com/NativeScript/nativescript-facebook.git 46 | ``` 47 | 48 | 2. Read our [development workflow guide](DevelopmentWorkflow.md) for local setup 49 | 50 | 3. Create a branch for your PR 51 | ```bash 52 | git checkout -b master 53 | ``` 54 | 55 | 4. The fun part! Make your code changes. Make sure you: 56 | - Follow the [code conventions guide](https://github.com/NativeScript/NativeScript/blob/master/CodingConvention.md). 57 | - Follow the [commit message guidelines](https://github.com/NativeScript/NativeScript/blob/master/CONTRIBUTING.md#-commit-message-guidelineshttps://github.com/NativeScript/NativeScript/blob/master/CONTRIBUTING.md#-commit-message-guidelines) 58 | - Update the README if you make changes to the plugin API 59 | 60 | 5. Before you submit your PR: 61 | - Rebase your changes to the latest master: `git pull --rebase upstream master`. 62 | - Ensure your changes pass tslint validation. (run `npm run tslint` in the `src` folder). 63 | 64 | 6. Push your fork. If you have rebased you might have to use force-push your branch: 65 | ``` 66 | git push origin --force 67 | ``` 68 | 69 | 7. [Submit your pull request](https://github.com/NativeScript/nativescript-facebook/compare) and compare to `NativeScript/nativescript-facebook`. Please, fill in the Pull Request template - it will help us better understand the PR and increase the chances of it getting merged quickly. 70 | 71 | It's our turn from there on! We will review the PR and discuss changes you might have to make before merging it! Thanks! 72 | 73 | ## Where to Start 74 | 75 | If you want to contribute, but you are not sure where to start - look for issues labeled [`help wanted`](https://github.com/NativeScript/nativescript-facebook/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22). 76 | -------------------------------------------------------------------------------- /demo-vue/app/components/Home.vue: -------------------------------------------------------------------------------- 1 | 20 | 21 | 80 | 81 | 111 | -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "extent" : "full-screen", 5 | "idiom" : "iphone", 6 | "subtype" : "736h", 7 | "filename" : "Default-736h@3x.png", 8 | "minimum-system-version" : "8.0", 9 | "orientation" : "portrait", 10 | "scale" : "3x" 11 | }, 12 | { 13 | "extent" : "full-screen", 14 | "idiom" : "iphone", 15 | "subtype" : "736h", 16 | "filename" : "Default-Landscape@3x.png", 17 | "minimum-system-version" : "8.0", 18 | "orientation" : "landscape", 19 | "scale" : "3x" 20 | }, 21 | { 22 | "extent" : "full-screen", 23 | "idiom" : "iphone", 24 | "subtype" : "667h", 25 | "filename" : "Default-667h@2x.png", 26 | "minimum-system-version" : "8.0", 27 | "orientation" : "portrait", 28 | "scale" : "2x" 29 | }, 30 | { 31 | "orientation" : "portrait", 32 | "idiom" : "iphone", 33 | "filename" : "Default@2x.png", 34 | "extent" : "full-screen", 35 | "minimum-system-version" : "7.0", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "extent" : "full-screen", 40 | "idiom" : "iphone", 41 | "subtype" : "retina4", 42 | "filename" : "Default-568h@2x.png", 43 | "minimum-system-version" : "7.0", 44 | "orientation" : "portrait", 45 | "scale" : "2x" 46 | }, 47 | { 48 | "orientation" : "portrait", 49 | "idiom" : "ipad", 50 | "filename" : "Default-Portrait.png", 51 | "extent" : "full-screen", 52 | "minimum-system-version" : "7.0", 53 | "scale" : "1x" 54 | }, 55 | { 56 | "orientation" : "landscape", 57 | "idiom" : "ipad", 58 | "filename" : "Default-Landscape.png", 59 | "extent" : "full-screen", 60 | "minimum-system-version" : "7.0", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "orientation" : "portrait", 65 | "idiom" : "ipad", 66 | "filename" : "Default-Portrait@2x.png", 67 | "extent" : "full-screen", 68 | "minimum-system-version" : "7.0", 69 | "scale" : "2x" 70 | }, 71 | { 72 | "orientation" : "landscape", 73 | "idiom" : "ipad", 74 | "filename" : "Default-Landscape@2x.png", 75 | "extent" : "full-screen", 76 | "minimum-system-version" : "7.0", 77 | "scale" : "2x" 78 | }, 79 | { 80 | "orientation" : "portrait", 81 | "idiom" : "iphone", 82 | "filename" : "Default.png", 83 | "extent" : "full-screen", 84 | "scale" : "1x" 85 | }, 86 | { 87 | "orientation" : "portrait", 88 | "idiom" : "iphone", 89 | "filename" : "Default@2x.png", 90 | "extent" : "full-screen", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "orientation" : "portrait", 95 | "idiom" : "iphone", 96 | "filename" : "Default-568h@2x.png", 97 | "extent" : "full-screen", 98 | "subtype" : "retina4", 99 | "scale" : "2x" 100 | }, 101 | { 102 | "orientation" : "portrait", 103 | "idiom" : "ipad", 104 | "extent" : "to-status-bar", 105 | "scale" : "1x" 106 | }, 107 | { 108 | "orientation" : "portrait", 109 | "idiom" : "ipad", 110 | "filename" : "Default-Portrait.png", 111 | "extent" : "full-screen", 112 | "scale" : "1x" 113 | }, 114 | { 115 | "orientation" : "landscape", 116 | "idiom" : "ipad", 117 | "extent" : "to-status-bar", 118 | "scale" : "1x" 119 | }, 120 | { 121 | "orientation" : "landscape", 122 | "idiom" : "ipad", 123 | "filename" : "Default-Landscape.png", 124 | "extent" : "full-screen", 125 | "scale" : "1x" 126 | }, 127 | { 128 | "orientation" : "portrait", 129 | "idiom" : "ipad", 130 | "extent" : "to-status-bar", 131 | "scale" : "2x" 132 | }, 133 | { 134 | "orientation" : "portrait", 135 | "idiom" : "ipad", 136 | "filename" : "Default-Portrait@2x.png", 137 | "extent" : "full-screen", 138 | "scale" : "2x" 139 | }, 140 | { 141 | "orientation" : "landscape", 142 | "idiom" : "ipad", 143 | "extent" : "to-status-bar", 144 | "scale" : "2x" 145 | }, 146 | { 147 | "orientation" : "landscape", 148 | "idiom" : "ipad", 149 | "filename" : "Default-Landscape@2x.png", 150 | "extent" : "full-screen", 151 | "scale" : "2x" 152 | } 153 | ], 154 | "info" : { 155 | "version" : 1, 156 | "author" : "xcode" 157 | } 158 | } -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "extent" : "full-screen", 5 | "idiom" : "iphone", 6 | "subtype" : "736h", 7 | "filename" : "Default-736h@3x.png", 8 | "minimum-system-version" : "8.0", 9 | "orientation" : "portrait", 10 | "scale" : "3x" 11 | }, 12 | { 13 | "extent" : "full-screen", 14 | "idiom" : "iphone", 15 | "subtype" : "736h", 16 | "filename" : "Default-Landscape@3x.png", 17 | "minimum-system-version" : "8.0", 18 | "orientation" : "landscape", 19 | "scale" : "3x" 20 | }, 21 | { 22 | "extent" : "full-screen", 23 | "idiom" : "iphone", 24 | "subtype" : "667h", 25 | "filename" : "Default-667h@2x.png", 26 | "minimum-system-version" : "8.0", 27 | "orientation" : "portrait", 28 | "scale" : "2x" 29 | }, 30 | { 31 | "orientation" : "portrait", 32 | "idiom" : "iphone", 33 | "filename" : "Default@2x.png", 34 | "extent" : "full-screen", 35 | "minimum-system-version" : "7.0", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "extent" : "full-screen", 40 | "idiom" : "iphone", 41 | "subtype" : "retina4", 42 | "filename" : "Default-568h@2x.png", 43 | "minimum-system-version" : "7.0", 44 | "orientation" : "portrait", 45 | "scale" : "2x" 46 | }, 47 | { 48 | "orientation" : "portrait", 49 | "idiom" : "ipad", 50 | "filename" : "Default-Portrait.png", 51 | "extent" : "full-screen", 52 | "minimum-system-version" : "7.0", 53 | "scale" : "1x" 54 | }, 55 | { 56 | "orientation" : "landscape", 57 | "idiom" : "ipad", 58 | "filename" : "Default-Landscape.png", 59 | "extent" : "full-screen", 60 | "minimum-system-version" : "7.0", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "orientation" : "portrait", 65 | "idiom" : "ipad", 66 | "filename" : "Default-Portrait@2x.png", 67 | "extent" : "full-screen", 68 | "minimum-system-version" : "7.0", 69 | "scale" : "2x" 70 | }, 71 | { 72 | "orientation" : "landscape", 73 | "idiom" : "ipad", 74 | "filename" : "Default-Landscape@2x.png", 75 | "extent" : "full-screen", 76 | "minimum-system-version" : "7.0", 77 | "scale" : "2x" 78 | }, 79 | { 80 | "orientation" : "portrait", 81 | "idiom" : "iphone", 82 | "filename" : "Default.png", 83 | "extent" : "full-screen", 84 | "scale" : "1x" 85 | }, 86 | { 87 | "orientation" : "portrait", 88 | "idiom" : "iphone", 89 | "filename" : "Default@2x.png", 90 | "extent" : "full-screen", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "orientation" : "portrait", 95 | "idiom" : "iphone", 96 | "filename" : "Default-568h@2x.png", 97 | "extent" : "full-screen", 98 | "subtype" : "retina4", 99 | "scale" : "2x" 100 | }, 101 | { 102 | "orientation" : "portrait", 103 | "idiom" : "ipad", 104 | "extent" : "to-status-bar", 105 | "scale" : "1x" 106 | }, 107 | { 108 | "orientation" : "portrait", 109 | "idiom" : "ipad", 110 | "filename" : "Default-Portrait.png", 111 | "extent" : "full-screen", 112 | "scale" : "1x" 113 | }, 114 | { 115 | "orientation" : "landscape", 116 | "idiom" : "ipad", 117 | "extent" : "to-status-bar", 118 | "scale" : "1x" 119 | }, 120 | { 121 | "orientation" : "landscape", 122 | "idiom" : "ipad", 123 | "filename" : "Default-Landscape.png", 124 | "extent" : "full-screen", 125 | "scale" : "1x" 126 | }, 127 | { 128 | "orientation" : "portrait", 129 | "idiom" : "ipad", 130 | "extent" : "to-status-bar", 131 | "scale" : "2x" 132 | }, 133 | { 134 | "orientation" : "portrait", 135 | "idiom" : "ipad", 136 | "filename" : "Default-Portrait@2x.png", 137 | "extent" : "full-screen", 138 | "scale" : "2x" 139 | }, 140 | { 141 | "orientation" : "landscape", 142 | "idiom" : "ipad", 143 | "extent" : "to-status-bar", 144 | "scale" : "2x" 145 | }, 146 | { 147 | "orientation" : "landscape", 148 | "idiom" : "ipad", 149 | "filename" : "Default-Landscape@2x.png", 150 | "extent" : "full-screen", 151 | "scale" : "2x" 152 | } 153 | ], 154 | "info" : { 155 | "version" : 1, 156 | "author" : "xcode" 157 | } 158 | } -------------------------------------------------------------------------------- /demo/app/login-view-model.ts: -------------------------------------------------------------------------------- 1 | import {Observable} from 'tns-core-modules/data/observable'; 2 | import {ImageSource, fromResource} from 'tns-core-modules/image-source'; 3 | import { 4 | LoginEventData, 5 | login as fbLogin, 6 | getCurrentAccessToken, 7 | createShareLinksContent, 8 | createSharePhotosContent, 9 | createShareMessageGenericTemplateContent, 10 | MessageGenericTemplateImageAspectRatio, 11 | showShareDialog, 12 | showMessageDialog, 13 | canShareDialogShow, 14 | canMessageDialogShow, 15 | logEvent 16 | } from 'nativescript-facebook'; 17 | 18 | let frameModule = require('tns-core-modules/ui/frame'); 19 | let appSettings = require('tns-core-modules/application-settings'); 20 | 21 | export class LoginViewModel extends Observable { 22 | public linkContent = this.generateLinksShareContent(); 23 | public photosContent = this.generatePhotosShareContent(); 24 | public genericContent = this.generateGenericTemplateContent(); 25 | public canShowLinksShareDialog = canShareDialogShow(this.linkContent); 26 | public canShowPhotosShareDialog = canShareDialogShow(this.photosContent); 27 | public canShowLinksMessageDialog = canMessageDialogShow(this.linkContent); 28 | public canShowGenericMessageDialog = canMessageDialogShow(this.genericContent); 29 | public eventCounter = 0; 30 | 31 | 32 | private _navigate(path: string) { 33 | let topmost = frameModule.topmost(); 34 | topmost.navigate({ 35 | moduleName: path, 36 | clearHistory: true 37 | }); 38 | } 39 | 40 | public onLogin(eventData: LoginEventData) { 41 | if (eventData.error) { 42 | alert('Error during login: ' + eventData.error.message); 43 | } else { 44 | appSettings.setString('access_token', eventData.loginResponse.token); 45 | this._navigate('home-page'); 46 | } 47 | } 48 | 49 | public login() { 50 | fbLogin((err, fbData) => { 51 | if (err) { 52 | alert('Error during login: ' + err.message); 53 | } else { 54 | appSettings.setString('access_token', fbData.token); 55 | this._navigate('home-page'); 56 | } 57 | }); 58 | } 59 | 60 | public getCurrentAccessToken() { 61 | let accessToken = getCurrentAccessToken(); 62 | 63 | alert('Current access token: ' + JSON.stringify(accessToken, null, '\t')); 64 | } 65 | 66 | public generateLinksShareContent() { 67 | return createShareLinksContent('https://www.nativescript.org', 68 | 'Create Native iOS and Android Apps With JavaScript', 69 | { 70 | hashtag: '#Nativescript' 71 | }); 72 | } 73 | 74 | public generatePhotosShareContent() { 75 | const logoImage = fromResource('logo'); 76 | return createSharePhotosContent([logoImage], false, { 77 | hashtag: '#Nativescript' 78 | }); 79 | } 80 | 81 | public generateGenericTemplateContent() { 82 | return createShareMessageGenericTemplateContent({ 83 | element: { 84 | title: 'Nativescript', 85 | subtitle: 'Create Native iOS and Android Apps With JavaScript', 86 | imageUrl: 'https://d2odgkulk9w7if.cloudfront.net/images/default-source/home/how-it-works-min.png', 87 | button: { 88 | title: 'Check Doc', 89 | url: 'https://docs.nativescript.org' 90 | }, 91 | defaultAction: { 92 | title: 'Go HomePage', 93 | url: 'https://www.nativescript.org' 94 | } 95 | }, 96 | // it seems android have to provide a pageId, otherwise the MessageDialog just wont show 97 | pageID: 'testestsett', 98 | imageAspectRatio: MessageGenericTemplateImageAspectRatio.Horizontal 99 | }); 100 | } 101 | 102 | public onShareDialog() { 103 | showShareDialog(this.linkContent, (error, result) => { 104 | if (error) { 105 | console.error(error); 106 | return; 107 | } 108 | alert('Successfully shared'); 109 | }); 110 | } 111 | 112 | public onShareDialogPhotos() { 113 | showShareDialog(this.photosContent); 114 | } 115 | 116 | public onSendDialog() { 117 | showMessageDialog(this.linkContent); 118 | } 119 | 120 | public onSendGenericDialog() { 121 | showMessageDialog(this.genericContent); 122 | } 123 | 124 | public logEventAction() { 125 | this.eventCounter++; 126 | logEvent('Login', [{ 127 | key: 'counter', 128 | value: this.eventCounter, 129 | }]); 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /src/share-manager.d.ts: -------------------------------------------------------------------------------- 1 | import { ImageSource } from 'tns-core-modules/image-source'; 2 | import { 3 | MessageGenericTemplateContent, 4 | MessageMediaTemplateContent, 5 | ShareAdditionContent, 6 | ShareCallbackFunction 7 | } from './share-manager.common'; 8 | 9 | export * from './share-manager.common'; 10 | 11 | /** 12 | * When people share links from your app to Facebook it includes a contentURL with the link to be shared. 13 | * @param {string} link Link to be shared. 14 | * @param {string} quote You can enable people to highlight text to appear as a quote with a shared link. Alternatively, you can predefine a quote, for example, a pull quote in an article, to appear with the shared link. In either case, the quote appears in its own field separate from the user comments. 15 | * @param {ShareAdditionContent} addition When you use the Facebook share dialog, you have additional options that aren't available when you share by using the API. 16 | */ 17 | export declare function createShareLinksContent(link: string, quote?: string, addition?: ShareAdditionContent): any; 18 | 19 | /** 20 | * People can share photos from your app to Facebook with the Share Dialog or with a custom interface. 21 | * Photos must be less than 12MB in size. 22 | * People need the native Facebook installed, version 7.0 or higher 23 | * @param {ImageSource[] | string[]} images : ImageSources or image urls of the photo to be shared 24 | * @param {ShareAdditionContent} addition When you use the Facebook share dialog, you have additional options that aren't available when you share by using the API. 25 | */ 26 | export declare function createSharePhotosContent(images: ImageSource[] | string[], userGenerated: boolean, addition?: ShareAdditionContent): any; 27 | 28 | /** 29 | * The generic template is a simple structured message that includes a title, subtitle, image, a button. You may also specify a default_action object that sets a URL that will be opened in the Messenger webview when the template is tapped. 30 | * see https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic for more. 31 | * @param {MessageGenericTemplateContent} contentConfig : config of the structure 32 | */ 33 | export declare function createShareMessageGenericTemplateContent(contentConfig: MessageGenericTemplateContent): any; 34 | 35 | /** 36 | * The media template allows you to send images, GIFs, and video as a structured message with an optional button. Videos and animated GIFs sent with the media template are playable in the conversation. 37 | * see https://developers.facebook.com/docs/messenger-platform/send-messages/template/media for more 38 | * @param {MessageMediaTemplateContent} contentConfig : config of the structure 39 | */ 40 | export declare function createShareMessageMediaTemplateContent(contentConfig: MessageMediaTemplateContent): any; 41 | 42 | 43 | /** 44 | * the SDK automatically checks for the native Facebook app. 45 | * If it isn't installed, the SDK switches people to their default browser and opens the Feed Dialog. If someone wants to share an Open Graph story, the SDK opens the Web Share Dialog. 46 | * @param {any} content: Links content or photos content 47 | * @param {ShareCallbackFunction} callback: Callback for the sharing dialog 48 | */ 49 | export declare function showShareDialog(content: any, callback?: ShareCallbackFunction): void; 50 | 51 | 52 | /** 53 | * The Message Dialog switches to the native Messenger for iOS app, then returns control to your app after a post is published. 54 | * @param {any} content: Links content or photos content, SUPPORTED SHARE TYPES - ShareLinkContent - ShareCameraEffectContent - ShareMessengerOpenGraphMusicTemplateContent - ShareMessengerMediaTemplateContent - ShareMessengerGenericTemplateContent UNSUPPORTED SHARE TYPES (DEPRECATED AUGUST 2018) - ShareOpenGraphContent - SharePhotoContent - ShareVideoContent - Any other types that are not one of the four supported types listed above 55 | * @param {ShareCallbackFunction} callback: Callback for the sharing dialog 56 | */ 57 | export declare function showMessageDialog(content: any, callback?: ShareCallbackFunction): void; 58 | 59 | 60 | /** 61 | * Indicates whether it is possible to show the dialog for ShareContent 62 | * @param {any} content: Links content or photos content 63 | */ 64 | export declare function canShareDialogShow(content: any): boolean; 65 | 66 | 67 | /** 68 | * Indicates whether it is possible to show the dialog for ShareContent 69 | * @param {any} content: Links content or photos content, SUPPORTED SHARE TYPES - ShareLinkContent - ShareCameraEffectContent - ShareMessengerOpenGraphMusicTemplateContent - ShareMessengerMediaTemplateContent - ShareMessengerGenericTemplateContent UNSUPPORTED SHARE TYPES (DEPRECATED AUGUST 2018) - ShareOpenGraphContent - SharePhotoContent - ShareVideoContent - Any other types that are not one of the four supported types listed above 70 | */ 71 | export declare function canMessageDialogShow(content: any): boolean; --------------------------------------------------------------------------------