通过按( - )而不是主页按钮关闭iPhone应用程序时将调用的委托方法是什么 [英] What is the delegate method that will called when closing an iPhone app by pressing (-) not the home button

查看:145
本文介绍了通过按( - )而不是主页按钮关闭iPhone应用程序时将调用的委托方法是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个应用程序,我已经嵌入了Facebook登录。我想注销用户,当用户在进入后台关闭应用程序后,按( - )不是主页按钮。所以我计划在应用程序关闭时调用的委托方法调用注销方法。我以为是 ApplicationWillTerminate 方法。但它不工作。有没有人知道什么是委托方法或者在哪里应该叫做logout方法?

I'm developing an app and I have embedded facebook login in to that. I want to logout the user, when user closing the application after enter to the background, by pressing (-) not the home button. So I planned to calling the logout methods in the delegate method which called when application closing. I was thought that it was ApplicationWillTerminate method. But it is not working. Does anyone know what is the delegate method or where should I called logout methods ?

推荐答案

在info.plist文件中设置变量
应用程序不在后台设置中运行yes
like this

set variable in info.plist file Application does not run in background set yes like this

- (void)applicationWillTerminate:(UIApplication *)application
{
    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
this method called when application enter background

这篇关于通过按( - )而不是主页按钮关闭iPhone应用程序时将调用的委托方法是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆