ios - Issue with Parse & Facebook -
i started develop app using parse , facebook. i've added both sdks.
this viewcontroller code(the fblogin button of "connect facebook"):
class viewcontroller: uiviewcontroller { override func viewdidload() { super.viewdidload() } override func didreceivememorywarning() { super.didreceivememorywarning() // dispose of resources can recreated. } @ibaction func fblogin(sender: anyobject) { var permissions = ["email"] pffacebookutils.logininbackgroundwithreadpermissions(permissions) { (user: pfuser?, error: nserror?) -> void in if let user = user { if user.isnew { println("user signed , logged in through facebook!") } else { println("user logged in through facebook!") } } else { println("uh oh. user cancelled facebook login.") } } }}
this app delegate code:
import uikit import parse import bolts @uiapplicationmain class appdelegate: uiresponder, uiapplicationdelegate { var window: uiwindow? func application(application: uiapplication, didfinishlaunchingwithoptions launchoptions: [nsobject: anyobject]?) -> bool { // override point customization after application launch. parse.setapplicationid("*cencored id*", clientkey: "*cencored clientkey*") pffacebookutils.initializefacebookwithapplicationlaunchoptions(launchoptions) return true } func applicationwillresignactive(application: uiapplication) { // sent when application move active inactive state. can occur types of temporary interruptions (such incoming phone call or sms message) or when user quits application , begins transition background state. // use method pause ongoing tasks, disable timers, , throttle down opengl es frame rates. games should use method pause game. } func applicationdidenterbackground(application: uiapplication) { // use method release shared resources, save user data, invalidate timers, , store enough application state information restore application current state in case terminated later. // if application supports background execution, method called instead of applicationwillterminate: when user quits. } func applicationwillenterforeground(application: uiapplication) { // called part of transition background inactive state; here can undo many of changes made on entering background. } func applicationdidbecomeactive(application: uiapplication) { // restart tasks paused (or not yet started) while application inactive. if application in background, optionally refresh user interface. fbsdkappevents.activateapp() } func applicationwillterminate(application: uiapplication) { // called when application terminate. save data if appropriate. see applicationdidenterbackground:. } func application(application: uiapplication, openurl url: nsurl, sourceapplication: string?, annotation: anyobject?) -> bool { return fbsdkapplicationdelegate.sharedinstance().application(application, openurl: url, sourceapplication: sourceapplication, annotation: annotation) }
}
this bugs: http://i.imgur.com/gztyg3k.png
what can fix it?
i had similar experience. frameworks in project, check see if have parsefacebookutils.framework , parsecrashreporting.framework. if do, remove them project. need parsefacebookutilsv4.framework though, leave in there.
Comments
Post a Comment