i have the default login button of fbconnect sdk . i tap it and i connect then i post to my facebook profile something. when the post is finished i see that the button has changed to logout . how can i detect when the user presses the logout button in order to dissapear another button i have on my uiview?
The obvious and easiest way is to know what is the status of the button. If the user is already loggined, the status of the button will say "Log out", and when user clicks on it, you just handling the event and call logout.
Now, how can you know that user is loggined? There is a method in FBConnect in FBSession classes.
[_session isConnected]; returns true if user is loggined and return false if user is not. And I think that you already have stored your session variable somewhere to call login
Related
I just want to show an alert when user just quit the application before application entering the background, how can I do that??
If I show the alert in applicationDidEnterBackground:(UIApplication *)application method then this alert will be shown when we again resume the application, but I need to show the alert before the application enters the background.
You can't do this, and rightly so. When the user presses the home button, they go to the home screen. This is a fundamental part of the iOS user experience. Nothing stops the home button working.
applicationWillResignActive and applicationWillTerminate may be of interest to this general question—but you can't present anything into the UI once the home button is pressed. These methods do let you briefly run any critical code however, while the home screen is being presented to the user.
I know how to open a tel:// URL so that I can launch a call on an iPhone, but I'm wondering if there's a way to just have the phone app launch and wait for the user to press the call button.
Is this possible?
what i do is present a UIAlertView asking for confirmation ... if the user presses Call then i go ahead with the request... If he presses Cancel the app does nothing other than removing the alert view from screen ...
I have a login screen which is saying "SingnIn" when user is clicking on that he getting a pop of facebook login screen.
I want that if somebody successfully logged in, I want to change SignIn text with their name. But I am not getting place where I should write that part of code. Which view function load again after pop screen exit.
If you implemented facebook connect and if you meant facebook login then after login you can write code in facebook delegate method.
- (void)session:(FBSession*)session didLogin:(FBUID)uid {
//Write code here for changing label for user name
}
Could anyone please tell me how to handle push notification dialog's view and close button click from my application? I have gone through this thread which says to handle it in ViewDidLoad but when I click View button, this method doesn't get invoked. I want to do take user to some particular view on View button click and record the Close button click on my Server. So basically I want to know what happens when this button(s) clicked? I have gone through Apple docs but it nothing say about these actions. Any documentation and/or code sample would be really greatful.
Thanks.
If user clicks view then you can catch that action in didFinishLaunchWithOptions method of AppDelegate class. If user clicks close then, there is no way for application to catch that. If your application didn't get the notification in AppDelegate class, then either you forgot to register your app for push notification or you didn't send push notification properly to APNS.
I have an application wherein when the user taps iPhone's central button, the application is sent to background, but I want it to be closed.
I can hand event and close it, but may be there is some configuration setting to deny running in the background?
Thank you
If you want your app to terminate when the user presses the home button, set the value of UIApplicationExitsOnSuspend to YES in your app's Info.plist file. If you do this, when the user taps the home button the applicationWillTerminate: method of your app delegate will be called and then your application will terminate.