Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import ParseFacebookUtilsV4
- import Parse
- import UIKit
- class ViewController: UIViewController {
- override func viewDidLoad() {
- super.viewDidLoad()
- let permissions = ["public_profile"]
- PFFacebookUtils.logInInBackgroundWithReadPermissions(permissions) {
- (user: PFUser?, error: NSError?) -> Void in
- if let user = user {
- if user.isNew {
- print("User signed up and logged in through Facebook!")
- } else {
- print("User logged in through Facebook!")
- }
- } else {
- print("Uh oh. The user cancelled the Facebook login.")
- }
- }
- }
- import UIKit
- import CoreData
- import Parse
- import Bolts
- import FBSDKCoreKit
- import ParseFacebookUtilsV4
- @UIApplicationMain
- class AppDelegate: UIResponder, UIApplicationDelegate {
- var window: UIWindow?
- func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool
- {
- Parse.enableLocalDatastore()
- // Initialize Parse.
- Parse.setApplicationId("removed",
- clientKey: "removed")
- PFFacebookUtils.initializeFacebookWithApplicationLaunchOptions(launchOptions)
- return true
- }
- func application(application: UIApplication,
- openURL url: NSURL,
- sourceApplication: String?,
- annotation: AnyObject) -> Bool {
- return FBSDKApplicationDelegate.sharedInstance().application(application,
- openURL: url,
- sourceApplication: sourceApplication,
- annotation: annotation)
- }
- <plist version="1.0">
- <dict>
- <key>LSApplicationQueriesSchemes</key>
- <array>
- <string>fbapi</string>
- <string>fb-messenger-api</string>
- <string>fbauth2</string>
- <string>fbshareextension</string>
- </array>
- <key>NSAppTransportSecurity</key>
- <dict>
- <key>NSExceptionDomains</key>
- <dict>
- <key>facebook.com</key>
- <dict>
- <key>NSIncludesSubdomains</key>
- <true/>
- <key>NSExceptionRequiresForwardSecrecy</key>
- <false/>
- </dict>
- <key>fbcdn.net</key>
- <dict>
- <key>NSIncludesSubdomains</key>
- <true/>
- <key>NSExceptionRequiresForwardSecrecy</key>
- <false/>
- </dict>
- <key>akamaihd.net</key>
- <dict>
- <key>NSIncludesSubdomains</key>
- <true/>
- <key>NSExceptionRequiresForwardSecrecy</key>
- <false/>
- </dict>
- </dict>
- </dict>
- <key>CFBundleURLTypes</key>
- <array>
- <dict>
- <key>CFBundleURLSchemes</key>
- <array>
- <string>removed</string>
- </array>
- </dict>
- </array>
- <key>FacebookAppID</key>
- <string>removed</string>
- <key>FacebookDisplayName</key>
- <string>removed</string>
- <key>CFBundleDevelopmentRegion</key>
- <string>en</string>
- <key>CFBundleExecutable</key>
- <string>$(EXECUTABLE_NAME)</string>
- <key>CFBundleIdentifier</key>
- <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>CFBundleName</key>
- <string>$(PRODUCT_NAME)</string>
- <key>CFBundlePackageType</key>
- <string>APPL</string>
- <key>CFBundleShortVersionString</key>
- <string>1.0</string>
- <key>CFBundleSignature</key>
- <string>????</string>
- <key>CFBundleVersion</key>
- <string>1</string>
- <key>LSRequiresIPhoneOS</key>
- <true/>
- <key>UILaunchStoryboardName</key>
- <string>LaunchScreen</string>
- <key>UIMainStoryboardFile</key>
- <string>Main</string>
- <key>UIRequiredDeviceCapabilities</key>
- <array>
- <string>armv7</string>
- </array>
- <key>UISupportedInterfaceOrientations</key>
- <array>
- <string>UIInterfaceOrientationPortrait</string>
- <string>UIInterfaceOrientationLandscapeLeft</string>
- <string>UIInterfaceOrientationLandscapeRight</string>
- </array>
- </dict>
- </plist>
- canOpenURL: failed for URL: "fbauth2:///" - error: "(null)"
- -canOpenURL: failed for URL: "fbauth2:///" - error: "(null)"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement