Skip to content

Update Init for Facebook #389

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion en/common/errors.mdown
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,9 @@ The following is a list of all the error codes that can be returned by the Parse
| `InefficientQueryError` | 154 | An inefficient query was rejected by the server. Refer to the Performance Guide and slow query log. |
| `RequestLimitExceeded` | 155 | This application has exceeded its request limit. Please retry in one minute or raise your request limit at https://parse.com/account. Check error message for more details. |
| `TemporaryRejectionError` | 159 | An application's requests are temporary rejected by the server. |
| `DatabaseNotMigratedError` | 428 | You should migrate your database as soon as possible. |

If your requests are rejected with a 155 error code, your application may be [exceeding its request limit](/plans/faq#request-limit-exceeded). You can learn more about [how the request limit is calculated in the Pricing FAQ](/plans/faq#how-are-requests-per-second-calculated). If waiting one minute or [increasing the request limit](/plans/faq#increasing-request-limit) does not resolve the issue, [please file a bug report](https://parse.com/help#report). If your requests are being rejected with a 159 error code, [please file a bug report](https://parse.com/help#report) for further instructions on how to resolve the issue.
If your requests are rejected with a 155 error code, your application may be [exceeding its request limit](/plans/faq#request-limit-exceeded). You can learn more about [how the request limit is calculated in the Pricing FAQ](/plans/faq#how-are-requests-per-second-calculated). If waiting one minute or [increasing the request limit](/plans/faq#increasing-request-limit) does not resolve the issue, [please file a bug report](https://parse.com/help#report). If your requests are being rejected with a 159 error code, [please file a bug report](https://parse.com/help#report) for further instructions on how to resolve the issue. If your requests are rejected with a 428 error code, please [migrate your database](https://parse.com/migration) as soon as possible.

## Other issues

Expand Down
47 changes: 31 additions & 16 deletions en/ios/users.mdown
Original file line number Diff line number Diff line change
Expand Up @@ -485,10 +485,19 @@ There's also two code changes you'll need to make. First, add the following to y
import FBSDKCoreKit
import ParseFacebookUtilsV4

// AppDelegate.swift
// AppDelegate.swift (Swift 3)
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
Parse.setApplicationId("parseAppId", clientKey:"parseClientKey")
PFFacebookUtils.initializeFacebookWithApplicationLaunchOptions(launchOptions)

//your other app delegate stuff

// Initialize Parse.
let configuration = ParseClientConfiguration {
$0.server = "https://parse.myserver.com/1"
$0.applicationId = "myapplicationid"
$0.isLocalDatastoreEnabled = true //if desired
}
Parse.initialize(with: configuration)
PFFacebookUtils.initializeFacebook(applicationLaunchOptions: launchOptions)
}
```

Expand All @@ -510,20 +519,26 @@ Next, add the following handlers in your app delegate.
}
```
```swift
func application(application: UIApplication,
openURL url: NSURL,
sourceApplication: String?,
annotation: AnyObject?) -> Bool {
return FBSDKApplicationDelegate.sharedInstance().application(application,
openURL: url,
sourceApplication: sourceApplication,
annotation: annotation)
public func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
return FBSDKApplicationDelegate.sharedInstance().application(
app,
open: url as URL!,
sourceApplication: options[UIApplicationOpenURLOptionsKey.sourceApplication] as! String,
annotation: options[UIApplicationOpenURLOptionsKey.annotation]
)
}


//Make sure it isn't already declared in the app delegate (possible redefinition of func error)
func applicationDidBecomeActive(application: UIApplication) {
FBSDKAppEvents.activateApp()
public func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
return FBSDKApplicationDelegate.sharedInstance().application(
application,
open: url as URL!,
sourceApplication: sourceApplication,
annotation: annotation
)
}
//You probably already have the following function created by the AppDelegate template. Just add the FB function
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.
FBSDKAppEvents.activateApp()
}
```

Expand Down