Catch up on all the news, sessions, and announcements from Google I/O 2021. Watch now.

Get barcode

Action ID
actions.intent.GET_BARCODE
Description
Open a barcode or QR code scanner.

Locale support

Functionality Locales
Preview creation using App Actions test tool en-US
User invocation from Google Assistant en-US

Example queries

Sample XML files

For information about the actions.xml schema, see Create actions.xml. For information about the shortcuts.xml schema, see Create shorcuts.xml.

Handle BII parameters

shortcuts.xml

<?xml version="1.0" encoding="utf-8"?>
<!-- This is a sample shortcuts.xml -->
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android">
  <capability android:name="actions.intent.GET_BARCODE">
    <intent
      android:action="android.intent.action.VIEW"
      android:targetPackage="YOUR_UNIQUE_APPLICATION_ID"
      android:targetClass="YOUR_TARGET_CLASS">
    </intent>
  </capability>
</shortcuts>
      

actions.xml

<?xml version="1.0" encoding="utf-8"?>
<!-- This is a sample actions.xml -->
<actions>
  <action intentName="actions.intent.GET_BARCODE">
    <fulfillment urlTemplate="myapp://custom-deeplink">
    </fulfillment>
  </action>
</actions>