mohebifar / mohebifar/react-native-copilot

Could not use Android Back Button when in walkthrough?

Open
#66 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
TypeScript
Stars
2.4k
Forks
428
PR merge metrics
No merged PRs in 30d

Description

Hi! First of all, many thanks for developing such a convenient and powerful walkthrough tool for RN. I have finished developing the walkthrough for our app right now and I am considering utilizing the back button on Android to act as the "Previous" button. However, when in walkthrough, pressing the back button on android does not trigger the function. And after the walkthrough has been finished by tapping the "Finish" or "Skip" button, the handler can be successfully called. I am not usre how to handle it or is it intended? My codes for this functionality is as followed.

import { BackHandler } from 'react-native'
componentWillUnmount () {
    BackHandler.removeEventListener('androidBackButtonPress', this.handleBackPress)
  }

  handleBackPress = () => {
    console.log('test')
    return true
  }
  componentDidMount () {
    BackHandler.addEventListener('androidBackButtonPress', this.handleBackPress)
  }

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the BackHandler listener shown in the issue and the walkthrough's active-state handling; reproduce the behavior while a walkthrough is running. Done means Android back presses invoke the intended previous-step behavior during the walkthrough without breaking Finish or Skip.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, react-native, typescript
Domain
mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.