Flutter mobile app, clicking an existing and valid physical back button is not working, even though the Cucumber step succeeds - flutter

I am using JDK 1.8_202, appium 2.0.0-beta.46, node v18.12.0
There is a programmer developed back button (<--) whose className as "android.widget.Button" whose className as "android.widget.Button", but when I try to verify it using search option, I am getting this pop up.
Programmatically nothing is happening, even though as a CucumberBDD step, it is showing as executed.
I am executing on locally connected physical device 'Samsung galaxy note 8'
Why back button tap/click action is not working even when it is executed??
I open my flutter mobile app. I am at landing page
Do some navigation forward. Comeback to a dashboard page
From dashboard page to get back to landing page, there is a back button like (<--), which I manual tap and can get back to landing page, with no problem.
Programmatically nothing is happening, even though as a CucumberBDD step, it is showing as executed.
From Appium Inspector I see it's className as "android.widget.Button", but when I try to verify it using search option, I am getting this pop up.
The same button with the same click() method is working fine in another scenario.
I am using JDK 1.8_202, appium 2.0.0-beta.46, node v18.12.0
Does the previous navigation affects the functioning of the button click() action ? It should not be logically.
Why back button tap/click action is not working even when it is executed??

Related

How to get history of all previous pushed navigation for flutter web/native application?

There is an issue with my navigation and it's parsed value from previous screen for web application.
Actually, I go via Get.toNamed(Routes.VISAS); to next screen and next screen's back button is not working when I reload the web application so I have implemented own back button then try to called Get.back(); or Navigator.of(context).pop(); manually but still not working. so I thought during reload the web app it removes all previous navigation and it's parsed value from previous screen as well and this is a big issue for my web app.
so I was thinking to get rid of this issue , first of all I fetch the navigation history if there is no push screen in stack so I will navigate to my home screen else go back to previous screen().
and 2nd issue : when I parsed value via constructor it remove as well when reload the web application so I Will use SharedPreferences() to resolve this. I know this is not a good approach. Help me out to get navigation history in flutter application.
GOTO NEXT SCREEN :
Get.toNamed(Routes.VISAS);
FOR BACK :
Get.back(); // Not working when I reload the web application
//Navigator.of(context).pop();
From :
TO:

How to do fast controller initialization

In my application with GetX, I had to create around 7 controllers, and they need to be initialized.
Everything works fine, but the controller I created for mobile ads sometimes throws an error. Actually, it does not give an error, but a bug occurs.
The problem is that when the app opens, it needs to show ads on the first click. As soon as the application is opened, when you click quickly, it does not show the interstitial ad. But a few seconds pass and if clicked, it shows the ad.
I'm not writing here because I don't have a problem with the codes. Is there any method I can solve this?

Ionic content not updating after callback from external plugin

As part of the functionality of the app we are developing, when an android alarm is fired, a dialog box is to appear with an "Accept" or "Reject" button. Selecting reject does nothing, but selecting "Accept" triggers a callback from the plugin, which I have passed a function into. This function causes the ionic app to navigate to the root page of the app.
The issue I am having is, when I then navigate to another page after that where the user selects a value, and this value is displayed back to them and a button is enabled, the value display is not updating, and the button is not becoming enabled. Nothing seems to be updating.
What I have found is that pressing the back button on my android device will cause the page to update, which is not ideal.
This functionality works without the callback from the plugin.
What is happening here? And how do I fix it?
Passing the function into the plugin.
alarms_plugin.onAlarmRecieved = (alarmId) =>{
this.events.publish('alarmRecieved', alarmId);
}
Plugin-side functions
alarmRecieved: function(alarmId){
alarms_plugin.onAlarmRecieved(alarmId);
}
onAlarmRecieved: null
Navigating to root page on alarmRecieved
this.events.subscribe('alarmRecieved', (alarmId) =>{
if(alarmId != 'TIMEOUT')
this.nav.setRoot(HomePage);
});
Fix found by surrounding the this.nav.setRoot(HomePage) in this.zone.run(..).
Supposedly calling navigation within a subscription event causes issues like I was having.

One click, event called twice

I have developed a mobile application. Most of the functions are inside, but I have some very strange behaviour inside the app on iOs (not tested on android yet).
When I click on an item: the event after the click is called twice. This isn't happening the whole time, but happens now and then. This is a problem for when I try to go to the next slide (he things he should move twice to a next slide), but also when I try to open the gallery for selecting photos, he opens the gallery twice, login for facebook happens twice etc... The strange thing is, that this isn't the whole time the case.
I have normal buttons like
<button ion-button color="black" class="skip-button"
(click)="nextStep()" [hidden]="lastSlide">Next</button>
so I don't think that the coding is wrong (or is it wrong).
I use this version:
ionic --version
2.1.18
In the beginning of the development I hadn't this issue. I think that I was using an older version of ionic2 then. Is there a way to go back perhaps?
I was in the meantime working on another project without having this issue (in that project). My last try was to copy the other project and copy pages and providers from the project with the error. The error is now gone, but still no clue why there was such an error.

Prevent cached iPhone webapp from reloading (scrolling to top)

I have an iPhone webapp that uses a cache manifest to work offline. I add the webapp to my home screen, use it (say scroll to a certain location on a page), then go back to homescreen.
When I open the app again, for a brief moment I see where I used to be (at that scrolled location on that page), but then the app "reloads" and I get scrolled to the top of the mainpage. Is there a way to prevent this "reloading"? This happens even in airplane mode (ie everything is working off the cache).
You're just seeing the default startup image, which is just a screenshot of the last place you were at. It's not "reloading"; the app wasn't loaded to begin with.
Search for "apple-touch-startup-image" to set a real loading image.
What I'm struggling with here is that the app actually seems to stay "in memory" longer if I use regular Safari as opposed to running in "apple-mobile-web-app-capable" mode. In the later case something as simple as pressing the home button, then task-switching back to the app causes a reload. Doing the same thing just in Safari often does not reload. So I'm worse off by using "apple-mobile-web-app-capable".
I don't believe there is a real 'reload' event. onload and onunload are all we get.
the onload handler starts up as if it is your first time coming to the page.
the onunload handler is the key to clearing out old content.
I like to provide alternate content for people who are coming back to my web app.
window.onunload=function(){
document.getElementsByTagName('body')[0].className+=' unloading'
}
And let the CSS do the dirty work to hide most of the body and show alternate content.
(this answer does not rely on jQuery or other frameworks)
// on load
window.scroll(0,0);
To ensure no old content is displayed while launching I use this in my page:
window.addEventListener('unload', function() { $('body').hide(); } );
Thus the last state of the page is empty and is what is shown to the user when the page is opened again.