Integrating AE Connect to Mobile Apps Using Native SDKs

Social networks provide SDKs for Android, iOS and other platforms that enable users to sign into your app via social logins.

While we can't provide step-by-step instructions for integrating AE Connect and native SDKs into your existing app, this article will walk you through the high-level process of integrating AE Connect to mobile apps using native SDKs.

At the bottom of this article, you can see diagrams that show the behind-the-scenes process when a mobile app integrates native SDKs and connects to Appreciation Engine with the AE REST API directly or via a proxy server.


Step 1: Implement an SDK

Every SDK is different. You should check out the documentation for the SDKs you plan to implement in your app. For example, here are some links to documentation for Facebook and Twitter's SDKs:


Step 2: Pass Authentication Tokens to AE

When your app uses these SDKs, and users sign up or log in using them, authentication tokens are provided to the environment via callback methods.

Using callback methods, Appreciation Engine can retrieve information or perform actions on your users' behalf.

These tokens can be passed on to AE via the AE API.

The REST API calls can be made from within the callbacks provided by the SDKs and via client REST libraries provided by the native mobile OS.

For example, you can make REST API calls for iOS using the built-in NSURL, NSURLRequest, JSONSerialization objects, or with the popular third-party library RestKit. Or, for Android, you can use the built-in Apache HTTP client and HttpURLConnection, or the popular library Android Async/

Relevant AE API Endpoints

While we recommend that you check out the full documentation for the AE API, here's a short list of API endpoints you will likely use in conjunction with native SDKs:

  • v1.1/member/register : A POST request that accepts authentication credentials and associated user data to register a member with AE. Returns information about newly created or existing member.
  • v1.1/member/update : A POST request that updates basic and extended member data.
  • v1.1/member/verify : A POST request that manually verifies an email address for a user.


Step 3: Start Listening and Analyzing Users

Once AE has access to a social app's authentication tokens, you can start analyzing logged-in users from the AE dashboard.

For example, if you have users log in via your Facebook social app, and you pass tokens to your AE app, you can start listening to and analyzing your users using the algorithms provided by Facebook.


Diagram: Native SDK and AE REST API (via Proxy)

  1. Once the user starts the signup or login process, the mobile app accesses the native mobile SDK for the chosen social network. For example, Twitter's mobile SDK.
  2. The social network sends an authentication response to the mobile app via its SDK.
  3. The mobile app sends the data to the AE REST API proxy server, which is hosted externally.
  4. The REST API accepts amember/registerrequest to Appreciation Engine.
  5. The REST API sends a member/registerresponse to the proxy server.
  6. The proxy server passes a response back to the mobile app.
  7. The mobile app's authentication handler processes the response.
  8. The user is logged in and can continue to use the mobile app.


Diagram: Native SDK and AE REST API (Direct)

Security Note: If you are making direct API calls from the app, ensure to create a partner key with restricted endpoint scopes. Scopes should be limited to member/register and member/verify. We strongly recommend that all of your AE REST API calls pass through a proxy server. This proxy server can store your API keys securely.

  1. Once the user starts the signup or login process, the mobile app accesses the native mobile SDK for the chosen social network.
  2. The social network sends an authentication response to the mobile application via its SDK.
  3. The mobile app sends amember/register API request to the AE REST API via the native client library (for example, NSURL on iOS or the Apache HTTP client on Android).
  4. The REST API sends a response back to the mobile app. 
  5. The mobile app's authentication handler processes the response.
  6. The user is logged in and can continue to use the mobile app.




How did we do?