Rave supports third party service providers via plugin architecture. All plugins are referenced by their “key name” in Rave APIs. A plugin will be automatically registered for you in your company’s scenepack. Please refer to the following chart for Rave’s stock plugin capabilities.

Service

Authentication

Contacts

Sharing

Data Mirroring

Facebook

Yes

Yes

Yes

No

Google

Yes

Yes

No

No

Phonebook

No

Yes

No

No

Gamecenter

No

No

No

Yes

Rave Social’s server infrastructure requires configuration of third-party credentials in order to communicate directly with the third party services. Please read and perform the following guides for the applicable social networks for your app and send the resulting credentials to your Rave Social support representative to enable the associated features.

Configure the Facebook App#

  1. Go to the Facebook Developers Console and log in with your Facebook credentials to access the developer App settings

  2. Click Create New App

  3. In the Display Name field, type in the name of your application

  4. (Optional) In the Namespace field, type in a unique application ID

  5. Select the category most appropriate for your application

  6. In the left sidebar, click the Settings button

  7. You will now need to add information for each platform your app is on:

    1. Click Add Platform

    2. Enter your Bundle ID and iPhone/iPad Store ID from your iTunes Connect page

    3. Enable Single Sign On and Deep Linking

    4. Click Save Changes

    1. Click Add Platform

    2. Enter your Package Name and the Class Name of your application’s start activity (e.g.: co.ravesocial.demo.DemoStartActivity)

    3. Enable Single Sign On and Deep Linking

    4. Enter Key Hashes for each Android key you plan on using for development and release. The Obtaining Key Hash and SHA-1 Fingerprint section describes how to get the necessary key hash value(s)

    5. Click Save Changes

  8. Configure your business mappings for all of your apps. Since Graph API v2.0, Facebook is issuing app-scoped user IDs for players’ Facebook UIs. By definition, this means the ID for the same person may be different between these apps.

Since Big Fish Games operates many Facebook Apps, in order to support use cases such as keeping track of which of player’s friends are playing Big Fish games, you need to map the same person’s ID between those apps. You can do this using Facebook’s Business Mapping API.

Before you use the Business Mapping API you will need to use Facebook Business Manager to create a new business, or associate your apps to an existing business in order for Facebook to determine the apps your business operates.

Note

Important

Facebook Graph API v2 went online on April 30, 2014. All FB apps created after this date will use Graph API v2 or newer.

Warning

Known Issue with Facebook Test Users and Cross-Play Functionality

Some Facebook Test Users have been observed to encounter issues with cross-play functionality due to a known issue in Facebook’s /me/ids_for_business API. In certain cases, the API response does not conform to the documented structure, specifically omitting critical information required for Rave to identify accounts signed in across the same business apps. As Rave relies on this API to enable cross-play and account reutilization, this issue may affect these functionalities.

To mitigate this problem, Rave disabled Facebook cross-play functionality for the affected test user accounts until Facebook resolves the issue on their end. Please note that this issue is specific to certain Facebook test users, and real Facebook user accounts remain unaffected.

Once your Facebook app is set up, find the AppID and AppSecret for the application you just created and copy them for use in the Rave Application Management Portal and for contacting Rave Social for support.

By default, Rave Social uses the latest Facebook Graph API supported by the native Facebook SDK linked to the application.

Keys to add to your Android or iOS project:

  • RaveSettings.Facebook.ApplicationId

Facebook’s app review process#

Facebook has a review process for apps requesting permissions beyond the basic set (public_profile, email and user_friends). Please refer to the Facebook documentation on review for more information on this process.

Note

Facebook SDK requires that the meta-data string “com.facebook.sdk.ApplicationId” and “com.facebook.sdk.ClientToken” is set in your AndroidManifest.xml. It’s critical that the Facebook Application ID is placed into the strings.xml file, not directly into the Manifest. Android casts any numbers in the meta-data to 32-bit integers, which does not work for Facebook, but when a string resource is referenced, it will remain as a string and not cast. See the included demo for an example.

Note

Facebook SDK automatically adds the Advertising ID Permission to your app. In some cases, you might want to opt out of including the Advertising ID permission in your app. For example, if the customers for your app are children and families, the Advertising ID Permission might not be relevant. For more information, see the Understand the Advertising ID Permission section in Facebook docs.

Important

Rave currently supports Android Facebook SDK version 15.1.0. While newer versions may work, they may not have been tested yet with your version of Rave.

Full Facebook setup instructions for Android can be found here:

https://developers.facebook.com/docs/android/getting-started

Configure Google Project#

  1. Access Google API Console:

  2. Configure OAuth Consent Screen:

    • In the left side bar, navigate to the OAuth consent screen page.

    • Ensure all information provided is complete and accurate.

  3. Create Android/iOS Client ID:

    • In the left side bar, navigate to the Credentials page.

    • If you don’t have already, you will now need to register a Client ID for iOS and one for each Android signing key you plan on using for development/release:

      1. Click Create credentials.

      2. Select OAuth client ID (Note: To create an OAuth client ID, you must first set a product name on the consent screen).

      3. Select iOS for the application type.

      4. Enter your Bundle ID.

      5. After creation, take note of the Client ID.

      1. Click Create credentials.

      2. Select OAuth client ID (Note: To create an OAuth ID, you must first set a product name on the consent screen).

      3. Select Android for the application type.

      4. Enter the Package Name and SHA-1 Fingerprint. The Obtaining Key Hash and SHA-1 Fingerprint section describes how to get the necessary SHA-1 fingerprint.

      5. Repeat this process to create a Client ID for each Android key (Development and Release).

  4. Creating Client ID for the Rave Backend Server:

    • In the left side bar, navigate to the Credentials page.

    • Click Create credentials

    • Select Web application for the application type

    • After creation, take note of the Client ID and the Client secret. You will need the Client ID and Client Secret for use in the Rave Application Management Portal and for contacting Rave Social for support.

  5. Configure the project:

    • Configure your Android or iOS project with new generated Client IDs, you will need to add a few config keys as per platform:

      • RaveSettings.Google.ClientID (The iOS Client ID)

      • RaveSettings.Google.BackendClientID (The Backend Client ID)

      • RaveSettings.Google.ClientID (The Backend Client ID)

      • RaveSettings.Google.BackendClientID (The Backend Client ID)

      Note

      Android requires the Backend Client ID for both settings.

Full Google setup instructions for Android can be found here:

https://developers.google.com/identity/sign-in/android/start-integrating

Obtaining Key Hash and SHA-1 Fingerprint#

Key Hash#

Facebook’s documentation on how to obtain your Key Hash is available here: https://developers.facebook.com/docs/android/getting-started#troubleshooting

To obtain your key hash, add the following code to your application main activity’s onCreate function. Remember to replace the package listed below with your actual package name or it won’t find the key.

// Add code to print out the key hash
try {
    PackageInfo info = getPackageManager().getPackageInfo(
        "com.facebook.samples.hellofacebook",
        PackageManager.GET_SIGNATURES);
        for (Signature signature : info.signatures) {
            MessageDigest md = MessageDigest.getInstance("SHA");
            md.update(signature.toByteArray());
            Log.d("KeyHash:", Base64.encodeToString(md.digest(), Base64.DEFAULT));
        }
    } catch (NameNotFoundException e) {
} catch (NoSuchAlgorithmException e) {
}

SHA-1 Fingerprint#

Google’s documentation on how to obtain your keystore’s SHA-1 fingerprint is available here: https://developers.google.com/+/quickstart/android

To obtain your SHA-1 fingerprint of the certificate run the Keytool utility in a terminal.

keytool -exportcert -alias androiddebugkey -keystore <path-to-debug-or-production-keystore> -list -v

Where Is My Default Debug Key for Android?#

  • key path is ~/.android/debug.keystore

  • the key alias is androiddebugkey

  • the password is android

Setting Keys in the Rave-enabled App#

Modify <Android Application>/res/raw/config.json

  • “RaveSettings.Google.ClientID” : “”

  • “RaveSettings.Facebook.ApplicationId” : “”,

Directly Logging In to Authentication Providers#

Using our loginWith API, you can directly invoke a login via Facebook, or Google. Please use the following constants:

  • Facebook

  • Google

RaveSocial.loginWith("Facebook", new RaveCompletionListener() {
    public void onComplete(RaveException exception) {
        // handle login response
    }
});

Checking Readiness of Authentication Providers#

Just like with the direct login API - you can also see if an authentication provider is ready to be used. “Readiness” indicates that a user has connected this social account to their Rave Social account and also that the token or local authentication for this provider was successful. Use all the same constants as direct login to check. If a plugin is not ready but you desire a ready status, use the matching connect convenience function in RaveSocial.

RaveSocial.checkReadinessOf("Facebook", new RaveReadinessListener() {
    public void onComplete(RaveReadyStatus readyStatus) {
        // handle result
    }
});

// connecting to Facebook if it fails a readiness check
RaveSocial.connectTo("Facebook", new RaveCompletionListener() {
    public void onComplete(RaveException exception) {
        if (exception != null) {
            // handle error
        } else {
            // success
        }
    }
});