Is there any way to detect whether a user browsing my website is tapping / expanding the status bar? Is any sort of javascript "out of focus" event fired?
We want to use this for alerting the user before navigating away during an ongoing transaction. window.onbeforeunload is apparently not supported by Mobile Safari.
Related
I'm trying to find a way to detect when the user closes or dismisses the pop-up in an iOS Safari web extension.
I've tried listening for onblur, pagehide, and visibilitychange events but they are not fired when the popup is closed. All of these events do fire on macOS Safari 16, though.
Opening up a port by running browser.runtime.connect() in the popup and listening for onConnect/onDisconnect events in the background script only causes the onConnect event to fire when the popup is opened.
I stumped over the same problem and discovered, that the visibility change event get only fired when:
Visible
Page reload
On page reload the hidden gets fired. But I need to get it when the popup is closed.
Looks like this is a bug but workarounds are welcome.
The best solution I found was listening for the blur event. It seems to be fired only when the pop up is closed, but only if the user first taps somewhere inside the popup.
I have an app that is launched from a url in safari. On the top of the app is a < safari button that returns to the calling safari tab. I would like to my app to handle the event and close resources that I'm using when the < safari button is tapped.
I've searched with no success.
There is no way to know that a user tapped the "return to previous app" link in the status bar.
All your app can detect is that it has entered the background. But of course that could happen for many other reasons.
im developing an iOS App and i would like it to behave like PayPal when the user double taps the home button.
For those who dont know the PayPal app displays a custom image when the app is displayed on the multitask switcher but it doesnt when a notification arrives or when the user pulls the notifications bar.
My issue comes when implementing this, im using the event applicationWillResignActive to display my custom image (as applicationEnteredBackground is not called for this). But this method is called on events on which i dont want the app to display the image (such as notifications, calls, pulling the top bar, etc).
Is there any way of setting this image only when the home button is double tapped?
Thank you!
From what I see, PayPal doesn't cover the viewport with a custom image immediately – when I double tap the Home button, it remains rendered normally until I do something else – but most probably on applicationDidEnterBackground:. After switching to Home screen or another application, the PayPal preview becomes covered.
On the other hand, my mobile banking application does that immediately when applicationWillResignActive: is triggered.
These are AFAIK the only two approaches you can achieve.
In the iOS, when the user double home button , the app show in the list at background.
Have possible hidden my app show in the list, or force the user swiped the app, the app in the background can't close?
I just known applicationDidEnterBackground can do something in the background. But
I wish force the user can't swipe the app in the list or hidden the app in the list, or have some mobile device management method can do this effect(we can use private api)?
I search many time , but I was not found some answer...
thank you very much.
This is not possible in iOS, the user is in control and Apple does not allow your app to hide it self in this list.
If you want this you will need to target jailbroke devices and hook on the task switch. Then detect you app from being closed and restarted it.
I have an app which is in foreground and I want to disable notification center UI in it (so a user can't open it). And I am looking for an API (or at least direction of search) to disable notification center UI or prevent a user from opening it.
Couple of important notes:
I am looking for a way to disable it completely within an app.
Just setting status bar to hidden and moving it to the left doesn't work for me. It still could be accessed.
I want just to disable it and don't modify any behavior.
So, kiosk mode does't work for me either.
Private API (not jailbreak tweaks) are fine.