Skip to main content

firebase_app_identity 0.1.0 copy "firebase_app_identity: ^0.1.0" to clipboard
firebase_app_identity: ^0.1.0 copied to clipboard

Unofficial. Reads the running Flutter app's package name and signing SHA-1 (Android) or bundle ID (iOS, macOS), so that firebase_app_dart sends them to an API key limited to the app, as the native Fir [...]

firebase_app_identity #

Unofficial. Not affiliated with Google or Firebase.

A Firebase API key can be limited to an Android app (its package name and signing SHA-1) or to an Apple app (its bundle ID). The key then accepts only requests that name the app in the headers X-Android-Package, X-Android-Cert and X-Ios-Bundle-Identifier. The native Firebase SDKs read these values from the running app. This plugin does the same for firebase_app_dart:

  • Android: the package name and the SHA-1 of the certificate that signed the installed app.
  • iOS and macOS: the bundle ID.
  • Web, Linux and Windows: nothing; each call leaves things as they are.

The limit is not a security boundary: any program can send these headers.

// Options you build yourself:
final FirebaseOptions options = await AppIdentity.apply(
  const FirebaseOptions(apiKey: apiKey, appId: appId, projectId: projectId),
);

// A client that takes headers:
final FirebaseUserAuth auth = FirebaseUserAuth(
  apiKey: apiKey,
  apiKeyHeaders: await AppIdentity.apiKeyHeaders(),
);

// FlutterFire options, which have no Android values: at the start of main().
await AppIdentity.setAndroidApp();

Status: 0.1.0, on pub.dev.

0
likes
140
points
31
downloads

Documentation

API reference

Publisher

verified publisherupcode.dev

Weekly Downloads

Unofficial. Reads the running Flutter app's package name and signing SHA-1 (Android) or bundle ID (iOS, macOS), so that firebase_app_dart sends them to an API key limited to the app, as the native Firebase SDKs do.

Homepage
Repository (GitHub)
View/report issues
Contributing

Topics

#firebase #api-key

License

Apache-2.0 (license)

Dependencies

firebase_app_dart, flutter

More

Packages that depend on firebase_app_identity

Packages that implement firebase_app_identity