Authentication ios 6 objective c - ios6

I am working on iOS 6, ARC,storyboards enable iphone app. I am trying to figure out log out functionality and what should happen when user wants to log out. I have a menu like Facebook and a log out option with in the menu. To mimic the menu I am using ECSlidingViewController.
What I really want to find out is, what actually should happen when user logs out in terms of bringing applicaition to it's launch state with nothing in memory.
thank you

When user logs out you usually do the following:
Pop to the root view controller or (main menu / login screen).
Clear out all user data saved in db or userDefaults.

You could use popToRootViewControllerAnimated: to have all your view controllers popped except the original root view controller and then the display will update.

Related

Google Analytics Goal Funnel Count has number differences with Production Data

I have this funnel visualization problem in Google Analytics. I have set up the funnel using the virtual pageview like so:
So basically what it tracks is that in activity page, when user clicks a button, it will show up a modal for registration and hits the /activity/virtual/open-volunteer-modal. After they fill out the forms, they click Register, and it will hits the /activity/virtual/submit-volunteer-modal.
Everything was fine, until I saw some difference in GA and Production values.
In GA, there are 3000 users that filled out the forms and submit their data. I was totally happy seeing this, but:
In Production DB, I only got 1906 users submitting their data.
I checked the code, and there is nothing wrong with it. It basically send a virtual page view when the value has been validated, so my question is how is this possible and is there any way to fix this? Or is it just intended behavior?
After further investigation, I found that some of the buttons that has open-volunteer-modal event is redirecting to submit-volunteer-modal. Hence, the submit-volunteer-modal value was bigger than the open.
Should have sipped some coffee first before working.

stop Angular from running the rest of the script and perform another action

I've been working on replacing alert() pop-ups in our Angular code with Angular overlay modals. I'm almost done with the exception of one problem.
I have a modal that opens when the user login has timed out. Some pages will load, fire the script properly and the overlay will be in focus, waiting for the user to click "ok" which sends them to the login page - which is what I want.
On other pages, content will partially load, then fire the overlay modal and for a split second I will see it, then the page continues to load, the modal goes away and even though they get logged out the page doesn't go to the login page.
I need some direction determining what code I should add after the overlay fires to prevent any other code from executing so the user has to interact with the overlay.
I'm sorry I can't share any code - it's proprietary - I just need some direction to go in.
This is very difficult to answer without having access to any code or fully understanding how you are managing various states/views.
A simple solution would be adding a function to the $rootScope which constantly checks if a user is authenticated (aka not timed out). And then have it perform some action if the user is no longer authenticated.
How you store the authentication indicator is completely up to you. Without knowing more about the app it would be difficult to say where the best place would be.
Example code:
$rootScope.checkAuth(){
if (!$sessionStorage.auth){
$state.go(login)
}
}
setTimeout($rootScope.checkAuth,10000)
You could also handle this by not resolving each view/state until a user has been confirmed as authenticated. Once again, how you set that up would be dependent on the structure of your app.

CocoonJS webview: Going back a page

I'm just trying out a simple app in the CocoonJS launcher which contains some links that open some external page.
This works fine, but the problem is that I can't identify a way to go back a page (i.e. history back). The launcher app just displays the page in fullscreen, no user controls visible at all. This is troublesome, because when my users tap on an ad, I want them to be able to go back to the game.
Am I missing something or is this simply not supported?
I do not know of any way to display a navigation bar or something similar.
Nevertheless, you can open your external urls via Cocoon.App.openURL(url); which will enable the user to open it via a normal browser where you can navigate back.
Regards.
I agree with the solution proposed by Scdev. Also, interstitials or fullscreen ads usually have a dismiss button themselves. I might be misunderstanding something.
Regards,
Iker.

How to integrate payment gateway in applications created using javascript frameworks like ExtJs?

Our application is a one-page application created using ExtJs. For any user action, the browser tab is never reloaded and all the actions are performed using ajax. A user can open/close multiple ExtJs windows/panels within the same browser tab, and this way everything remains confined to the same browser tab.
Now, we need to integrate payment gateway in the application, which involves redirecting the user to the bank website and having her brought back to our application.
The issue is that when browser redirects the user, then all the application javascript code along with panels and windows get destroyed, and when the user comes back to the application then she finds it to be different from one she left.
As a solution to this, we were thinking of using following two appraoches:
Option 1. Maintaining the state of application - When user leaves for the bank's website then somehow we maintain the state of application - like which windows are opened carrying what data, which variables have which values etc.. and when user returns back, we generate the same application state for her.
Option 2. Have a browser pop-up window for payment gateway - We intend to provide a button which will open a small pop-up window carrying the transaction details, and in this pop-up window the entire payment gateway process will take place taking care of redirection and everything.
Option 1 is proving to be very cumbersome and complicated as maintaining the exact state is not getting feasible.
For Option 2, we are not sure if this is safe and possible?
Has anyone implemented such an approach earlier. Otherwise, what are the other options which we can go for?
Thanks for any help in advance.
I faced the problem and I implemented it using websocket/polling in the main application while a new window pops up for the payment.
After the payment is successful the main application will be notified.
That way each payment runs in it own sandbox totally unbound from the main application which makes maintenance quite easy. Note that our backend create a new session for each payment using the existing one.
I think it is not uncommon to open new windows for payment that's why I decided to go this.

Windows Phone show ConnectionSettingsTask and back

I am working on a windows phone app right now.
In the app, I am handling an exception in page 1, that when there is no wifi connection, it will pop a XNA messagebox, user can choose to open the WIFI settings page. I have the following code:
ConnectionSettingsTask connectionSettingsTask = new ConnectionSettingsTask();
connectionSettingsTask.ConnectionSettingsType = ConnectionSettingsType.WiFi;
connectionSettingsTask.Show();
But the problem with this is, when user hit back key in the wifi settings page, they will be navigate back to page 1, which has a loading problem and can not display the proper content. In this case, I would like user to directly go to another page, call it page 2.
Is that possible? Thank you
++++++++++++++Update
Is there are way to customize the back key functionality when showing the XNA messagebox?
I don't know about XNA coding much, but I do know that if you return from wifi connection page to your app, the OnNavigatedTo function is invoked. Try setting out your flow of code according to the application flow. If there is some code you have executed at the constructor, shift it to OnNavigatedTo and vice-verse, which may solve your problem. Also if you want to shift to another page, do it in the same function (OnNavigatedTo) itself. Hope it helps.
Maybe you can change the navigation behavior: http://blogs.msdn.com/b/ptorr/archive/2010/08/28/redirecting-an-initial-navigation.aspx
However it is recommended to merge the two pages together (hide loading bar and show main page) as you will have less problems...
why not handle this code in the IsNetworkAvailable check? that way you'l avoid the exception altogether

Resources