Bird
Raised Fist0
Firebasecloud~10 mins

Preview channels in Firebase - Interactive Code Practice

Choose your learning style10 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a preview channel with Firebase Hosting.

Firebase
firebase hosting:channel:create [1]
Drag options to blanks, or click blank then click option'
Apreview-123
Bserve
Cinit
Ddeploy
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'deploy' instead of a channel name.
Using 'init' or 'serve' which are unrelated commands.
2fill in blank
medium

Complete the command to deploy to a specific preview channel.

Firebase
firebase hosting:channel:deploy [1]
Drag options to blanks, or click blank then click option'
Apreview-123
Bmain
Cproduction
Ddefault
Attempts:
3 left
💡 Hint
Common Mistakes
Using branch names like 'main' or 'production' instead of the preview channel name.
Using 'default' which is not a preview channel.
3fill in blank
hard

Fix the error in the command to list all preview channels.

Firebase
firebase hosting:channel:[1]
Drag options to blanks, or click blank then click option'
Adeploy
Bshow
Clist
Dcreate
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'show' which is not a valid subcommand here.
Using 'deploy' or 'create' which perform different actions.
4fill in blank
hard

Fill both blanks to delete a preview channel safely.

Firebase
firebase hosting:channel:[1] [2]
Drag options to blanks, or click blank then click option'
Adelete
Bpreview-123
Cremove
Dpreview-xyz
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'remove' instead of 'delete' as the command.
Using wrong channel names that do not exist.
5fill in blank
hard

Fill all three blanks to create, deploy, and open a preview channel.

Firebase
firebase hosting:channel:[1] [2] && firebase hosting:channel:[3] [2] --open
Drag options to blanks, or click blank then click option'
Acreate
Bpreview-abc
Cdeploy
Dlist
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'list' instead of 'deploy' for the second command.
Using different channel names in create and deploy commands.

Practice

(1/5)
1. What is the main purpose of Firebase preview channels?
easy
A. To create temporary, shareable versions of your app for testing
B. To permanently host your live app
C. To backup your Firebase database
D. To monitor app usage statistics

Solution

  1. Step 1: Understand preview channels concept

    Preview channels allow you to create temporary versions of your app that you can share for testing.
  2. Step 2: Compare with other options

    Permanent hosting, backups, and monitoring are different Firebase features unrelated to preview channels.
  3. Final Answer:

    To create temporary, shareable versions of your app for testing -> Option A
  4. Quick Check:

    Preview channels = temporary test versions [OK]
Hint: Preview channels = temporary test app versions [OK]
Common Mistakes:
  • Confusing preview channels with permanent hosting
  • Thinking preview channels backup data
  • Assuming preview channels track usage
2. Which command correctly creates a Firebase preview channel named test123?
easy
A. firebase hosting:channel:deploy test123
B. firebase deploy --channel test123
C. firebase hosting:deploy test123
D. firebase channel:create test123

Solution

  1. Step 1: Recall the correct Firebase CLI command

    The command to create a preview channel is firebase hosting:channel:deploy CHANNEL_ID.
  2. Step 2: Match the command with the channel name

    Replacing CHANNEL_ID with test123 gives firebase hosting:channel:deploy test123.
  3. Final Answer:

    firebase hosting:channel:deploy test123 -> Option A
  4. Quick Check:

    Correct CLI command = firebase hosting:channel:deploy test123 [OK]
Hint: Use hosting:channel:deploy with your channel name [OK]
Common Mistakes:
  • Using deploy without hosting:channel
  • Using channel:create which is invalid
  • Mixing command order or flags
3. What happens when you deploy to a Firebase preview channel with the command firebase hosting:channel:deploy preview1?
medium
A. The live app is overwritten immediately
B. The app is published to the app stores
C. The Firebase database is reset
D. A temporary URL is created to share the app version

Solution

  1. Step 1: Understand the effect of deploying to a preview channel

    Deploying to a preview channel creates a temporary, shareable URL for testing.
  2. Step 2: Eliminate incorrect options

    It does not overwrite the live app, reset databases, or publish to app stores.
  3. Final Answer:

    A temporary URL is created to share the app version -> Option D
  4. Quick Check:

    Deploy to preview channel = temporary URL [OK]
Hint: Deploying preview channel creates temporary share URL [OK]
Common Mistakes:
  • Thinking it overwrites live app immediately
  • Confusing preview deploy with database reset
  • Assuming it publishes app to stores
4. You ran firebase hosting:channel:deploy MyTest but got an error saying the channel name is invalid. What is a likely cause?
medium
A. You need to be logged out of Firebase CLI
B. You must include the --force flag
C. Channel names cannot contain uppercase letters
D. Channel names must be numeric only

Solution

  1. Step 1: Check Firebase preview channel naming rules

    Channel names must be lowercase alphanumeric and can include dashes, but no uppercase letters.
  2. Step 2: Evaluate other options

    --force flag is not required for naming; numeric-only names are not required; being logged out causes authentication errors, not naming errors.
  3. Final Answer:

    Channel names cannot contain uppercase letters -> Option C
  4. Quick Check:

    Invalid channel name = uppercase letters [OK]
Hint: Use only lowercase letters in channel names [OK]
Common Mistakes:
  • Trying uppercase letters in channel names
  • Assuming --force fixes naming errors
  • Confusing auth errors with naming errors
5. You want to share a new feature with your team without affecting the live app. Which steps correctly use Firebase preview channels to do this?
hard
A. Run firebase deploy to update live app, then email the team
B. Run firebase hosting:channel:deploy featureX and share the generated URL
C. Create a new Firebase project and deploy the app there
D. Use firebase hosting:disable to stop live hosting temporarily

Solution

  1. Step 1: Identify the correct way to create a preview version

    Using firebase hosting:channel:deploy featureX creates a temporary preview channel for sharing.
  2. Step 2: Understand why other options are incorrect

    Deploy updates live app; creating new project is unnecessary; disabling hosting stops live app, not preview.
  3. Final Answer:

    Run firebase hosting:channel:deploy featureX and share the generated URL -> Option B
  4. Quick Check:

    Preview channel deploy + share URL = safe testing [OK]
Hint: Deploy preview channel and share URL, not live deploy [OK]
Common Mistakes:
  • Deploying directly to live app by mistake
  • Creating new projects unnecessarily
  • Disabling hosting instead of previewing
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard