Skip to content

Commit

Permalink
feat(firebase-x): add missing methods from plugin, incl. authenticate…
Browse files Browse the repository at this point in the history
…UserWithApple (#3458)
  • Loading branch information
vdias38 committed Jun 23, 2020
1 parent 66896b2 commit 32203e9
Showing 1 changed file with 144 additions and 0 deletions.
144 changes: 144 additions & 0 deletions src/@ionic-native/plugins/firebase-x/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,23 @@ export class FirebaseX extends IonicNativePlugin {
return;
}

/**
* Indicates whether autoinit is currently enabled. If so, new FCM tokens will be automatically generated.
*/
@Cordova()
isAutoInitEnabled(): Promise<boolean> {
return;
}

/**
* Sets whether to autoinit new FCM tokens. By default, a new token will be generated as soon as the old one is removed.
* To prevent a new token being generated, by sure to disable autoinit using setAutoInitEnabled() before calling unregister().
*/
@Cordova()
setAutoInitEnabled(enabled: boolean): Promise<any> {
return;
}

/**
* Android 8+ only. Creates a custom channel to be used by notification messages which have the channel property set in the message payload to the id of the created channel:
* - for background (system) notifications: android.notification.channel_id
Expand Down Expand Up @@ -520,6 +537,63 @@ export class FirebaseX extends IonicNativePlugin {
return;
}

/**
* Creates a new email/password-based user account. If account creation is successful, user will be automatically signed in.
* @param email
* @param password
*/
@Cordova()
createUserWithEmailAndPassword(email: string, password: string): Promise<any> {
return;
}

/**
* Signs in to an email/password-based user account.
* @param email
* @param password
*/
@Cordova()
signInUserWithEmailAndPassword(email: string, password: string): Promise<any> {
return;
}

/**
* Signs in user with custom token.
* @param customToken
*/
@Cordova()
signInUserWithCustomToken(customToken: string): Promise<any> {
return;
}

/**
* Signs in user anonymously.
*/
@Cordova()
signInUserAnonymously(): Promise<any> {
return;
}

/**
* Authenticates the user with a Google account to obtain a credential that can be used to sign the user in/link to an existing user account/reauthenticate the user.
* @param clientId
*/
@Cordova()
authenticateUserWithGoogle(clientId: string): Promise<any> {
return;
}

/**
* Authenticates the user with an Apple account using Sign In with Apple to obtain a credential that can be used to sign the user in/link to an existing user account/reauthenticate the user.
* @param locale
*/
@Cordova({
callbackOrder: 'reverse',
})
authenticateUserWithApple(locale?: string): Promise<any> {
return;
}

/**
* Links the user account to an existing Firebase user account with credentials obtained using verifyPhoneNumber().
* See the Android- and iOS-specific Firebase documentation for more info.
Expand All @@ -543,6 +617,76 @@ export class FirebaseX extends IonicNativePlugin {
return;
}

/**
* Checks if there is a current Firebase user signed into the app.
*/
@Cordova()
isUserSignedIn(): Promise<boolean> {
return;
}

/**
* Signs current Firebase user out of the app.
*/
@Cordova()
signOutUser(): Promise<any> {
return;
}

/**
* Updates the display name and/or photo URL of the current Firebase user signed into the app.
* @param profile
*/
@Cordova()
updateUserProfile(profile: { name: string; photoUri: string }): Promise<any> {
return;
}

/**
* Updates/sets the email address of the current Firebase user signed into the app.
* @param email
*/
@Cordova()
updateUserEmail(email: string): Promise<any> {
return;
}

/**
* Sends a verification email to the currently configured email address of the current Firebase user signed into the app.
* When the user opens the contained link, their email address will have been verified.
*/
@Cordova()
sendUserEmailVerification(): Promise<any> {
return;
}

/**
* Updates/sets the account password for the current Firebase user signed into the app.
* @param password
*/
@Cordova()
updateUserPassword(password: string): Promise<any> {
return;
}

/**
* Sends a password reset email to the specified user email address.
* Note: doesn't require the Firebase user to be signed in to the app.
* @param email
*/
@Cordova()
sendUserPasswordResetEmail(email: string): Promise<any> {
return;
}

/**
* Deletes the account of the current Firebase user signed into the app.
*/
@Cordova()
deleteUser(): Promise<any> {
return;
}

/**
* Registers a Javascript function to invoke when Firebase Authentication state changes between user signed in/signed out.
* @param {function} fn - callback function to invoke when authentication state changes
Expand Down

0 comments on commit 32203e9

Please sign in to comment.