What event is triggered whenever the app is dragged back into the current window? - windows-8

I'm struggling with the activation lifecycle for my app. I just want to save the state for the current page whenever the app is hidden or whenever the user navigates to a different page. Conversely, I want to restore the state whenever the user launches my app or navigates back to that page.
In the following case, I detect that the app was made hidden so I store the page's state, but I never get notified that the app was reactivated so I can restore the state:
(on surface)
1. launch app
2. press start
3. drag app from left edge of screen and drop it back into focus
I was hoping the Resuming event would do it, but no. Which event should I use?
http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.application.resuming.aspx

For the whole app, check Window.Activated, for individual pages you can use Page.OnNavigatedFrom / Page.OnNavigatedTo.

Related

Sentry.io Transactions Firing when tab loses focus

Using the Sentry Javascript SDK in a Vue web application, I am trying to log a user interaction.
The transaction should begin when the page being monitored is loaded and end when the user presses a Continue button.
I am calling Sentry.startTransaction when the page is loaded and .finish() on the created transaction object after user presses the continue button.
This works great in all scenarios except if the user switches tabs while this interaction is being monitored. If the user switches tabs after page loads but before pressing the continue button, Sentry immediately sends the transaction in a network request to be logged. The code calling .finish() is not executed, it appears to be a native Sentry behavior to auto-close all transactions when the tab loses focus.
If the user returns to the page and completes the interaction by pressing the button, the code calling .finish() is executed but Sentry does not make a network request to log the interaction.
Is this behavior a setting with Sentry?
I have searched for Sentry documentation explaining this "tab loses focus" behavior but have found nothing. I would expect that custom defined transactions using Sentry can be monitored whether or not the tab is in focus.

Pattern for navigating to same screen with different action in React-Native?

I have 2 different modules/features that will navigate to the same screen, and that screen is a form with a button to submit. The problem is:
If user presses "submit" when navigated from the Module 1, the user's input will just be stored (client-side)
If user presses "submit" when navigated from the Module 2, the user's input will be sent to server
How can I achieved this? My solution is passing the module name as route param and handle the condition logic at the target screen. However, it will make the target screen has more complicated logic, and modules will depend on each other. I wonder if there is any better solution?

Is it possible to detect if the user can go back?

Basically, I need to replicate the browser back button on my app (I do not want it, but I need to do it :/)
On durandal, I can navigate back by calling router.navigateBack();. But there is not always a page back (the browser back button get disabled when there is not). So, it is possible to detect if there is a previous page?
I am thinking in creating a simple counter that increments when the user navigate and decrement when it clicks on my "back" button, but I do not now how can I detect the user clicked the browser back button. If there is some way to know that there is not any previous page, it would be nice.
I was able to do this by intercepting the router.on('router:route:activating') event. When the user navigate, I increment a variable, when he goes back (router.navigatingBack will be true even if he clicked on the browser back button!) I decrement it. When it is 0, I disable the go back button.

Detecting last value of database after refresh the application

I am making an iPad app. I have got some problem. Actually I want to show one view at the starting of the app after launching of splash screen. I have made one checkbox on it. It will work as on/off button. Very first time launching of the app, this screen will show to the user. If user click the off button then this screen will never show to him even after refresfing the app. For it, I have made a database table in which at the starting I have stored 0 value in it. When user click button then it becomes 1. But whenever user will refresh the app it becomes again zero but I want to retrieve the last value from the database. Anyone has idea that how to retrieve last value from database table even after refreshing the app.
Thanks to all.
You really should use user defaults for this purpose. There is a method, registerDefaults that is used to set initial values for a default, but once the user has changed it, that initial value isn't used again on subsequent launches of the app

Application hangs on clicking "Choose" button in IKPictureTaker view

I am facing a strange hang issue with IKPictureTaker and on clicking a "Choose" button. I am doing below operation using IKPictureTaker.
When a user wants to change a profile picture, upon clicking "Change Image" button, I display a IKPictureTaker view along with "Choose" button by setting IKPictureTakerAllowsFileChoosingKey to YES.
First time on clicking the "Choose" button, open panel will be displayed allowing user to select an image of his choice.
Next, on clicking the "Set" button, internally I am calling a profile picture upload function of a server in a separate thread and everything works great.
Next if the user tries to do the operation 1) and 2) again application hangs on clicking the "Choose" button.
After investigation I found that this issue is something to do with the background upload operation I am doing with the server.Because if I comment the upload part of code everything looks good.
I don't see any issues with the upload operation performed in the separate thread and it gives up it s runloop once it is done with its upload operation and all UI related operations again taken care in the main thread.
Application hangs only if I click on the "Choose" button. If I select the recent pictures or take a new photo using the camera everything works great.
Is there anyone who faced the same issue? Is it something to do with the NSOpenPanel displayed when we click on the "Choose" button?