-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(app-distribution): Firebase V9 modular API (#7307)
* feat(app-distribution): Firebase V9 modular API * add modular export in index.js * fix(types): AppDistribution -> FirebaseAppDistribution, typedefs for jsdocs --------- Co-authored-by: Mike Hardy <[email protected]>
- Loading branch information
Showing
6 changed files
with
196 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { ReactNativeFirebase } from '@react-native-firebase/app'; | ||
import { FirebaseAppDistributionTypes } from '..'; | ||
|
||
export type FirebaseAppDistribution = FirebaseAppDistributionTypes.Module; | ||
|
||
/** | ||
* Get an App Distribution instance for the specified app or current app. | ||
*/ | ||
export declare function getAppDistribution( | ||
app?: ReactNativeFirebase.FirebaseApp, | ||
): FirebaseAppDistribution; | ||
|
||
/** | ||
* Returns true if the App Distribution tester is signed in. | ||
* If not an iOS device, it always rejects, as neither false nor true seem like a sensible default. | ||
*/ | ||
export declare function isTesterSignedIn( | ||
appDistribution: FirebaseAppDistribution, | ||
): Promise<boolean>; | ||
|
||
/** | ||
* Sign-in the App Distribution tester | ||
* If not an iOS device, it always rejects, as no defaults seem sensible. | ||
*/ | ||
export declare function signInTester(appDistribution: FirebaseAppDistribution): Promise<void>; | ||
|
||
/** | ||
* Check to see whether a new distribution is available | ||
* If not an iOS device, it always rejects, as no default response seems sensible. | ||
*/ | ||
export declare function checkForUpdate( | ||
appDistribution: FirebaseAppDistribution, | ||
): Promise<FirebaseAppDistributionTypes.AppDistributionRelease>; | ||
|
||
/** | ||
* Sign out App Distribution tester | ||
* If not an iOS device, it always rejects, as no default response seems sensible. | ||
*/ | ||
export declare function signOutTester(appDistribution: FirebaseAppDistribution): Promise<void>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { firebase } from '..'; | ||
|
||
/** | ||
* @typedef {import("..").FirebaseApp} FirebaseApp | ||
* @typedef {import("..").FirebaseAppDistributionTypes.AppDistributionRelease} AppDistributionRelease | ||
* @typedef {import("..").FirebaseAppDistributionTypes.Module} FirebaseAppDistribution | ||
*/ | ||
|
||
/** | ||
* @param {FirebaseApp | undefined} app | ||
* @returns {FirebaseAppDistribution} | ||
*/ | ||
export function getAppDistribution(app) { | ||
if (app) { | ||
return firebase.appDistribution(app); | ||
} | ||
return firebase.appDistribution(); | ||
} | ||
|
||
/** | ||
* @param {FirebaseAppDistribution} appDistribution | ||
* @returns {Promise<boolean>} | ||
*/ | ||
export function isTesterSignedIn(appDistribution) { | ||
return appDistribution.isTesterSignedIn(); | ||
} | ||
|
||
/** | ||
* @param {FirebaseAppDistribution} appDistribution | ||
* @returns {Promise<void>} | ||
*/ | ||
export function signInTester(appDistribution) { | ||
return appDistribution.signInTester(); | ||
} | ||
|
||
/** | ||
* @param {FirebaseAppDistribution} appDistribution | ||
* @returns {AppDistributionRelease>} | ||
*/ | ||
export function checkForUpdate(appDistribution) { | ||
return appDistribution.checkForUpdate(); | ||
} | ||
|
||
/** | ||
* @param {FirebaseAppDistribution} appDistribution | ||
* @returns {Promise<void>} | ||
*/ | ||
export function signOutTester(appDistribution) { | ||
return appDistribution.signOutTester(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
309fec4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
react-native-firebase – ./
react-native-firebase-invertase.vercel.app
react-native-firebase-git-main-invertase.vercel.app
react-native-firebase.vercel.app
rnfirebase.io