Open UtillYou opened 4 years ago
The event is currently only emitted on Android.
Is there any ways to handle the default back action on iOS?
I also have use case for this in my current app wondering if support for ios can be added
I am using RNN version 7.8.4 and this event is already fired. Guess we can close this issue? cc @UtillYou @danilobuerger
The code below , I have the same problem for IOS. navigationButtonPressed is called on ANDROID but not on IOS
class SavedBillsScreen extends Component<SavedBillsScreenProps, SavedBillsScreenState> {
constructor(props: SavedBillsScreenProps) {
super(props)
this.state = {
selectedBill: undefined,
editModalVisible: false,
}
Navigation.events().bindComponent(this)
}
public static options() {
return isAndroid
? { fab: FAB_PLUS_BUTTON(addBillButtonId) }
: { topBar: { rightButtons: [NAV_ICON_BUTTON(addBillButtonId, 'nav-add')] } }
}
navigationButtonPressed = ({ buttonId }: NavigationButtonPressedEvent) => {
if (buttonId === addBillButtonId) {
this.goToChooseBillTypeScreen()
}
}
public render() {
const { bills } = this.props
return (
<View style={{ flex: 1 }}>
)
}
}
@nelsonprsousa I am on version 7.28.0 . This still does not work on IOS. using Navigation.events().bindComponent(this)
React Native Navigation version: 7.28.0 React Native version: 0.68.2 Platform(s) (iOS, Android, or both?): both Device info (Simulator/Device? OS version? Debug/Release?): Both Simulator and Device, iOS 13, Both Debug and Release
Issue Description
registerNavigationButtonPressedListener is not triggered on iOS. I registered the
registerNavigationButtonPressedListener
globally in the entrance file which has a name ofindex.js
. However, when I pressed the back icon in a screen on iOS, the event was not triggered at all. On Android, it worked very well.Steps to Reproduce / Code Snippets / Screenshots
Environment