From 826f8085a45c39eb2c43d60bd98d34ff5619ce82 Mon Sep 17 00:00:00 2001 From: Noah Cooper Date: Tue, 11 May 2021 02:05:45 -0400 Subject: [PATCH] feat(facebook): add new methods (#3654) * Add new methods * Update reauthorizeDataAccess response type --- src/@ionic-native/plugins/facebook/index.ts | 84 +++++++++++++++++++++ 1 file changed, 84 insertions(+) diff --git a/src/@ionic-native/plugins/facebook/index.ts b/src/@ionic-native/plugins/facebook/index.ts index 18d36ec878..788284eba0 100644 --- a/src/@ionic-native/plugins/facebook/index.ts +++ b/src/@ionic-native/plugins/facebook/index.ts @@ -178,6 +178,60 @@ export class Facebook extends IonicNativePlugin { return; } + /** + * Login to Facebook using Limited Login (iOS Only) + * + * ```typescript + * { + * status: 'connected', + * authResponse: { + * authenticationToken: 'kgkh3g42kh4g23kh4g2kh34g2kg4k2h4gkh3g4k2h4gk23h4gk2h34gk234gk2h34AndSoOn', + * nonce: 'foo', + * userID: '634565435' + * } + * } + * + * ``` + * + * @param {string[]} permissions List of [permissions](https://developers.facebook.com/docs/facebook-login/limited-login/permissions) this app has upon logging in. + * @returns {Promise} Returns a Promise that resolves with a status object if login succeeds, and rejects if login fails. + */ + @Cordova() + loginWithLimitedTracking(permissions: string[]): Promise { + return; + } + + /** + * Check if the user has approved all necessary permissions + * + * @param {string[]} permissions List of [permissions](https://developers.facebook.com/docs/facebook-login/permissions) to check for + * @returns {Promise} Returns a Promise that resolves with a success string if all passed permissions are granted, or an error string if any permissions are not granted + */ + @Cordova() + checkHasCorrectPermissions(permissions: string[]): Promise { + return; + } + + /** + * Check if data access has expired for the user + * + * @returns {Promise} Returns a Promise that resolves with a success string if data access is expired, or rejects with an error + */ + @Cordova() + isDataAccessExpired(): Promise { + return; + } + + /** + * Reauthorize data access after it has expired + * + * @returns {Promise} Returns a Promise that resolves with a status object if login succeeds, and rejects if login fails. + */ + @Cordova() + reauthorizeDataAccess(): Promise { + return; + } + /** * Logout of Facebook. * @@ -230,6 +284,16 @@ export class Facebook extends IonicNativePlugin { return; } + /** + * Get profile information for the currently logged in user + * + * @returns {Promise} Returns a Promise that resolves with success data, or rejects with an error + */ + @Cordova() + getCurrentProfile(): Promise { + return; + } + /** * Show one of various Facebook dialogs. Example of options for a Share dialog: * @@ -300,6 +364,26 @@ export class Facebook extends IonicNativePlugin { return; } + /** + * Enable or disable collection of advertiser-id + * + * @param {boolean} enabled value to be set + */ + @Cordova() + setAdvertiserIDCollectionEnabled(enabled: boolean): Promise { + return; + } + + /** + * Enable or disable advertiser tracking (iOS Only) + * + * @param {boolean} enabled value to be set + */ + @Cordova() + setAdvertiserTrackingEnabled(enabled: boolean): Promise { + return; + } + /** * Log a purchase. For more information see the Events section above. *