Must openSessionWithAllowLoginUI only when click Facebook login button in iOS - ios

After implementing Facebook login with success in iOS, I need now to call the loginUI only when the user click on the login button. I do not know the right place in my code to call the openSessionWithAllowLoginUI method. I have placed it at viewDidLoad, but it calls the loginUI without user click and don't want this. Anyone?

After trying many possible solutions to handle the login button, I found the better way to do this. Had implemented my own button with the same appearance of the original button and attached the action.

Related

Devise messages still display when i go to other page and go back through back button

i have a problem about devise messages. When i sign in into my page, a notice messages "welcome to my blogs" show up and if i go to another page and go back through button back in browser, i still got this message, how to make is disappear? I know we can do it by refresh any page when back button pressed, but i don't want to do that, any one have another ideal for my problem?
You probably didn't do a check to dismiss this notification upon user logged in.
You can check this link on how to do that. https://coderwall.com/p/b5lhog/ignore-turn-off-devise-config-reconfirmable-while-saving-email-in-update-action
To style your notification as well you need this. I have used this video multiple times on different projects. https://www.youtube.com/watch?v=87fBAWc25Sk

Facebook logout button (iOS SDK) proper segue upon logging out

I have ran into some trouble when using facebooks login framework. Logging in is fine, simple and works. My problem is when I click the FBSK logout button there is a verification (are you sure...) that pops up which stops me from using an action segue - what if the user says no, how can you ensure the segue runs only on confirmation?
So I am puzzled as to how to segue from one controller after the logout is successful because putting code in the viewDidAppear function doesn't work because the view isn't being refreshed, only the label changing from 'logout' to 'login'.
Update: Opted for #IBAction methods and used FBSDKLoginManager.logOut() to logout, however this removes the verification part and also opens the login pop-up straight away.
So I am still open to any suggestions.
The comment on your question is correct, get your view controller to conform to FBSDKLoginButtonDelegate and then control-click it to inspect the header file for your version of the SDK and what methods to implement.
Don't forget to tell your button its delegate is your view controller.

iOS FBSDKLogin Button text fade-in

So I'm using Facebook's FBSDKLoginButton to create a button that will authenticate the user with Facebook. However, it seems by default the button has an animation on it that fades in the text. This looks great and all, but my other buttons don't have this effect, so there's a discrepancy there. Any way to remove this fade in (or replicate it on my other buttons with the exact timing and style as the fb button)?
If you want you own interface effects and styling instead of the drag and drop vanilla Button supplied by FB I suggest you use FBSDKLoginManager instead of FBSDKLoginButton so you call the API yourself to perform login or additional authorisations with your own UI.
You can find more details here: https://developers.facebook.com/docs/facebook-login/ios/v2.3
Edit: If I have time over the weekend I'll update this answer with how this will looking in code. Fri - 5/JUN/15

How to remove GPPSignInButton's default style (text, G+ image) to add your own in iOS

We're using the GGPSignInButton to log into GooplePlus service.
we want to have a custom look and feel for the button, but I couldn't find a way to turn off the text and image that show up with the button automatically when I tell a UIButton he is of a kind GPPSignInButton. Here's how it looks when I add my own design inside an otherwise empty button which is GPPSignInButton:
The only way I've been able to make it disappear is pretty patchy:
(First wire up the button to a IBOutlet called gPlusButton)
[self.gPlusButton.subviews[0] removeFromSuperview];
I also tried using my own button, and when pressed calling manually to
[[GPPSignIn sharedInstance] authenticate]
method seems to result in an incorrect login (for example, the login token isn't saved into the key chain Google+ later uses to silently authenticate me).
Does anyone know of a better way to design my own style for the button?
BTW it appears this is supported for web sign in buttons.
Just don't use the GPPSignInButton! Your idea of calling authenticate directly is correct - just make sure you are configuring the shared instance (including the delegate and so on) before calling authenticate.

How to implement a loading screen or multithreading in iOS?

I have a login-screen.
After the user enters his credentials, he clicks on "Login" to login.
Now in the background with the login there will be a load of a few things, so it need around 3 seconds to display the next view.
How to solve that the screen is not freezing within this 3 seconds?
I had the idea to solve this by a loading screen (Typical for iPhone Apps) or shange the clicked button to "Try to Login...", so the user is not only thinking "has my click worked or should I click again"...
I hope its understandable...
Whats to do?
I suggest to use MBProgressHUD its show an indicator with label if you want like "loading" for example and disable the user action on the view also its easy to use and has a good/simple interface.
you can find it on this link

Resources