// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/fcmdata.googleapis.com
// - Login into gcloud by running:
// `$ gcloud auth application-default login`
// - Install the npm module by running:
// `$ npm install googleapis`
const {google} = require('googleapis');
const fcmdata = google.fcmdata('v1beta1');
async function main() {
const auth = new google.auth.GoogleAuth({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: ['https://www.googleapis.com/auth/cloud-platform'],
});
// Acquire an auth client, and bind it to all future calls
const authClient = await auth.getClient();
google.options({auth: authClient});
// Do the magic
const res = await fcmdata.projects.androidApps.deliveryData.list({
// The maximum number of entries to return. The service may return fewer than this value. If unspecified, at most 1,000 entries will be returned. The maximum value is 10,000; values above 10,000 will be capped to 10,000. This default may change over time.
pageSize: 'placeholder-value',
// A page token, received from a previous `ListAndroidDeliveryDataRequest` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListAndroidDeliveryDataRequest` must match the call that provided the page token.
pageToken: 'placeholder-value',
// Required. The application for which to list delivery data. Format: `projects/{project_id\}/androidApps/{app_id\}`
parent: 'projects/my-project/androidApps/my-androidApp',
});
console.log(res.data);
// Example response
// {
// "androidDeliveryData": [],
// "nextPageToken": "my_nextPageToken"
// }
}
main().catch(e => {
console.error(e);
throw e;
});
const {google} = require('googleapis');
const fcmdata = google.fcmdata('v1beta1');
// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/firebase.googleapis.com
// - Login into gcloud by running:
// `$ gcloud auth application-default login`
// - Install the npm module by running:
// `$ npm install googleapis`
const {google} = require('googleapis');
const firebase = google.firebase('v1beta1');
async function main() {
const auth = new google.auth.GoogleAuth({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: [
'https://www.googleapis.com/auth/cloud-platform',
'https://www.googleapis.com/auth/cloud-platform.read-only',
'https://www.googleapis.com/auth/firebase',
'https://www.googleapis.com/auth/firebase.readonly',
],
});
// Acquire an auth client, and bind it to all future calls
const authClient = await auth.getClient();
google.options({auth: authClient});
// Do the magic
const res = await firebase.projects.androidApps.list({
// The maximum number of Apps to return in the response. The server may return fewer than this at its discretion. If no value is specified (or too large a value is specified), then the server will impose its own limit.
pageSize: 'placeholder-value',
// Token returned from a previous call to `ListAndroidApps` indicating where in the set of Apps to resume listing.
pageToken: 'placeholder-value',
// The resource name of the parent FirebaseProject for which to list each associated AndroidApp, in the format: projects/PROJECT_IDENTIFIER /androidApps Refer to the `FirebaseProject` [`name`](../projects#FirebaseProject.FIELDS.name) field for details about PROJECT_IDENTIFIER values.
parent: 'projects/my-project',
});
console.log(res.data);
// Example response
// {
// "apps": [],
// "nextPageToken": "my_nextPageToken"
// }
}
main().catch(e => {
console.error(e);
throw e;
});
// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/firebaseappcheck.googleapis.com
// - Login into gcloud by running:
// `$ gcloud auth application-default login`
// - Install the npm module by running:
// `$ npm install googleapis`
const {google} = require('googleapis');
const firebaseappcheck = google.firebaseappcheck('v1beta');
async function main() {
const auth = new google.auth.GoogleAuth({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: [
'https://www.googleapis.com/auth/cloud-platform',
'https://www.googleapis.com/auth/firebase',
],
});
// Acquire an auth client, and bind it to all future calls
const authClient = await auth.getClient();
google.options({auth: authClient});
// Do the magic
const res = await firebaseappcheck.projects.apps.exchangeSafetyNetToken({
// Required. The relative resource name of the Android app, in the format: ``` projects/{project_number\}/apps/{app_id\} ``` If necessary, the `project_number` element can be replaced with the project ID of the Firebase project. Learn more about using project identifiers in Google's [AIP 2510](https://google.aip.dev/cloud/2510) standard.
app: 'projects/my-project/apps/my-app',
// Request body metadata
requestBody: {
// request body parameters
// {
// "safetyNetToken": "my_safetyNetToken"
// }
},
});
console.log(res.data);
// Example response
// {
// "attestationToken": "my_attestationToken",
// "ttl": "my_ttl"
// }
}
main().catch(e => {
console.error(e);
throw e;
});
// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/firebase.googleapis.com
// - Login into gcloud by running:
// `$ gcloud auth application-default login`
// - Install the npm module by running:
// `$ npm install googleapis`
const {google} = require('googleapis');
const firebase = google.firebase('v1beta1');
async function main() {
const auth = new google.auth.GoogleAuth({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: [
'https://www.googleapis.com/auth/cloud-platform',
'https://www.googleapis.com/auth/cloud-platform.read-only',
'https://www.googleapis.com/auth/firebase',
'https://www.googleapis.com/auth/firebase.readonly',
],
});
// Acquire an auth client, and bind it to all future calls
const authClient = await auth.getClient();
google.options({auth: authClient});
// Do the magic
const res = await firebase.projects.androidApps.get({
// The resource name of the AndroidApp, in the format: projects/ PROJECT_IDENTIFIER/androidApps/APP_ID Since an APP_ID is a unique identifier, the Unique Resource from Sub-Collection access pattern may be used here, in the format: projects/-/androidApps/APP_ID Refer to the `AndroidApp` [`name`](../projects.androidApps#AndroidApp.FIELDS.name) field for details about PROJECT_IDENTIFIER and APP_ID values.
name: 'projects/my-project/androidApps/my-androidApp',
});
console.log(res.data);
// Example response
// {
// "appId": "my_appId",
// "displayName": "my_displayName",
// "name": "my_name",
// "packageName": "my_packageName",
// "projectId": "my_projectId"
// }
}
main().catch(e => {
console.error(e);
throw e;
});