Step 1: Add Account Linking Options to Your App


To make the user aware of the Alexa integration, offer account linking from your app. For example, you can give users the option to enable account linking after they register with your app or provide them with a button on your settings page.

Account linking button guidelines

In this step, you design and implement a screen from which a user can start skill enablement and account linking. This screen should show what the user can do by linking their account with Alexa, such as ordering a car by voice. As you design your screen, follow the best practices for placement of the account linking option and how to minimize the number of clicks.

iOS app

To add a UI button to your iOS app, follow these steps.

To add an account linking button to your iOS app

  1. Open your Xcode IDE and open your storyboard.
  2. Add a UIbutton to your view controller and name it something like "Link your account with Alexa". Consider using a name that indicates the benefit that the user gets by linking their account, such as "Listen to your music with Alexa", "Use Alexa to order a car with Ride Hailer".
    Adding a UIButton to your app.
  3. On the top left of the Xcode IDE, click Show the assistant editor.
  4. Create an action connection for your button by dragging the button to the code editor.

Android app

To add a UI button to your Android app, follow these steps.

To add an account linking button to your Android app

  1. In Android Studio, in design mode, open the layout of the page that you want to add the app-to-app account linking button to.
  2. From the palette of options, drag and drop a new button into your layout.
    Adding an app-to-app account linking button.
  3. Define an ID for your button.
    Define an ID for the app-to-app account linking button.
  4. In the code for your page, initialize your app-to-app account linking button and define its onClick listener behavior to start the flow, similar to the following example.
class AppToAppFragment : Fragment() {

  private lateinit var appToAppButton: Button
    
  override fun onCreateView(
    inflater: LayoutInflater,
    container: ViewGroup?,
    savedInstanceState: Bundle?
    ): View? {
      val root = inflater.inflate(R.layout.appToAppPage, container, false)
      initComponents(root)

      appToAppButton.setOnClickListener {
        doAppToApp() 
      }
  }

  private fun initComponents(root: View) {
    appToAppButton = root.findViewById(R.id.appToAppAccountLinkingButton)
  }
}

Was this page helpful?

Last updated: frontmatter-missing