我在我的swift項目中使用SVProgressHUD
作爲框架。它在iOS 8中工作正常。我在我的應用程序中使用Facebook登錄。每當我使用登錄SVProgressHUD
不顯示整個應用程序。但是,當我殺了應用程序,並推出SVProgressHUD
將工作正常。我已經在info.plist中添加了必需的密鑰。我無法弄清楚這個問題。請任何人提供解決方案。當應用程序使用Facebook登錄時,SVProgressHud未在iOS 9中顯示
編輯:如果我將「loginbehaviour」更改爲Web和SystemAccount。它工作正常。
環境 FBSDK
: - 4.8.0 XCode
: - 6.4,1.2斯威夫特
LoginViewController.swift
func loginButton(loginButton: FBSDKLoginButton!,
didCompleteWithResult
result: FBSDKLoginManagerLoginResult!,
error: NSError!) {
SVProgressHUD.showWithStatus(NSLocalizedString("LOGIN_PROGRESS_MSG", comment: ""))
if (error != nil) {
DDLogError("FB Login error: \(error.localizedDescription)")
SVProgressHUD.showErrorWithStatus(NSLocalizedString(error.localizedDescription, comment: ""))
} else if result.isCancelled {
DDLogError("FB Login cancelled")
SVProgressHUD.showErrorWithStatus(NSLocalizedString("Login cancelled", comment: ""))
} else {
DDLogDebug("FB Login success")
SVProgressHUD.showWithStatus(NSLocalizedString("FB_USER_FETCH_MSG", comment: ""))
returnUserData()
}
}
Appdelegate.swift
let fbLaunch = FBSDKApplicationDelegate.sharedInstance().application(application,
didFinishLaunchingWithOptions: launchOptions) // Added this method in didFinishLaunchingWithOptions method
還實施
func application(application: UIApplication,
openURL url: NSURL,
sourceApplication: String?,
annotation: AnyObject?) -> Bool {
return FBSDKApplicationDelegate.sharedInstance().application(
application,
openURL: url,
sourceApplication: sourceApplication,
annotation: annotation)
}
func applicationDidBecomeActive(application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
LocationManager.sharedInstance.startLocationManger()
FBSDKAppEvents.activateApp()
//Send device token change
APNSManager.validateAndUpdateAPNSToken()
//Look for APNS payload in background if we have saved any
APNSManager.handlePendningAPNSPayloads()
}
我已經試過這個。但不工作 –