BDK Native - Cannot get "go to previous" page to work with "Android back button is pressed"

Hi Bubblers

I have recently started the process of wrapping my app using BDK Native.

I managed to get Push notification, Native Date pickers, and the iOS STatut bar / Notch to work properly, but I am struggling to get the back button to work.

Here is my configuration:

  • My app is a SPA, the URL Load page goes to Login - Drivalty
    *All the app navigation is managed by URL and I use “Back button” in browsed to go to previous page, which works perfectly using chrome, safari on PC, Mobile, Tablet.
  • I have the BN-appinfo plugin item on the Index page, and it is visible
  • I have a workflow event “When BN Native Android back button is pressed” associated with the “Go to previous page” action.
  • This is working fine when I use the Deeplink generated by the “BDK Native app” under the “feature demo” menu. The deeplink is using the same “load page url”. All of this on my Android Pixel phone.
  • But it is not working on the actual Build/APK/Android app that I got from BDK/@gaurav

Is anyone here able to help ?

Hello @wahid.elh, did you find a solution for this? I’m also facing the same.
I have tried using the “go back” but it is also not working
image

Also not working for me; hitting back button on android just exits the app even if there was previous URL routing

Any solution @melqar ?

Can you help @gaurav ?

Hi @kenneth.ettinger @melqar I got @gaurav to identify the root cause which apparently was tied with how android handles the back button behavior.

From what I understood he had to change a few line of code from his bdk plugin and had to rebuild my APK.

Since then it is working!

1 Like

Thank you! I’ll follow up for a rebuild

You may already be using this, but is your app setup to show/hide screens based on Custom State Variables or on Query String Parameters? Using QSP will make the back button work on Android.

As seen in https://www.youtube.com/watch?v=7gd_ZBH8CqQ&t=361s

The above I’m certain on because I’ve done it on a mobile app.

The next hot tip, lately I’ve used the Toolbox plugin for Javascript + Claude AI writing code in order to spoof page navigation by changing the QSP value without a page refresh.

The reason in my case was that reloading the page is slow and I wanted a faster experience but still allow for users in a web browser to hit the back button. I don’t see why it wouldn’t also work for Android back button on mobile.

The reason what I am suggesting is powerful because it give you granular control for when the back button will work – meaning, whenever you update the value of any QSP, the back button would go back to the state of things prior to the most previous update. And this is something to be desired since there is an expected norm for the use of the back button for Android users.

Thank you @wahid.elh. I will ask for a rebuild after changing few things in my app