fix(facebook/fbsdk): add nonce parameter to loginWithLimitedTracking (#4906)

This commit is contained in:
Henry Zhang 2025-03-11 04:20:26 +11:00 committed by GitHub
parent 0c05b33a1d
commit 562489a97e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 30 additions and 4 deletions

View File

@ -15,6 +15,18 @@ export interface FacebookLoginResponse {
};
}
export interface FacebookLimitedLoginResponse {
status: string;
authResponse: {
authenticationToken: string;
nonce: string;
userID: string;
};
}
/**
* @name Facebook
* @description
@ -226,10 +238,11 @@ export class Facebook extends AwesomeCordovaNativePlugin {
* ```
*
* @param {string[]} permissions List of [permissions](https://developers.facebook.com/docs/facebook-login/limited-login/permissions) this app has upon logging in.
* @returns {Promise<FacebookLoginResponse>} Returns a Promise that resolves with a status object if login succeeds, and rejects if login fails.
* @param {string} nonce Nonce to create the configuration with.
* @returns {Promise<FacebookLimitedLoginResponse>} Returns a Promise that resolves with a status object if login succeeds, and rejects if login fails.
*/
@Cordova()
loginWithLimitedTracking(permissions: string[]): Promise<FacebookLoginResponse> {
loginWithLimitedTracking(permissions: string[], nonce: string): Promise<FacebookLimitedLoginResponse> {
return;
}

View File

@ -15,6 +15,18 @@ export interface FbSdkLoginResponse {
};
}
export interface FbSdkLimitedLoginResponse {
status: string;
authResponse: {
authenticationToken: string;
nonce: string;
userID: string;
};
}
/**
* @name FbSdk
* @description
@ -231,10 +243,11 @@ export class FbSdk extends AwesomeCordovaNativePlugin {
* ```
*
* @param {string[]} permissions List of [permissions](https://developers.facebook.com/docs/facebook-login/limited-login/permissions) this app has upon logging in.
* @returns {Promise<FbSdkLoginResponse>} Returns a Promise that resolves with a status object if login succeeds, and rejects if login fails.
* @param {string} nonce Nonce to create the configuration with.
* @returns {Promise<FbSdkLimitedLoginResponse>} Returns a Promise that resolves with a status object if login succeeds, and rejects if login fails.
*/
@Cordova()
loginWithLimitedTracking(permissions: string[]): Promise<FbSdkLoginResponse> {
loginWithLimitedTracking(permissions: string[], nonce: string): Promise<FbSdkLimitedLoginResponse> {
return;
}