Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(facebook/fbsdk): fix typings for loginWithLimitedTracking #4906

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions src/@awesome-cordova-plugins/plugins/facebook/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ export interface FacebookLoginResponse {
};
}

export interface FacebookLimitedLoginResponse {
status: string;

authResponse: {
authenticationToken: string;

nonce: string;

userID: string;
};
}

/**
* @name Facebook
* @description
Expand Down Expand Up @@ -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;
}

Expand Down
17 changes: 15 additions & 2 deletions src/@awesome-cordova-plugins/plugins/fbsdk/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ export interface FbSdkLoginResponse {
};
}

export interface FbSdkLimitedLoginResponse {
status: string;

authResponse: {
authenticationToken: string;

nonce: string;

userID: string;
};
}

/**
* @name FbSdk
* @description
Expand Down Expand Up @@ -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;
}

Expand Down