From 7b6395817ef62c7f92839bff4a341e3733983b22 Mon Sep 17 00:00:00 2001 From: Tim Lancina Date: Fri, 12 Feb 2016 18:06:42 -0600 Subject: [PATCH] chore(facebook): update facebook docs --- dist/plugins/calendar.d.ts | 6 +- dist/plugins/calendar.js | 6 +- dist/plugins/calendar.js.map | 2 +- dist/plugins/contacts.js | 10 ++ dist/plugins/contacts.js.map | 2 +- dist/plugins/device.js.map | 2 +- dist/plugins/facebook.d.ts | 205 ++++++++++++++++++++++++-- dist/plugins/facebook.js | 269 +++++++++++++++++++++++++++++++-- dist/plugins/facebook.js.map | 2 +- src/plugins/contacts.ts | 10 ++ src/plugins/device.ts | 1 - src/plugins/facebook.ts | 278 +++++++++++++++++++++++++++++++++-- 12 files changed, 749 insertions(+), 44 deletions(-) diff --git a/dist/plugins/calendar.d.ts b/dist/plugins/calendar.d.ts index bebbd0ceb..d1045e23a 100644 --- a/dist/plugins/calendar.d.ts +++ b/dist/plugins/calendar.d.ts @@ -58,9 +58,7 @@ export declare class Calendar { /** * Returns the default calendar options. * - * @return Returns an object with the default calendar options - * ``` - * { + * @return Returns an object with the default calendar options: * firstReminderMinutes: 60, * secondReminderMinutes: null, * recurrence: null, // options are: 'daily', 'weekly', 'monthly', 'yearly' @@ -69,8 +67,6 @@ export declare class Calendar { * calendarName: null, * calendarId: null, * url: null - * } - * ``` */ static getCalendarOptions(): CalendarOptions; /** diff --git a/dist/plugins/calendar.js b/dist/plugins/calendar.js index f06b73384..09909f58d 100644 --- a/dist/plugins/calendar.js +++ b/dist/plugins/calendar.js @@ -64,9 +64,7 @@ var Calendar = (function () { /** * Returns the default calendar options. * - * @return Returns an object with the default calendar options - * ``` - * { + * @return Returns an object with the default calendar options: * firstReminderMinutes: 60, * secondReminderMinutes: null, * recurrence: null, // options are: 'daily', 'weekly', 'monthly', 'yearly' @@ -75,8 +73,6 @@ var Calendar = (function () { * calendarName: null, * calendarId: null, * url: null - * } - * ``` */ Calendar.getCalendarOptions = function () { return { diff --git a/dist/plugins/calendar.js.map b/dist/plugins/calendar.js.map index 86b25a054..e7bd838cd 100644 --- a/dist/plugins/calendar.js.map +++ b/dist/plugins/calendar.js.map @@ -1 +1 @@ -{"version":3,"file":"calendar.js","sourceRoot":"","sources":["../../src/plugins/calendar.ts"],"names":["Calendar","Calendar.constructor","Calendar.createCalendar","Calendar.deleteCalendar","Calendar.getCalendarOptions","Calendar.createEvent","Calendar.createEventWithOptions","Calendar.createEventInteractively","Calendar.createEventInteractivelyWithOptions","Calendar.findEvent","Calendar.findEventWithOptions","Calendar.listEventsInRange","Calendar.listCalendars","Calendar.findAllEventsInNamedCalendar","Calendar.modifyEvent","Calendar.modifyEventWithOptions","Calendar.deleteEvent","Calendar.deleteEventFromNamedCalendar","Calendar.openCalendar"],"mappings":";;;;;;AAAA,uBAA8B,UAAU,CAAC,CAAA;AAkBzC;;;;;GAKG;AACH;IAAAA;IA4bAC,CAACA;IAtbCD;;;;;;;;;;;;;;;;OAgBGA;IAEIA,uBAAcA,GADrBA,UACsBA,aAAuEA;QAC3FE,yEAAyEA;QACzEA,oEAAoEA;QACpEA,wEAAwEA;QACxEA,mDAAmDA;QACnDA,0DAA0DA;QAC1DA,MAAMA,CAACA,IAAIA,OAAOA,CAAMA,UAACA,GAAGA,EAAEA,GAAGA,IAAMA,CAACA,CAACA,CAACA;IAC5CA,CAACA;IAEDF;;;;;;;;;;;;;OAaGA;IAEIA,uBAAcA,GADrBA,UACsBA,IAAYA;QAChCG,yEAAyEA;QACzEA,oEAAoEA;QACpEA,wEAAwEA;QACxEA,mDAAmDA;QACnDA,0DAA0DA;QAC1DA,MAAMA,CAACA,IAAIA,OAAOA,CAAMA,UAACA,GAAGA,EAAEA,GAAGA,IAAMA,CAACA,CAACA,CAACA;IAC5CA,CAACA;IAEDH;;;;;;;;;;;;;;;;OAgBGA;IAIIA,2BAAkBA,GAHzBA;QAIEI,MAAMA,CAACA;YACLA,oBAAoBA,EAAEA,EAAEA;YACxBA,qBAAqBA,EAAEA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ACHA,uBAAWA,QAajBA;IAaDA;QAACA,gBAAOA,EAAEA;OACHA,kCAAsBA,QAc5BA;IAYDA;QAACA,gBAAOA,EAAEA;OACHA,oCAAwBA,QAa9BA;IAaDA;QAACA,gBAAOA,EAAEA;OACHA,+CAAmCA,QAczCA;IAuBDA;QAACA,gBAAOA,EAAEA;OACHA,qBAASA,QAafA;IAaDA;QAACA,gBAAOA,EAAEA;OACHA,gCAAoBA,QAc1BA;IASDA;QAACA,gBAAOA,EAAEA;OACHA,6BAAiBA,QAOvBA;IAMDA;QAACA,gBAAOA,EAAEA;OACHA,yBAAaA,QAEnBA;IAMDA;QAACA,gBAAOA,EAAEA;OACHA,wCAA4BA,QAOlCA;IAiBDA;QAACA,gBAAOA,EAAEA;OACHA,uBAAWA,QAkBjBA;IAkBAA;QAACA,gBAAOA,EAAEA;OACHA,kCAAsBA,QAmB5BA;IAYFA;QAACA,gBAAOA,EAAEA;OACHA,uBAAWA,QAajBA;IAaFA;QAACA,gBAAOA,EAAEA;OACHA,wCAA4BA,QAclCA;IAMAA;QAACA,gBAAOA,EAAEA;OACHA,wBAAYA,QAOlBA;IA3bHA;QAACA,eAAMA,CAACA;YACNA,IAAIA,EAAEA,UAAUA;YAChBA,MAAMA,EAAEA,yBAAyBA;YACjCA,SAASA,EAAEA,kBAAkBA;SAC9BA,CAACA;iBAwbDA;IAADA,eAACA;AAADA,CAACA,AA5bD,IA4bC;AAvbY,gBAAQ,WAubpB,CAAA"} \ No newline at end of file +{"version":3,"file":"calendar.js","sourceRoot":"","sources":["../../src/plugins/calendar.ts"],"names":["Calendar","Calendar.constructor","Calendar.createCalendar","Calendar.deleteCalendar","Calendar.getCalendarOptions","Calendar.createEvent","Calendar.createEventWithOptions","Calendar.createEventInteractively","Calendar.createEventInteractivelyWithOptions","Calendar.findEvent","Calendar.findEventWithOptions","Calendar.listEventsInRange","Calendar.listCalendars","Calendar.findAllEventsInNamedCalendar","Calendar.modifyEvent","Calendar.modifyEventWithOptions","Calendar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;IAiBDA;QAACA,gBAAOA,EAAEA;OACHA,uBAAWA,QAkBjBA;IAkBAA;QAACA,gBAAOA,EAAEA;OACHA,kCAAsBA,QAmB5BA;IAYFA;QAACA,gBAAOA,EAAEA;OACHA,uBAAWA,QAajBA;IAaFA;QAACA,gBAAOA,EAAEA;OACHA,wCAA4BA,QAclCA;IAMAA;QAACA,gBAAOA,EAAEA;OACHA,wBAAYA,QAOlBA;IAvbHA;QAACA,eAAMA,CAACA;YACNA,IAAIA,EAAEA,UAAUA;YAChBA,MAAMA,EAAEA,yBAAyBA;YACjCA,SAASA,EAAEA,kBAAkBA;SAC9BA,CAACA;iBAobDA;IAADA,eAACA;AAADA,CAACA,AAxbD,IAwbC;AAnbY,gBAAQ,WAmbpB,CAAA"} \ No newline at end of file diff --git a/dist/plugins/contacts.js b/dist/plugins/contacts.js index fdabbf482..7ff94998c 100644 --- a/dist/plugins/contacts.js +++ b/dist/plugins/contacts.js @@ -53,6 +53,11 @@ var Contacts = (function () { * @return Returns a Promise that resolves with the search results (an array of Contact objects) */ Contacts.find = function (fields, options) { + // This Promise is replaced by one from the @Cordova decorator that wraps + // the plugin's callbacks. We provide a dummy one here so TypeScript + // knows that the correct return type is Promise, because there's no way + // for it to know the return type from a decorator. + // See https://github.com/Microsoft/TypeScript/issues/4881 return new Promise(function (res, rej) { }); }; ; @@ -61,6 +66,11 @@ var Contacts = (function () { * @return Returns a Promise that resolves with the selected Contact */ Contacts.pickContact = function () { + // This Promise is replaced by one from the @Cordova decorator that wraps + // the plugin's callbacks. We provide a dummy one here so TypeScript + // knows that the correct return type is Promise, because there's no way + // for it to know the return type from a decorator. + // See https://github.com/Microsoft/TypeScript/issues/4881 return new Promise(function (res, rej) { }); }; ; diff --git a/dist/plugins/contacts.js.map b/dist/plugins/contacts.js.map index 4022148dd..df11034b1 100644 --- a/dist/plugins/contacts.js.map +++ b/dist/plugins/contacts.js.map @@ -1 +1 @@ -{"version":3,"file":"contacts.js","sourceRoot":"","sources":["../../src/plugins/contacts.ts"],"names":["Contacts","Contacts.constructor","Contacts.create","Contacts.find","Contacts.pickContact"],"mappings":";;;;;;AAAA,uBAA8B,UAAU,CAAC,CAAA;AA6LzC;;;;;;;;;;;;;;;;GAgBG;AACH;IAAAA;IAqDAC,CAACA;IA9CCD;;;;;OAKGA;IAIIA,eAAMA,GAHbA,UAGcA,OAA0BA;QACtCE,MAAMA,CAACA,IAAIA,OAAOA,EAAEA,CAACA;IACvBA,CAACA;;IAEDF;;;;;;;;;;;;;;;;OAgBGA;IAKIA,aAAIA,GAJXA,UAIYA,MAAgBA,EAAEA,OAAaA;QACzCG,MAAMA,CAACA,IAAIA,OAAOA,CAAYA,UAACA,GAAGA,EAAEA,GAAGA,IAAMA,CAACA,CAACA,CAACA;IAClDA,CAACA;;IAEDH;;;OAGGA;IAEIA,oBAAWA,GADlBA;QAEEI,MAAMA,CAACA,IAAIA,OAAOA,CAAUA,UAACA,GAAGA,EAAEA,GAAGA,IAAMA,CAACA,CAACA,CAACA;IAChDA,CAACA;;IAvCDJ;QAACA,gBAAOA,CAACA;YACPA,IAAIA,EAAEA,IAAIA;SACXA,CAACA;OACKA,kBAAMA,QAEZA;IAmBDA;QAACA,gBAAOA,CAACA;YACPA,YAAYA,EAAEA,CAACA;YACfA,UAAUA,EAAEA,CAACA;SACdA,CAACA;OACKA,gBAAIA,QAEVA;IAMDA;QAACA,gBAAOA,EAAEA;OACHA,uBAAWA,QAEjBA;IApDHA;QAACA,eAAMA,CAACA;YACNA,IAAIA,EAAEA,UAAUA;YAChBA,MAAMA,EAAEA,yBAAyBA;YACjCA,SAASA,EAAEA,oBAAoBA;YAC/BA,IAAIA,EAAEA,mDAAmDA;SAC1DA,CAACA;iBAgDDA;IAADA,eAACA;AAADA,CAACA,AArDD,IAqDC;AA/CY,gBAAQ,WA+CpB,CAAA"} \ No newline at end of file +{"version":3,"file":"contacts.js","sourceRoot":"","sources":["../../src/plugins/contacts.ts"],"names":["Contacts","Contacts.constructor","Contacts.create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C;AAzDY,gBAAQ,WAyDpB,CAAA"} \ No newline at end of file diff --git a/dist/plugins/device.js.map b/dist/plugins/device.js.map index 4b18c7630..1594efb31 100644 --- a/dist/plugins/device.js.map +++ b/dist/plugins/device.js.map @@ -1 +1 @@ -{"version":3,"file":"device.js","sourceRoot":"","sources":["../../src/plugins/device.ts"],"names":["Device","Device.constructor","Device.getDevice"],"mappings":";;;;;;AAAA,uBAAqC,UAAU,CAAC,CAAA;AAKhD;;;;;;;;GAQG;AAEH;IAAAA;IAgBAC,CAACA;IATDD;;;;OAIGA;IAEMA,gBAASA,GADhBA;QAEEE,MAAMA,CAACA,MAAMA,CAACA,MAAMA,CAACA;IACvBA,CAACA;IAHDF;QAACA,uBAAcA;OACRA,mBAASA,QAEfA;IAfHA;QAACA,eAAMA,CAACA;YACNA,IAAIA,EAAEA,QAAQA;YACdA,MAAMA,EAAEA,uBAAuBA;YAC/BA,SAASA,EAAEA,QAAQA;SACpBA,CAACA;eAYDA;IAADA,aAACA;AAADA,CAACA,AAhBD,IAgBC;AAXY,cAAM,SAWlB,CAAA"} \ No newline at end of file +{"version":3,"file":"device.js","sourceRoot":"","sources":["../../src/plugins/device.ts"],"names":["Device","Device.constructor","Device.getDevice"],"mappings":";;;;;;AAAA,uBAAqC,UAAU,CAAC,CAAA;AAKhD;;;;;;;;GAQG;AACH;IAAAA;IAgBAC,CAACA;IATDD;;;;OAIGA;IAEMA,gBAASA,GADhBA;QAEEE,MAAMA,CAACA,MAAMA,CAACA,MAAMA,CAACA;IACvBA,CAACA;IAHDF;QAACA,uBAAcA;OACRA,mBAASA,QAEfA;IAfHA;QAACA,eAAMA,CAACA;YACNA,IAAIA,EAAEA,QAAQA;YACdA,MAAMA,EAAEA,uBAAuBA;YAC/BA,SAASA,EAAEA,QAAQA;SACpBA,CAACA;eAYDA;IAADA,aAACA;AAADA,CAACA,AAhBD,IAgBC;AAXY,cAAM,SAWlB,CAAA"} \ No newline at end of file diff --git a/dist/plugins/facebook.d.ts b/dist/plugins/facebook.d.ts index d6b641bb2..059abe735 100644 --- a/dist/plugins/facebook.d.ts +++ b/dist/plugins/facebook.d.ts @@ -1,11 +1,198 @@ +/** + * Use the Facebook Connect plugin to obtain access to the native FB application on iOS and Android. + * + * Requires Cordova plugin: `cordova-plugin-facebook4`. For more info, please see the [Facebook Connect](https://github.com/jeduan/cordova-plugin-facebook4). + * + * #### Installation + * + * To use the FB plugin, you first have to create a new Facebook App inside of the Facebook developer portal at [https://developers.facebook.com/apps](https://developers.facebook.com/apps). + * + * [![fb-getstarted-1](/img/docs/native/Facebook/1.png)](https://developers.facebook.com/apps/) + * + * Retrieve the `App ID` and `App Name`. + * + * [![fb-getstarted-2](/img/docs/native/Facebook/2.png)](https://developers.facebook.com/apps/) + * + * Then type in the following command in your Terminal, where APP_ID and APP_NAME are the values from the Facebook Developer portal. + * + * ```bash + * cordova plugin add cordova-plugin-facebook4 --save --variable APP_ID="123456789" --variable APP_NAME="myApplication" + * ``` + * + * After, you'll need to add the native platforms you'll be using to your app in the Facebook Developer portal under your app's Settings: + * + * [![fb-getstarted-3](/img/docs/native/Facebook/3.png)](https://developers.facebook.com/apps/) + * + * Click `'Add Platform'`. + * + * [![fb-getstarted-4](/img/docs/native/Facebook/4.png)](https://developers.facebook.com/apps/) + * + * At this point you'll need to open your project's [`config.xml`](https://cordova.apache.org/docs/en/latest/config_ref/index.html) file, found in the root directory of your project. + * + * Take note of the `id` for the next step: + * ``` + * + * ``` + * + * You can also edit the `id` to whatever you'd like it to be. + * + * #### iOS Install + * Under 'Bundle ID', add the `id` from your `config.xml` file: + * + * [![fb-getstarted-5](/img/docs/native/Facebook/5.png)](https://developers.facebook.com/apps/) + * + * + * #### Android Install + * Under 'Google Play Package Name', add the `id` from your `config.xml` file: + * + * [![fb-getstarted-6](/img/docs/native/Facebook/6.png)](https://developers.facebook.com/apps/) + * + * + * And that's it! You can now make calls to Facebook using the plugin. + * + * ## Events + * + * App events allow you to understand the makeup of users engaging with your app, measure the performance of your Facebook mobile app ads, and reach specific sets of your users with Facebook mobile app ads. + * + * - [iOS] [https://developers.facebook.com/docs/ios/app-events](https://developers.facebook.com/docs/ios/app-events) + * - [Android] [https://developers.facebook.com/docs/android/app-events](https://developers.facebook.com/docs/android/app-events) + * - [JS] Does not have an Events API, so the plugin functions are empty and will return an automatic success + * + * Activation events are automatically tracked for you in the plugin. + * + * Events are listed on the [insights page](https://www.facebook.com/insights/). + * + * For tracking events, see `logEvent` and `logPurchase`. + * + */ export declare class Facebook { - static login(permissions: string[]): void; - static logout(): void; - static getLoginStatus(): void; - static getAccessToken(): void; - static showDialog(options: any): void; - static api(requestPath: string, permissions: string[]): void; - static logEvent(name: string, params: any, valueToSum: number): void; - static logPurchase(value: number, currency: string): void; - static appInvite(options: any): void; + /** + * Login to Facebook to authenticate this app. + * + * ``` + * { + * status: "connected", + * authResponse: { + * session_key: true, + * accessToken: "kgkh3g42kh4g23kh4g2kh34g2kg4k2h4gkh3g4k2h4gk23h4gk2h34gk234gk2h34AndSoOn", + * expiresIn: 5183979, + * sig: "...", + * secret: "...", + * userID: "634565435" + * } + * } + * ``` + * + * @param {string[]} permissions List of [permissions](https://developers.facebook.com/docs/facebook-login/permissions) this app has upon logging in. + * @return Returns a Promise that resolves with a status object if login succeeds, and rejects if login fails. + */ + static login(permissions: string[]): Promise; + /** + * Logout of Facebook. + * + * For more info see the [Facebook docs](https://developers.facebook.com/docs/reference/javascript/FB.logout) + * @return Returns a Promise that resolves on a successful logout, and rejects if logout fails. + */ + static logout(): Promise; + /** + * Determine if a user is logged in to Facebook and has authenticated your app. There are three possible states for a user: + * + * 1) the user is logged into Facebook and has authenticated your application (connected) + * 2) the user is logged into Facebook but has not authenticated your application (not_authorized) + * 3) the user is either not logged into Facebook or explicitly logged out of your application so it doesn't attempt to connect to Facebook and thus, we don't know if they've authenticated your application or not (unknown) + * + * Resolves with a response like: + * + * ``` + * { + * authResponse: { + * userID: "12345678912345", + * accessToken: "kgkh3g42kh4g23kh4g2kh34g2kg4k2h4gkh3g4k2h4gk23h4gk2h34gk234gk2h34AndSoOn", + * session_Key: true, + * expiresIn: "5183738", + * sig: "..." + * }, + * status: "connected" + * } + * ``` + * + * For more information see the [Facebook docs](https://developers.facebook.com/docs/reference/javascript/FB.getLoginStatus) + * + * @return Returns a Promise that resolves with a status, or rejects with an error + */ + static getLoginStatus(): Promise; + /** + * Get a Facebook access token for using Facebook services. + * + * @return Returns a Promise that resolves with an access token, or rejects with an error + */ + static getAccessToken(): Promise; + /** + * Show one of various Facebook dialogs. Example of options for a Share dialog: + * + * ``` + * { + * method: "share", + * href: "http://example.com", + * caption: "Such caption, very feed.", + * description: "Much description", + * picture: 'http://example.com/image.png' + * } + * ``` + * + * For more options see the [Cordova plugin docs](https://github.com/jeduan/cordova-plugin-facebook4#show-a-dialog) and the [Facebook docs](https://developers.facebook.com/docs/javascript/reference/FB.ui) + * @options {Object} options The dialog options + * @return Returns a Promise that resolves with success data, or rejects with an error + */ + static showDialog(options: any): Promise; + /** + * Make a call to Facebook Graph API. Can take additional permissions beyond those granted on login. + * + * For more information see: + * + * Calling the Graph API - https://developers.facebook.com/docs/javascript/reference/FB.api + * Graph Explorer - https://developers.facebook.com/tools/explorer + * Graph API - https://developers.facebook.com/docs/graph-api + * + * @param {string} requestPath Graph API endpoint you want to call + * @param {string[]} permissions List of [permissions](https://developers.facebook.com/docs/facebook-login/permissions) for this request. + * @return Returns a Promise that resolves with the result of the request, or rejects with an error + */ + static api(requestPath: string, permissions: string[]): Promise; + /** + * Log an event. For more information see the Events section above. + * + * @param {string} name Name of the event + * @param {Object} [params] An object containing extra data to log with the event + * @param {number} [valueToSum] any value to be added to added to a sum on each event + * @return + */ + static logEvent(name: string, params?: Object, valueToSum?: number): Promise; + /** + * Log a purchase. For more information see the Events section above. + * + * @param {number} value Value of the purchase. + * @param {string} currency The currency, as an [ISO 4217 currency code](http://en.wikipedia.org/wiki/ISO_4217) + * @return Returns a Promise + */ + static logPurchase(value: number, currency: string): Promise; + /** + * Open App Invite dialog. Does not require login. + * + * For more information see: + * + * the App Invites Overview - https://developers.facebook.com/docs/app-invites/overview + * the App Links docs - https://developers.facebook.com/docs/applinks + * + * + * @param {Object} options An object containing an [App Link](https://developers.facebook.com/docs/applinks) URL to your app and an optional image URL. + * url: [App Link](https://developers.facebook.com/docs/applinks) to your app + * picture: image to be displayed in the App Invite dialog + * + * @return Returns a Promise that resolves with the result data, or rejects with an error + */ + static appInvite(options: { + url: string; + picture: string; + }): Promise; } diff --git a/dist/plugins/facebook.js b/dist/plugins/facebook.js index 25682951f..cad618dcf 100644 --- a/dist/plugins/facebook.js +++ b/dist/plugins/facebook.js @@ -5,18 +5,269 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, return c > 3 && r && Object.defineProperty(target, key, r), r; }; var plugin_1 = require('./plugin'); +/** + * Use the Facebook Connect plugin to obtain access to the native FB application on iOS and Android. + * + * Requires Cordova plugin: `cordova-plugin-facebook4`. For more info, please see the [Facebook Connect](https://github.com/jeduan/cordova-plugin-facebook4). + * + * #### Installation + * + * To use the FB plugin, you first have to create a new Facebook App inside of the Facebook developer portal at [https://developers.facebook.com/apps](https://developers.facebook.com/apps). + * + * [![fb-getstarted-1](/img/docs/native/Facebook/1.png)](https://developers.facebook.com/apps/) + * + * Retrieve the `App ID` and `App Name`. + * + * [![fb-getstarted-2](/img/docs/native/Facebook/2.png)](https://developers.facebook.com/apps/) + * + * Then type in the following command in your Terminal, where APP_ID and APP_NAME are the values from the Facebook Developer portal. + * + * ```bash + * cordova plugin add cordova-plugin-facebook4 --save --variable APP_ID="123456789" --variable APP_NAME="myApplication" + * ``` + * + * After, you'll need to add the native platforms you'll be using to your app in the Facebook Developer portal under your app's Settings: + * + * [![fb-getstarted-3](/img/docs/native/Facebook/3.png)](https://developers.facebook.com/apps/) + * + * Click `'Add Platform'`. + * + * [![fb-getstarted-4](/img/docs/native/Facebook/4.png)](https://developers.facebook.com/apps/) + * + * At this point you'll need to open your project's [`config.xml`](https://cordova.apache.org/docs/en/latest/config_ref/index.html) file, found in the root directory of your project. + * + * Take note of the `id` for the next step: + * ``` + * + * ``` + * + * You can also edit the `id` to whatever you'd like it to be. + * + * #### iOS Install + * Under 'Bundle ID', add the `id` from your `config.xml` file: + * + * [![fb-getstarted-5](/img/docs/native/Facebook/5.png)](https://developers.facebook.com/apps/) + * + * + * #### Android Install + * Under 'Google Play Package Name', add the `id` from your `config.xml` file: + * + * [![fb-getstarted-6](/img/docs/native/Facebook/6.png)](https://developers.facebook.com/apps/) + * + * + * And that's it! You can now make calls to Facebook using the plugin. + * + * ## Events + * + * App events allow you to understand the makeup of users engaging with your app, measure the performance of your Facebook mobile app ads, and reach specific sets of your users with Facebook mobile app ads. + * + * - [iOS] [https://developers.facebook.com/docs/ios/app-events](https://developers.facebook.com/docs/ios/app-events) + * - [Android] [https://developers.facebook.com/docs/android/app-events](https://developers.facebook.com/docs/android/app-events) + * - [JS] Does not have an Events API, so the plugin functions are empty and will return an automatic success + * + * Activation events are automatically tracked for you in the plugin. + * + * Events are listed on the [insights page](https://www.facebook.com/insights/). + * + * For tracking events, see `logEvent` and `logPurchase`. + * + */ var Facebook = (function () { function Facebook() { } - Facebook.login = function (permissions) { }; - Facebook.logout = function () { }; - Facebook.getLoginStatus = function () { }; - Facebook.getAccessToken = function () { }; - Facebook.showDialog = function (options) { }; - Facebook.api = function (requestPath, permissions) { }; - Facebook.logEvent = function (name, params, valueToSum) { }; - Facebook.logPurchase = function (value, currency) { }; - Facebook.appInvite = function (options) { }; + // @Cordova() + // static browserInit(appId: number){ + // return new Promise((res, rej) => {}); + // } + /** + * Login to Facebook to authenticate this app. + * + * ``` + * { + * status: "connected", + * authResponse: { + * session_key: true, + * accessToken: "kgkh3g42kh4g23kh4g2kh34g2kg4k2h4gkh3g4k2h4gk23h4gk2h34gk234gk2h34AndSoOn", + * expiresIn: 5183979, + * sig: "...", + * secret: "...", + * userID: "634565435" + * } + * } + * ``` + * + * @param {string[]} permissions List of [permissions](https://developers.facebook.com/docs/facebook-login/permissions) this app has upon logging in. + * @return Returns a Promise that resolves with a status object if login succeeds, and rejects if login fails. + */ + Facebook.login = function (permissions) { + // This Promise is replaced by one from the @Cordova decorator that wraps + // the plugin's callbacks. We provide a dummy one here so TypeScript + // knows that the correct return type is Promise, because there's no way + // for it to know the return type from a decorator. + // See https://github.com/Microsoft/TypeScript/issues/4881 + return new Promise(function (res, rej) { }); + }; + /** + * Logout of Facebook. + * + * For more info see the [Facebook docs](https://developers.facebook.com/docs/reference/javascript/FB.logout) + * @return Returns a Promise that resolves on a successful logout, and rejects if logout fails. + */ + Facebook.logout = function () { + // This Promise is replaced by one from the @Cordova decorator that wraps + // the plugin's callbacks. We provide a dummy one here so TypeScript + // knows that the correct return type is Promise, because there's no way + // for it to know the return type from a decorator. + // See https://github.com/Microsoft/TypeScript/issues/4881 + return new Promise(function (res, rej) { }); + }; + /** + * Determine if a user is logged in to Facebook and has authenticated your app. There are three possible states for a user: + * + * 1) the user is logged into Facebook and has authenticated your application (connected) + * 2) the user is logged into Facebook but has not authenticated your application (not_authorized) + * 3) the user is either not logged into Facebook or explicitly logged out of your application so it doesn't attempt to connect to Facebook and thus, we don't know if they've authenticated your application or not (unknown) + * + * Resolves with a response like: + * + * ``` + * { + * authResponse: { + * userID: "12345678912345", + * accessToken: "kgkh3g42kh4g23kh4g2kh34g2kg4k2h4gkh3g4k2h4gk23h4gk2h34gk234gk2h34AndSoOn", + * session_Key: true, + * expiresIn: "5183738", + * sig: "..." + * }, + * status: "connected" + * } + * ``` + * + * For more information see the [Facebook docs](https://developers.facebook.com/docs/reference/javascript/FB.getLoginStatus) + * + * @return Returns a Promise that resolves with a status, or rejects with an error + */ + Facebook.getLoginStatus = function () { + // This Promise is replaced by one from the @Cordova decorator that wraps + // the plugin's callbacks. We provide a dummy one here so TypeScript + // knows that the correct return type is Promise, because there's no way + // for it to know the return type from a decorator. + // See https://github.com/Microsoft/TypeScript/issues/4881 + return new Promise(function (res, rej) { }); + }; + /** + * Get a Facebook access token for using Facebook services. + * + * @return Returns a Promise that resolves with an access token, or rejects with an error + */ + Facebook.getAccessToken = function () { + // This Promise is replaced by one from the @Cordova decorator that wraps + // the plugin's callbacks. We provide a dummy one here so TypeScript + // knows that the correct return type is Promise, because there's no way + // for it to know the return type from a decorator. + // See https://github.com/Microsoft/TypeScript/issues/4881 + return new Promise(function (res, rej) { }); + }; + /** + * Show one of various Facebook dialogs. Example of options for a Share dialog: + * + * ``` + * { + * method: "share", + * href: "http://example.com", + * caption: "Such caption, very feed.", + * description: "Much description", + * picture: 'http://example.com/image.png' + * } + * ``` + * + * For more options see the [Cordova plugin docs](https://github.com/jeduan/cordova-plugin-facebook4#show-a-dialog) and the [Facebook docs](https://developers.facebook.com/docs/javascript/reference/FB.ui) + * @options {Object} options The dialog options + * @return Returns a Promise that resolves with success data, or rejects with an error + */ + Facebook.showDialog = function (options) { + // This Promise is replaced by one from the @Cordova decorator that wraps + // the plugin's callbacks. We provide a dummy one here so TypeScript + // knows that the correct return type is Promise, because there's no way + // for it to know the return type from a decorator. + // See https://github.com/Microsoft/TypeScript/issues/4881 + return new Promise(function (res, rej) { }); + }; + /** + * Make a call to Facebook Graph API. Can take additional permissions beyond those granted on login. + * + * For more information see: + * + * Calling the Graph API - https://developers.facebook.com/docs/javascript/reference/FB.api + * Graph Explorer - https://developers.facebook.com/tools/explorer + * Graph API - https://developers.facebook.com/docs/graph-api + * + * @param {string} requestPath Graph API endpoint you want to call + * @param {string[]} permissions List of [permissions](https://developers.facebook.com/docs/facebook-login/permissions) for this request. + * @return Returns a Promise that resolves with the result of the request, or rejects with an error + */ + Facebook.api = function (requestPath, permissions) { + // This Promise is replaced by one from the @Cordova decorator that wraps + // the plugin's callbacks. We provide a dummy one here so TypeScript + // knows that the correct return type is Promise, because there's no way + // for it to know the return type from a decorator. + // See https://github.com/Microsoft/TypeScript/issues/4881 + return new Promise(function (res, rej) { }); + }; + /** + * Log an event. For more information see the Events section above. + * + * @param {string} name Name of the event + * @param {Object} [params] An object containing extra data to log with the event + * @param {number} [valueToSum] any value to be added to added to a sum on each event + * @return + */ + Facebook.logEvent = function (name, params, valueToSum) { + // This Promise is replaced by one from the @Cordova decorator that wraps + // the plugin's callbacks. We provide a dummy one here so TypeScript + // knows that the correct return type is Promise, because there's no way + // for it to know the return type from a decorator. + // See https://github.com/Microsoft/TypeScript/issues/4881 + return new Promise(function (res, rej) { }); + }; + /** + * Log a purchase. For more information see the Events section above. + * + * @param {number} value Value of the purchase. + * @param {string} currency The currency, as an [ISO 4217 currency code](http://en.wikipedia.org/wiki/ISO_4217) + * @return Returns a Promise + */ + Facebook.logPurchase = function (value, currency) { + // This Promise is replaced by one from the @Cordova decorator that wraps + // the plugin's callbacks. We provide a dummy one here so TypeScript + // knows that the correct return type is Promise, because there's no way + // for it to know the return type from a decorator. + // See https://github.com/Microsoft/TypeScript/issues/4881 + return new Promise(function (res, rej) { }); + }; + /** + * Open App Invite dialog. Does not require login. + * + * For more information see: + * + * the App Invites Overview - https://developers.facebook.com/docs/app-invites/overview + * the App Links docs - https://developers.facebook.com/docs/applinks + * + * + * @param {Object} options An object containing an [App Link](https://developers.facebook.com/docs/applinks) URL to your app and an optional image URL. + * url: [App Link](https://developers.facebook.com/docs/applinks) to your app + * picture: image to be displayed in the App Invite dialog + * + * @return Returns a Promise that resolves with the result data, or rejects with an error + */ + Facebook.appInvite = function (options) { + // This Promise is replaced by one from the @Cordova decorator that wraps + // the plugin's callbacks. We provide a dummy one here so TypeScript + // knows that the correct return type is Promise, because there's no way + // for it to know the return type from a decorator. + // See https://github.com/Microsoft/TypeScript/issues/4881 + return new Promise(function (res, rej) { }); + }; __decorate([ plugin_1.Cordova() ], Facebook, "login", null); diff --git a/dist/plugins/facebook.js.map b/dist/plugins/facebook.js.map index 16d884b56..94975e961 100644 --- a/dist/plugins/facebook.js.map +++ b/dist/plugins/facebook.js.map @@ -1 +1 @@ -{"version":3,"file":"facebook.js","sourceRoot":"","sources":["../../src/plugins/facebook.ts"],"names":["Facebook","Facebook.constructor","Facebook.login","Facebook.logout","Facebook.getLoginStatus","Facebook.getAccessToken","Facebook.showDialog","Facebook.api","Facebook.logEvent","Facebook.logPurchase","Facebook.appInvite"],"mappings":";;;;;;AAAA,uBAA8B,UAAU,CAAC,CAAA;AAEzC;IAAAA;IAgCAC,CAACA;IAzBQD,cAAKA,GADZA,UACaA,WAAoBA,IAAEE,CAACA;IAG7BF,eAAMA,GADbA,cACgBG,CAACA;IAGVH,uBAAcA,GADrBA,cACwBI,CAACA;IAGlBJ,uBAAcA,GADrBA,cACwBK,CAACA;IAGlBL,mBAAUA,GADjBA,UACkBA,OAAWA,IAAEM,CAACA;IAGzBN,YAAGA,GADVA,UACWA,WAAkBA,EAAEA,WAAoBA,IAAEO,CAACA;IAG/CP,iBAAQA,GADfA,UACgBA,IAAWA,EAAEA,MAAUA,EAAEA,UAAiBA,IAAEQ,CAACA;IAGtDR,oBAAWA,GADlBA,UACmBA,KAAYA,EAAEA,QAAeA,IAAES,CAACA;IAG5CT,kBAASA,GADhBA,UACiBA,OAAWA,IAAEU,CAACA;IAzB/BV;QAACA,gBAAOA,EAAEA;OACHA,iBAAKA,QAAwBA;IAEpCA;QAACA,gBAAOA,EAAEA;OACHA,kBAAMA,QAAIA;IAEjBA;QAACA,gBAAOA,EAAEA;OACHA,0BAAcA,QAAIA;IAEzBA;QAACA,gBAAOA,EAAEA;OACHA,0BAAcA,QAAIA;IAEzBA;QAACA,gBAAOA,EAAEA;OACHA,sBAAUA,QAAeA;IAEhCA;QAACA,gBAAOA,EAAEA;OACHA,eAAGA,QAA4CA;IAEtDA;QAACA,gBAAOA,EAAEA;OACHA,oBAAQA,QAA8CA;IAE7DA;QAACA,gBAAOA,EAAEA;OACHA,uBAAWA,QAAiCA;IAEnDA;QAACA,gBAAOA,EAAEA;OACHA,qBAASA,QAAeA;IA/BjCA;QAACA,eAAMA,CAACA;YACNA,IAAIA,EAAEA,UAAUA;YAChBA,MAAMA,EAAEA,0BAA0BA;YAClCA,SAASA,EAAEA,uBAAuBA;SACnCA,CAACA;iBA4BDA;IAADA,eAACA;AAADA,CAACA,AAhCD,IAgCC;AA3BY,gBAAQ,WA2BpB,CAAA"} \ No newline at end of file +{"version":3,"file":"facebook.js","sourceRoot":"","sources":["../../src/plugins/facebook.ts"],"names":["Facebook","Facebook.constructor","Facebook.login","Facebook.logout","Facebook.getLoginStatus","Facebook.getAccessToken","Facebook.showDialog","Facebook.api","Facebook.logEvent","Facebook.logPurchase","Facebook.appInvite"],"mappings":";;;;;;AAAA,uBAA8B,UAAU,CAAC,CAAA;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG;AACH;IAAAA;IA6NAC,CAACA;IAtNCD,aAAaA;IACbA,qCAAqCA;IACrCA,+CAA+CA;IAC/CA,IAAIA;IAEJA;;;;;;;;;;;;;;;;;;;OAmBGA;IAEIA,cAAKA,GADZA,UACaA,WAAqBA;QAChCE,yEAAyEA;QACzEA,oEAAoEA;QACpEA,wEAAwEA;QACxEA,mDAAmDA;QACnDA,0DAA0DA;QAC1DA,MAAMA,CAACA,IAAIA,OAAOA,CAAMA,UAACA,GAAGA,EAAEA,GAAGA,IAAMA,CAACA,CAACA,CAACA;IAC5CA,CAACA;IAEDF;;;;;OAKGA;IAEIA,eAAMA,GADbA;QAEEG,yEAAyEA;QACzEA,oEAAoEA;QACpEA,wEAAwEA;QACxEA,mDAAmDA;QACnDA,0DAA0DA;QAC1DA,MAAMA,CAACA,IAAIA,OAAOA,CAAMA,UAACA,GAAGA,EAAEA,GAAGA,IAAMA,CAACA,CAACA,CAACA;IAC5CA,CAACA;IAEDH;;;;;;;;;;;;;;;;;;;;;;;;;OAyBGA;IAEIA,uBAAcA,GADrBA;QAEEI,yEAAyEA;QACzEA,oEAAoEA;QACpEA,wEAAwEA;QACxEA,mDAAmDA;QACnDA,0DAA0DA;QAC1DA,MAAMA,CAACA,IAA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EA;QACzEA,oEAAoEA;QACpEA,wEAAwEA;QACxEA,mDAAmDA;QACnDA,0DAA0DA;QAC1DA,MAAMA,CAACA,IAAIA,OAAOA,CAAMA,UAACA,GAAGA,EAAEA,GAAGA,IAAMA,CAACA,CAACA,CAACA;IAC5CA,CAACA;IAEDT;;;;;;;;;;;;;;OAcGA;IAEIA,kBAASA,GADhBA,UACiBA,OAGhBA;QACCU,yEAAyEA;QACzEA,oEAAoEA;QACpEA,wEAAwEA;QACxEA,mDAAmDA;QACnDA,0DAA0DA;QAC1DA,MAAMA,CAACA,IAAIA,OAAOA,CAAMA,UAACA,GAAGA,EAAEA,GAAGA,IAAMA,CAACA,CAACA,CAACA;IAC5CA,CAACA;IA5LDV;QAACA,gBAAOA,EAAEA;OACHA,iBAAKA,QAOXA;IAQDA;QAACA,gBAAOA,EAAEA;OACHA,kBAAMA,QAOZA;IA4BDA;QAACA,gBAAOA,EAAEA;OACHA,0BAAcA,QAOpBA;IAODA;QAACA,gBAAOA,EAAEA;OACHA,0BAAcA,QAOpBA;IAmBDA;QAACA,gBAAOA,EAAEA;OACHA,sBAAUA,QAOhBA;IAeDA;QAACA,gBAAOA,EAAEA;OACHA,eAAGA,QAOTA;IAUDA;QAACA,gBAAOA,EAAEA;OACHA,oBAAQA,QAOdA;IASDA;QAACA,gBAAOA,EAAEA;OACHA,uBAAWA,QAOjBA;IAiBDA;QAACA,gBAAOA,EAAEA;OACHA,qBAASA,QAUfA;IA5NHA;QAACA,eAAMA,CAACA;YACNA,IAAIA,EAAEA,UAAUA;YAChBA,MAAMA,EAAEA,0BAA0BA;YAClCA,SAASA,EAAEA,uBAAuBA;SACnCA,CAACA;iBAyNDA;IAADA,eAACA;AAADA,CAACA,AA7ND,IA6NC;AAxNY,gBAAQ,WAwNpB,CAAA"} \ No newline at end of file diff --git a/src/plugins/contacts.ts b/src/plugins/contacts.ts index 68a257394..57e757f3f 100644 --- a/src/plugins/contacts.ts +++ b/src/plugins/contacts.ts @@ -246,6 +246,11 @@ export class Contacts { errorIndex: 2 }) static find(fields: string[], options?: any){ + // This Promise is replaced by one from the @Cordova decorator that wraps + // the plugin's callbacks. We provide a dummy one here so TypeScript + // knows that the correct return type is Promise, because there's no way + // for it to know the return type from a decorator. + // See https://github.com/Microsoft/TypeScript/issues/4881 return new Promise((res, rej) => {}); }; @@ -255,6 +260,11 @@ export class Contacts { */ @Cordova() static pickContact(){ + // This Promise is replaced by one from the @Cordova decorator that wraps + // the plugin's callbacks. We provide a dummy one here so TypeScript + // knows that the correct return type is Promise, because there's no way + // for it to know the return type from a decorator. + // See https://github.com/Microsoft/TypeScript/issues/4881 return new Promise((res, rej) => {}); }; } diff --git a/src/plugins/device.ts b/src/plugins/device.ts index b4974db77..48dfdb6a3 100644 --- a/src/plugins/device.ts +++ b/src/plugins/device.ts @@ -12,7 +12,6 @@ declare var window; * // Device sits below * ``` */ - @Plugin({ name: 'Device', plugin: 'cordova-plugin-device', diff --git a/src/plugins/facebook.ts b/src/plugins/facebook.ts index 1630ff5a5..ec745f6ab 100644 --- a/src/plugins/facebook.ts +++ b/src/plugins/facebook.ts @@ -1,35 +1,291 @@ import {Plugin, Cordova} from './plugin'; +/** + * Use the Facebook Connect plugin to obtain access to the native FB application on iOS and Android. + * + * Requires Cordova plugin: `cordova-plugin-facebook4`. For more info, please see the [Facebook Connect](https://github.com/jeduan/cordova-plugin-facebook4). + * + * #### Installation + * + * To use the FB plugin, you first have to create a new Facebook App inside of the Facebook developer portal at [https://developers.facebook.com/apps](https://developers.facebook.com/apps). + * + * [![fb-getstarted-1](/img/docs/native/Facebook/1.png)](https://developers.facebook.com/apps/) + * + * Retrieve the `App ID` and `App Name`. + * + * [![fb-getstarted-2](/img/docs/native/Facebook/2.png)](https://developers.facebook.com/apps/) + * + * Then type in the following command in your Terminal, where APP_ID and APP_NAME are the values from the Facebook Developer portal. + * + * ```bash + * cordova plugin add cordova-plugin-facebook4 --save --variable APP_ID="123456789" --variable APP_NAME="myApplication" + * ``` + * + * After, you'll need to add the native platforms you'll be using to your app in the Facebook Developer portal under your app's Settings: + * + * [![fb-getstarted-3](/img/docs/native/Facebook/3.png)](https://developers.facebook.com/apps/) + * + * Click `'Add Platform'`. + * + * [![fb-getstarted-4](/img/docs/native/Facebook/4.png)](https://developers.facebook.com/apps/) + * + * At this point you'll need to open your project's [`config.xml`](https://cordova.apache.org/docs/en/latest/config_ref/index.html) file, found in the root directory of your project. + * + * Take note of the `id` for the next step: + * ``` + * + * ``` + * + * You can also edit the `id` to whatever you'd like it to be. + * + * #### iOS Install + * Under 'Bundle ID', add the `id` from your `config.xml` file: + * + * [![fb-getstarted-5](/img/docs/native/Facebook/5.png)](https://developers.facebook.com/apps/) + * + * + * #### Android Install + * Under 'Google Play Package Name', add the `id` from your `config.xml` file: + * + * [![fb-getstarted-6](/img/docs/native/Facebook/6.png)](https://developers.facebook.com/apps/) + * + * + * And that's it! You can now make calls to Facebook using the plugin. + * + * ## Events + * + * App events allow you to understand the makeup of users engaging with your app, measure the performance of your Facebook mobile app ads, and reach specific sets of your users with Facebook mobile app ads. + * + * - [iOS] [https://developers.facebook.com/docs/ios/app-events](https://developers.facebook.com/docs/ios/app-events) + * - [Android] [https://developers.facebook.com/docs/android/app-events](https://developers.facebook.com/docs/android/app-events) + * - [JS] Does not have an Events API, so the plugin functions are empty and will return an automatic success + * + * Activation events are automatically tracked for you in the plugin. + * + * Events are listed on the [insights page](https://www.facebook.com/insights/). + * + * For tracking events, see `logEvent` and `logPurchase`. + * + */ @Plugin({ name: 'Facebook', plugin: 'cordova-plugin-facebook4', pluginRef: 'facebookConnectPlugin' }) export class Facebook { - @Cordova() - static login(permissions:string[]){} - @Cordova() - static logout(){} + // @Cordova() + // static browserInit(appId: number){ + // return new Promise((res, rej) => {}); + // } + /** + * Login to Facebook to authenticate this app. + * + * ``` + * { + * status: "connected", + * authResponse: { + * session_key: true, + * accessToken: "kgkh3g42kh4g23kh4g2kh34g2kg4k2h4gkh3g4k2h4gk23h4gk2h34gk234gk2h34AndSoOn", + * expiresIn: 5183979, + * sig: "...", + * secret: "...", + * userID: "634565435" + * } + * } + * ``` + * + * @param {string[]} permissions List of [permissions](https://developers.facebook.com/docs/facebook-login/permissions) this app has upon logging in. + * @return Returns a Promise that resolves with a status object if login succeeds, and rejects if login fails. + */ @Cordova() - static getLoginStatus(){} + static login(permissions: string[]){ + // This Promise is replaced by one from the @Cordova decorator that wraps + // the plugin's callbacks. We provide a dummy one here so TypeScript + // knows that the correct return type is Promise, because there's no way + // for it to know the return type from a decorator. + // See https://github.com/Microsoft/TypeScript/issues/4881 + return new Promise((res, rej) => {}); + } + /** + * Logout of Facebook. + * + * For more info see the [Facebook docs](https://developers.facebook.com/docs/reference/javascript/FB.logout) + * @return Returns a Promise that resolves on a successful logout, and rejects if logout fails. + */ @Cordova() - static getAccessToken(){} + static logout(){ + // This Promise is replaced by one from the @Cordova decorator that wraps + // the plugin's callbacks. We provide a dummy one here so TypeScript + // knows that the correct return type is Promise, because there's no way + // for it to know the return type from a decorator. + // See https://github.com/Microsoft/TypeScript/issues/4881 + return new Promise((res, rej) => {}); + } + /** + * Determine if a user is logged in to Facebook and has authenticated your app. There are three possible states for a user: + * + * 1) the user is logged into Facebook and has authenticated your application (connected) + * 2) the user is logged into Facebook but has not authenticated your application (not_authorized) + * 3) the user is either not logged into Facebook or explicitly logged out of your application so it doesn't attempt to connect to Facebook and thus, we don't know if they've authenticated your application or not (unknown) + * + * Resolves with a response like: + * + * ``` + * { + * authResponse: { + * userID: "12345678912345", + * accessToken: "kgkh3g42kh4g23kh4g2kh34g2kg4k2h4gkh3g4k2h4gk23h4gk2h34gk234gk2h34AndSoOn", + * session_Key: true, + * expiresIn: "5183738", + * sig: "..." + * }, + * status: "connected" + * } + * ``` + * + * For more information see the [Facebook docs](https://developers.facebook.com/docs/reference/javascript/FB.getLoginStatus) + * + * @return Returns a Promise that resolves with a status, or rejects with an error + */ @Cordova() - static showDialog(options:any){} + static getLoginStatus(){ + // This Promise is replaced by one from the @Cordova decorator that wraps + // the plugin's callbacks. We provide a dummy one here so TypeScript + // knows that the correct return type is Promise, because there's no way + // for it to know the return type from a decorator. + // See https://github.com/Microsoft/TypeScript/issues/4881 + return new Promise((res, rej) => {}); + } + /** + * Get a Facebook access token for using Facebook services. + * + * @return Returns a Promise that resolves with an access token, or rejects with an error + */ @Cordova() - static api(requestPath:string, permissions:string[]){} + static getAccessToken(){ + // This Promise is replaced by one from the @Cordova decorator that wraps + // the plugin's callbacks. We provide a dummy one here so TypeScript + // knows that the correct return type is Promise, because there's no way + // for it to know the return type from a decorator. + // See https://github.com/Microsoft/TypeScript/issues/4881 + return new Promise((res, rej) => {}); + } + /** + * Show one of various Facebook dialogs. Example of options for a Share dialog: + * + * ``` + * { + * method: "share", + * href: "http://example.com", + * caption: "Such caption, very feed.", + * description: "Much description", + * picture: 'http://example.com/image.png' + * } + * ``` + * + * For more options see the [Cordova plugin docs](https://github.com/jeduan/cordova-plugin-facebook4#show-a-dialog) and the [Facebook docs](https://developers.facebook.com/docs/javascript/reference/FB.ui) + * @options {Object} options The dialog options + * @return Returns a Promise that resolves with success data, or rejects with an error + */ @Cordova() - static logEvent(name:string, params:any, valueToSum:number){} + static showDialog(options: any){ + // This Promise is replaced by one from the @Cordova decorator that wraps + // the plugin's callbacks. We provide a dummy one here so TypeScript + // knows that the correct return type is Promise, because there's no way + // for it to know the return type from a decorator. + // See https://github.com/Microsoft/TypeScript/issues/4881 + return new Promise((res, rej) => {}); + } + /** + * Make a call to Facebook Graph API. Can take additional permissions beyond those granted on login. + * + * For more information see: + * + * Calling the Graph API - https://developers.facebook.com/docs/javascript/reference/FB.api + * Graph Explorer - https://developers.facebook.com/tools/explorer + * Graph API - https://developers.facebook.com/docs/graph-api + * + * @param {string} requestPath Graph API endpoint you want to call + * @param {string[]} permissions List of [permissions](https://developers.facebook.com/docs/facebook-login/permissions) for this request. + * @return Returns a Promise that resolves with the result of the request, or rejects with an error + */ @Cordova() - static logPurchase(value:number, currency:string){} + static api(requestPath: string, permissions: string[]){ + // This Promise is replaced by one from the @Cordova decorator that wraps + // the plugin's callbacks. We provide a dummy one here so TypeScript + // knows that the correct return type is Promise, because there's no way + // for it to know the return type from a decorator. + // See https://github.com/Microsoft/TypeScript/issues/4881 + return new Promise((res, rej) => {}); + } + /** + * Log an event. For more information see the Events section above. + * + * @param {string} name Name of the event + * @param {Object} [params] An object containing extra data to log with the event + * @param {number} [valueToSum] any value to be added to added to a sum on each event + * @return + */ @Cordova() - static appInvite(options:any){} + static logEvent(name: string, params?: Object, valueToSum?: number){ + // This Promise is replaced by one from the @Cordova decorator that wraps + // the plugin's callbacks. We provide a dummy one here so TypeScript + // knows that the correct return type is Promise, because there's no way + // for it to know the return type from a decorator. + // See https://github.com/Microsoft/TypeScript/issues/4881 + return new Promise((res, rej) => {}); + } + + /** + * Log a purchase. For more information see the Events section above. + * + * @param {number} value Value of the purchase. + * @param {string} currency The currency, as an [ISO 4217 currency code](http://en.wikipedia.org/wiki/ISO_4217) + * @return Returns a Promise + */ + @Cordova() + static logPurchase(value: number, currency: string){ + // This Promise is replaced by one from the @Cordova decorator that wraps + // the plugin's callbacks. We provide a dummy one here so TypeScript + // knows that the correct return type is Promise, because there's no way + // for it to know the return type from a decorator. + // See https://github.com/Microsoft/TypeScript/issues/4881 + return new Promise((res, rej) => {}); + } + + /** + * Open App Invite dialog. Does not require login. + * + * For more information see: + * + * the App Invites Overview - https://developers.facebook.com/docs/app-invites/overview + * the App Links docs - https://developers.facebook.com/docs/applinks + * + * + * @param {Object} options An object containing an [App Link](https://developers.facebook.com/docs/applinks) URL to your app and an optional image URL. + * url: [App Link](https://developers.facebook.com/docs/applinks) to your app + * picture: image to be displayed in the App Invite dialog + * + * @return Returns a Promise that resolves with the result data, or rejects with an error + */ + @Cordova() + static appInvite(options: { + url: string, + picture: string + }){ + // This Promise is replaced by one from the @Cordova decorator that wraps + // the plugin's callbacks. We provide a dummy one here so TypeScript + // knows that the correct return type is Promise, because there's no way + // for it to know the return type from a decorator. + // See https://github.com/Microsoft/TypeScript/issues/4881 + return new Promise((res, rej) => {}); + } }