How to detect when user delete the app from Facebook

南楼画角 提交于 2019-12-04 03:53:46

问题


I'm new to using the Facebook SDK and I wondered how detect when the user deletes the app from his Facebook account. Currently if we delete the app, and we want to post something from my app, I'm getting an error message.


回答1:


Try this:

[FBSession renewSystemCredentials:^(ACAccountCredentialRenewResult result, NSError *error) {
    if (!error) {
        if (result == ACAccountCredentialRenewResultRejected) {
            NSLog(@"Facebook app deleted");
        }
    }
    else {
        NSLog(@"Error: %@", error);
    }
}];



回答2:


http://developers.facebook.com/docs/authentication/#app-deauthorization

  • https://developers.facebook.com/apps/
  • go to your app's edit screen
  • click on advanced in the left side column
  • 'Deauthorize Callback' setting should be near the top

App Deauthorization

When a user of your app removes it in the App Dashboard or blocks the app in the News Feed, your app can be notified by specifying a Deauthorize Callback URL in the Developer App. During app removal we will send an HTTP POST request containing a single parameter, signed_request, which contains the user id (UID) of the user that just removed your app. You will not receive an user access token in this request and all existing user access tokens will be automatically expired.



来源:https://stackoverflow.com/questions/8611709/how-to-detect-when-user-delete-the-app-from-facebook

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!