Skip to content
This repository has been archived by the owner on Dec 15, 2017. It is now read-only.

Commit

Permalink
Updated to Facebook SDK for Android version 4.8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
skoggkatt committed Nov 27, 2015
1 parent 8268073 commit 4584190
Show file tree
Hide file tree
Showing 369 changed files with 4,309 additions and 9,597 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Expand Up @@ -5,4 +5,7 @@
# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control?
#
# Pods/

friend-smash/build/
build/
.idea/
.gradle/
51 changes: 39 additions & 12 deletions README.md
@@ -1,26 +1,53 @@
# Friend Smash sample Facebook app
# Friend Smash sample Facebook game

Authors:
Peter Chang (peter78)
Phil Hewinson (philhewinson)
Ali Parr (aliparr)
- Peter Chang (peter78)
- Phil Hewinson (philhewinson)
- Ali Parr (aliparr)
- Jakub Pudelek (skoggkatt)

## Overview
To help better understand different products and services available to game developers, Facebook maintains a sample game called Friend Smash!

Friend Smash is a sample Android game that integrates with Facebook. A Canvas and iOS version is also available.
The game is implemented on different platforms:

## Installing
* Web using [Facebook SDK for Javascript](https://developers.facebook.com/docs/javascript)
* Mobile using Facebook's native SDKs for [iOS](https://developers.facebook.com/docs/ios) and [Android](https://developers.facebook.com/docs/android)
* It is also available as a Unity cross platform build using the [Facebook SDK for Unity](https://developers.facebook.com/docs/unity).

Before running the sample, please see the Getting Started on Android guide, available here: https://developers.facebook.com/docs/android/getting-started
There are minor differences between the four implementations, but overall the goal and structure of all is similar. This is the Android version of the game.
## What is “Friend Smash!”?
Friend Smash is a simple game which utilizes Facebook platform to enhance the gameplay by making it more fun and social. It uses variety of products and services, such as [Facebook Login](https://developers.facebook.com/docs/facebook-login), [Graph API](https://developers.facebook.com/docs/graph-api), [Game Requests](https://developers.facebook.com/docs/games/requests/) and [Sharing](https://developers.facebook.com/docs/games/sharing). The code examples serve as a guide of how they may be used in a games context. It also serves as an implementation guide - parts of source code relevant to Facebook integration are clearly separated from the pure gaming-logic and clearly documented with in code comments.

## Documentation
Please note that Friend Smash! was not designed as an example of how to design or code a game. The focus is on Facebook integration - other parts of the project may not be as clear and well designed and documented.

The accompanying tutorial for this sample app can be found here: https://developers.facebook.com/docs/games/mobile/android-tutorial
Friends Smash! is a game in which players are tasked with "smashing" (mouse-clicking or screen-tapping) pictures of a specific person while avoiding smashing pictures of anyone else. Player gets points for each correct picture smashed. Each miss or wrong smash causes the player to lose a heart. After losing 3 lives, the game is over. Player can also smash images of coins to collect them and later redeem these coins to buy bombs. In turn, bombs can be used in game to smash all correct pictures on the screen, helping to achieve a higher score. Additionally, the web version of the game allows players to purchase coins with Facebook Payments.

## Additional Resources
## Facebook integration
To make the experience more fun and social, players are asked to log in with Facebook and grant [user_friends](https://developers.facebook.com/docs/facebook-login/permissions/#reference-user_friends) permission. When granted, the game will have access to subset of player's friends data, specifically those who also logged in to Friend Smash! and granted user_friends permission. This means the game will use the profile picture of randomly selected friend as the picture the player is asked to smash. If user_friends permission hasn’t been granted or the player doesn't have friends who also logged in to Friend Smash! and granted user_friends permission, a picture of randomly selected celebrity is used instead.

Facebook SDK for Android documentation can be found at https://developers.facebook.com/android/
At different points in the game player has an opportunity to share to Facebook. For example after the game is over, player can brag about the score achieved by posting a custom [Open Graph story](https://developers.facebook.com/docs/games/opengraph). The game also shows how to ask for [publish_actions](https://developers.facebook.com/docs/facebook-login/permissions/#reference-publish_actions) permission (which is required for API based sharing) and how to handle the case when publish_actions permission is not granted. If publish_actions permission is granted - the game uses [Scores API](https://developers.facebook.com/docs/games/scores) to publish and store the top score achieved by the player.

## Contributing
[Game Requests](https://developers.facebook.com/docs/games/requests/) are used in the game for two main purposes. First to let the player invite their friends who are not playing the game to try it. Second, to send a challenge to a friend who is already playing to bring them back to the game.
Additionally on the web version, the game uses [Facebook Payments](https://developers.facebook.com/docs/payments) to allow players to purchase in-game currency and [In-Game Gifting](https://developers.facebook.com/docs/payments/ingamegifting) to allow purchasing gifts for players’ friends. The web example also includes reference implementation of a payments server handling static pricing and payments verification.

Friend Smash! also logs [App Events](https://developers.facebook.com/docs/app-events), which enables Facebook [Analytics for Apps](https://developers.facebook.com/docs/analytics) - a free tool allowing developers to learn how people use their app across all platforms and devices, get insights about the people using the app, and improve marketing.

## How to use “Friend Smash!”?
All versions of Friend Smash! are available as part of [Facebook Platform Samples](https://github.com/fbsamples) on github:
[Web](https://github.com/fbsamples/web-friend-smash), [Android](https://github.com/fbsamples/android-friend-smash), [iOS](https://github.com/fbsamples/ios-friend-smash), [Unity](https://github.com/fbsamples/friendsmash-unity).

The recommended way to explore the projects is to begin with how Facebook products are integrated. To make it easier code responsible for Facebook integration is separated and well documented with in code comments for all versions. You can find it here for different versions: Web, Android, iOS, Unity. The reference implementation of a payments server is included in the Web repository.

To play Friend Smash! on Web, simply go to [apps.facebook.com/friendsmashsample](http://apps.facebook.com/friendsmashsample). To play it on mobile, download the Android, iOS or Unity project and build it from source and try on your device.

Please note it is likely that unless you have friends who also installed Friend Smash! you will not see any of your friends in the game. If this is the case, you can invite some of your friends to play Friend Smash! to fully explore how social integration works in Friend Smash!

## Installing
Before running the sample, please see the [Getting Started on Android guide](https://developers.facebook.com/docs/android/getting-started)

## Additional Resources
Facebook SDK for Android [documentation](https://developers.facebook.com/docs/android/)

## Contributing
All contributors must agree to and sign the [Facebook CLA](https://developers.facebook.com/opensource/cla) prior to submitting Pull Requests. We cannot accept Pull Requests until this document is signed and submitted.
19 changes: 19 additions & 0 deletions android-friend-smash-v2.iml
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="android-friend-smash-v2" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="java-gradle" name="Java-Gradle">
<configuration>
<option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />
<option name="BUILDABLE" value="false" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
15 changes: 15 additions & 0 deletions build.gradle
@@ -0,0 +1,15 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
}
}

allprojects {
repositories {
jcenter()
}
}
19 changes: 19 additions & 0 deletions friend-smash-android.iml
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="friend-smash-android" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="java-gradle" name="Java-Gradle">
<configuration>
<option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />
<option name="BUILDABLE" value="false" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
32 changes: 32 additions & 0 deletions friend-smash/build.gradle
@@ -0,0 +1,32 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 19
buildToolsVersion "21.1.2"

defaultConfig {
applicationId "com.facebook.android.friendsmash"
minSdkVersion 15
targetSdkVersion 23
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}

repositories {
mavenCentral()
flatDir{dirs 'libs'}
}

dependencies {
compile files('libs/Parse-1.10.3.jar', 'libs/ParseFacebookUtilsV4-1.10.3.jar')
compile 'com.facebook.android:facebook-android-sdk:4.8.1'
}
repositories{

}
95 changes: 95 additions & 0 deletions friend-smash/friend-smash.iml
@@ -0,0 +1,95 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id=":friend-smash" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="android-friend-smash-v2" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android-gradle" name="Android-Gradle">
<configuration>
<option name="GRADLE_PROJECT_PATH" value=":friend-smash" />
</configuration>
</facet>
<facet type="android" name="Android">
<configuration>
<option name="SELECTED_BUILD_VARIANT" value="debug" />
<option name="SELECTED_TEST_ARTIFACT" value="_android_test_" />
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
<option name="ASSEMBLE_TEST_TASK_NAME" value="assembleDebugAndroidTest" />
<option name="COMPILE_JAVA_TEST_TASK_NAME" value="compileDebugAndroidTestSources" />
<afterSyncTasks>
<task>generateDebugAndroidTestSources</task>
<task>generateDebugSources</task>
</afterSyncTasks>
<option name="ALLOW_USER_CONFIGURATION" value="false" />
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
<option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" />
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/build/intermediates/classes/debug" />
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/androidTest/debug" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/generated/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/generated/androidTest/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/multidex/1.0.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/23.0.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.facebook.android/facebook-android-sdk/4.8.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/resources" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/tmp" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android API 19 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="Parse-1.10.3" level="project" />
<orderEntry type="library" exported="" name="facebook-android-sdk-4.8.1" level="project" />
<orderEntry type="library" exported="" name="ParseFacebookUtilsV4-1.10.3" level="project" />
<orderEntry type="library" exported="" name="bolts-android-1.2.1" level="project" />
<orderEntry type="library" exported="" name="multidex-1.0.1" level="project" />
<orderEntry type="library" exported="" name="support-v4-23.0.1" level="project" />
<orderEntry type="library" exported="" name="support-annotations-23.0.1" level="project" />
</component>
</module>
Binary file added friend-smash/libs/Parse-1.10.3.jar
Binary file not shown.
Binary file added friend-smash/libs/ParseFacebookUtilsV4-1.10.3.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion friendsmash_complete/lint.xml → friend-smash/lint.xml
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="utf-8"?>
<lint>
<issue id="ContentDescription" severity="ignore" />
</lint>

0 comments on commit 4584190

Please sign in to comment.