Advertisement
Guest User

Untitled

a guest
Oct 6th, 2015
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.27 KB | None | 0 0
  1. import ParseFacebookUtilsV4
  2. import Parse
  3. import UIKit
  4.  
  5.  
  6. class ViewController: UIViewController {
  7.  
  8. override func viewDidLoad() {
  9. super.viewDidLoad()
  10.  
  11. let permissions = ["public_profile"]
  12. PFFacebookUtils.logInInBackgroundWithReadPermissions(permissions) {
  13. (user: PFUser?, error: NSError?) -> Void in
  14. if let user = user {
  15. if user.isNew {
  16. print("User signed up and logged in through Facebook!")
  17. } else {
  18. print("User logged in through Facebook!")
  19. }
  20. } else {
  21. print("Uh oh. The user cancelled the Facebook login.")
  22. }
  23. }
  24.  
  25.  
  26. }
  27.  
  28. import UIKit
  29. import CoreData
  30. import Parse
  31. import Bolts
  32. import FBSDKCoreKit
  33. import ParseFacebookUtilsV4
  34.  
  35. @UIApplicationMain
  36. class AppDelegate: UIResponder, UIApplicationDelegate {
  37.  
  38. var window: UIWindow?
  39.  
  40.  
  41. func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool
  42. {
  43.  
  44. Parse.enableLocalDatastore()
  45. // Initialize Parse.
  46. Parse.setApplicationId("removed",
  47. clientKey: "removed")
  48.  
  49. PFFacebookUtils.initializeFacebookWithApplicationLaunchOptions(launchOptions)
  50.  
  51.  
  52. return true
  53. }
  54.  
  55. func application(application: UIApplication,
  56. openURL url: NSURL,
  57. sourceApplication: String?,
  58. annotation: AnyObject) -> Bool {
  59. return FBSDKApplicationDelegate.sharedInstance().application(application,
  60. openURL: url,
  61. sourceApplication: sourceApplication,
  62. annotation: annotation)
  63. }
  64.  
  65. <plist version="1.0">
  66. <dict>
  67. <key>LSApplicationQueriesSchemes</key>
  68. <array>
  69. <string>fbapi</string>
  70. <string>fb-messenger-api</string>
  71. <string>fbauth2</string>
  72. <string>fbshareextension</string>
  73. </array>
  74. <key>NSAppTransportSecurity</key>
  75. <dict>
  76. <key>NSExceptionDomains</key>
  77. <dict>
  78. <key>facebook.com</key>
  79. <dict>
  80. <key>NSIncludesSubdomains</key>
  81. <true/>
  82. <key>NSExceptionRequiresForwardSecrecy</key>
  83. <false/>
  84. </dict>
  85. <key>fbcdn.net</key>
  86. <dict>
  87. <key>NSIncludesSubdomains</key>
  88. <true/>
  89. <key>NSExceptionRequiresForwardSecrecy</key>
  90. <false/>
  91. </dict>
  92. <key>akamaihd.net</key>
  93. <dict>
  94. <key>NSIncludesSubdomains</key>
  95. <true/>
  96. <key>NSExceptionRequiresForwardSecrecy</key>
  97. <false/>
  98. </dict>
  99. </dict>
  100. </dict>
  101. <key>CFBundleURLTypes</key>
  102. <array>
  103. <dict>
  104. <key>CFBundleURLSchemes</key>
  105. <array>
  106. <string>removed</string>
  107. </array>
  108. </dict>
  109. </array>
  110. <key>FacebookAppID</key>
  111. <string>removed</string>
  112. <key>FacebookDisplayName</key>
  113. <string>removed</string>
  114. <key>CFBundleDevelopmentRegion</key>
  115. <string>en</string>
  116. <key>CFBundleExecutable</key>
  117. <string>$(EXECUTABLE_NAME)</string>
  118. <key>CFBundleIdentifier</key>
  119. <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
  120. <key>CFBundleInfoDictionaryVersion</key>
  121. <string>6.0</string>
  122. <key>CFBundleName</key>
  123. <string>$(PRODUCT_NAME)</string>
  124. <key>CFBundlePackageType</key>
  125. <string>APPL</string>
  126. <key>CFBundleShortVersionString</key>
  127. <string>1.0</string>
  128. <key>CFBundleSignature</key>
  129. <string>????</string>
  130. <key>CFBundleVersion</key>
  131. <string>1</string>
  132. <key>LSRequiresIPhoneOS</key>
  133. <true/>
  134. <key>UILaunchStoryboardName</key>
  135. <string>LaunchScreen</string>
  136. <key>UIMainStoryboardFile</key>
  137. <string>Main</string>
  138. <key>UIRequiredDeviceCapabilities</key>
  139. <array>
  140. <string>armv7</string>
  141. </array>
  142. <key>UISupportedInterfaceOrientations</key>
  143. <array>
  144. <string>UIInterfaceOrientationPortrait</string>
  145. <string>UIInterfaceOrientationLandscapeLeft</string>
  146. <string>UIInterfaceOrientationLandscapeRight</string>
  147. </array>
  148. </dict>
  149. </plist>
  150.  
  151. canOpenURL: failed for URL: "fbauth2:///" - error: "(null)"
  152. -canOpenURL: failed for URL: "fbauth2:///" - error: "(null)"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement