background preloader

Facebook test framework

Facebook Twitter

Users. Updated on Mon, 2013-05-20 08:28 Users can be anyone or anything.

Users

They tweet, follow, create lists, have a home_timeline, can be mentioned, and can be looked up in bulk. Field Guide Consumers of Users should tolerate the addition of new fields and variance in ordering of fields with ease. Not all fields appear in all contexts. 3 - Invites and Requests. Next, let's look at enabling cross-platform game state persistence to the game using Parse.

3 - Invites and Requests

Up until now, the coins collected and bombs used within Friend Smash have been limited to an individual game session and device. An initial number of coins and bombs are allocated to the player at the start of the game, but any changes to those quantities were lost between play sessions and between devices. It would be preferable to save this data to a remote storage location, so that it later could be retrieved for the user. This would provide the player with a greater sense of continued progress within the game. Furthermore, if we were to build out versions of Friend Smash for platforms other than iOS, we could have them all persist data to the same backend, allowing the player to continue with the same experience regardless of the device they are using at a given time.

Saving data to a remote server is traditionally a non-trivial task, requiring a significant investment of development time. Add. Login as an App. Facebook's official SDKs manage the lifetime of tokens for you.

Login as an App

When using iOS, Android or our JavaScript SDK, the SDK will handle making sure that tokens are refreshed before they expire. Native mobile applications using Facebook's SDKs will get long-lived access tokens, good for about 60 days. These tokens will be refreshed once per day when the person using your app makes a request to Facebook's servers. If no requests are made, the token will expire after about 60 days and the person will have to go through the login flow again to get a new token. Access tokens on the web often have a lifetime of about two hours, but will automatically be refreshed when required. Here are the steps that you need to take to generate a long-lived token: Start with a short-lived token generated on a client and ship it back to your server.Use the user token, your app ID and app secret to make the following call from your server to Facebook's servers: GET /oauth/access_token?

Refreshing Long-Lived Tokens ... Access Tokens and Types. Facebook Login includes security features to protect people's information and let them control what they share with your app.

Access Tokens and Types

Secure Authorization On the web, Facebook uses a variant of the OAuth2.0 protocol for confirming a person's identity (authentication) as well as control of what data they will share with your app (authorization). A similar mechanism is used on iOS and Android, although the primary mechanism on those platforms use the native Facebook app instead of the web. Our guides walk you through how to integrate login on each platform. Permissions When someone connects with an app using Facebook Login, the app can always access their public profile. Your app may optionally ask for other pieces of information as well. Test Users. You can delete a test user by making a delete operation on this node.

Test Users

DELETE /v2.1/{test-user-id} HTTP/1.1Host: graph.facebook.com /* PHP SDK v4.0.0 *//* make the API call */ $request = new FacebookRequest( $session, 'DELETE', '/{test-user-id}'); $response = $request->execute(); $graphObject = $response->getGraphObject();/* handle the result */ /* make the API call */new Request( session, "/{test-user-id}", null, HttpMethod.DELETE, new Request.Callback() { public void onCompleted(Response response) { /* handle the result */ } }).executeAsync(); Permissions An app access token for an associated app or the test user's own access token must be used to delete that test user. Fields.