FIRAnalytics.logEvent(withName: "workout_complete", parameters: [ "time": 1804 "exercise_type": "interval" "intensity": 2 ])
FIRAnalytics.logEvent(withName: "workout_complete", parameters: [ "time": 1804 "exercise_type": "interval" "intensity": 2 kFIRParameterValue: 1804 ])
workout_complete
invite_friends
eat_meal
FirebaseAuth auth = FirebaseAuth.getInstance(); if (auth.getCurrentUser() != null) { startActivity(SignedInActivity.createIntent(this, null)); finish(); }
@OnClick(R.id.sign_in) public void signIn(View view) { startActivityForResult( AuthUI.getInstance().createSignInIntentBuilder() .setTheme(getSelectedTheme()) .setLogo(getSelectedLogo()) .setProviders(getSelectedProviders()) .setTosUrl(getSelectedTosUrl()) .setIsSmartLockEnabled(mEnableSmartLock.isChecked()) .build(), RC_SIGN_IN); }
@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == RC_SIGN_IN) { handleSignInResponse(resultCode, data); return; } showSnackbar(R.string.unknown_response); }
private void handleSignInResponse(int resultCode, Intent data) { IdpResponse response = IdpResponse.fromResultIntent(data); // Successfully signed in if (resultCode == ResultCodes.OK) { startActivity(SignedInActivity.createIntent(this, response)); finish(); return; } else { // handle failure conditions } }
<style name="DarkTheme" parent="FirebaseUI"> <item name="colorPrimary">@color/material_gray_900</item> <item name="colorPrimaryDark">@android:color/black</item> … </style>
@OnClick(R.id.sign_in) public void signIn(View view) { startActivityForResult( AuthUI.getInstance().createSignInIntentBuilder() .setTheme(R.style.DarkTheme) .setLogo(getSelectedLogo())
WearableRecyclerView
WearableNavigationDrawer
MessagingStyle
ComplicationProviderService
pip install tensorflow
/topics/falcons
/topics/patriots
var admin = require("firebase-admin"); // Fetch the service account key JSON file contents var serviceAccount = require("path/to/serviceAccountKey.json"); // Initialize the app with a service account, granting admin privileges admin.initializeApp({ credential: admin.credential.cert(serviceAccount), databaseURL: "https://<DATABASE_NAME>.firebaseio.com" }); // Define who to send the message to var condition = "'falcons' in topics || 'patriots' in topics"; // Define the message payload var payload = { notification: { title: "Super Bowl LI: Falcons vs. Patriots", body: "Your team is Super Bowl bound! Get the inside scoop on the big game." } }; // Send a message to the condition with the provided payload admin.messaging.sendToCondition(condition, payload) .then(function(response) { console.log("Successfully sent message! Server response:", response); }) .catch(function(error) { console.log("Error sending message:", error); });
// condition and payload are the same as above var options = { priority: "high", timeToLive: 60 * 60 * 24 * 7 }; admin.messaging.sendToCondition(condition, payload, options) .then(function(response) { console.log("Successfully sent message! Server response:", response); }) .catch(function(error) { console.log("Error sending message:", error); });
setServiceAccount()
FileInputStream serviceAccount = new FileInputStream("path/to/serviceAccountCredentials.json"); FirebaseOptions options = new FirebaseOptions.Builder() .setServiceAccount(serviceAccount) .setDatabaseUrl("https://<DATABASE_NAME>.firebaseio.com") .build(); FirebaseApp.initializeApp(options);
setCredential()
FileInputStream serviceAccount = new FileInputStream("path/to/serviceAccountCredentials.json"); FirebaseOptions options = new FirebaseOptions.Builder() .setCredential(FirebaseCredentials.fromCertificate(serviceAccount)) .setDatabaseUrl("https://<DATABASE_NAME>.firebaseio.com") .build(); FirebaseApp.initializeApp(options);
FirebaseOptions options = new FirebaseOptions.Builder() .setCredential(FirebaseCredentials.applicationDefault()) .setDatabaseUrl("https://<DATABASE_NAME>.firebaseio.com") .build(); FirebaseApp.initializeApp(options);