Research For Good

› Docusaurus

Android

  • Android SDK

iOS

  • iOS SDK

Android SDK Integration

Download Android SDK file

Download the SDK file from this link

Installation

First, the .aar file needs to be imported into your Android app which is using Gradle system

  1. Open Android Studio
  2. Go To File ->Project Structure ->Module
  3. Click on '+' symbol to add new Module

Add Module# 1

  1. Select "Import .JAR/.AAR Package "and select Next

Add Module# 2

  1. Open File Browser, and Select the downloaded .aar file

Add Module# 3

  1. Select Finish and Apply

  2. Open your app module's .gradle file, and add following line in 'dependencies' section

											implementation project(path: ':offerwallsdk')
                                        

Permissions

If not already added, add following permission to your AndroidManifest.xml file

											<uses-permission android:name="android.permission.INTERNET"/>
										

Usage

Show Offer Wall

RFGOfferwallManager will be the primary object to use OfferWalls in your Android application. Use Following code snippet to get started

RFGOfferwallManager manager = RFGOfferwallManager.getInstance();
manager.setPartnerId("<Partner-ID>");
manager.setUserId("<User-ID>");
manager.setTitle("<Custom-Title>");
manager.setEventsCallback(new IRFGOfferWallEventsCallback() {

	@Override
	public void onOfferWallOpened() {
		Log.i(this.getClass().getSimpleName(), "Offer Wall Opened");
	}

	@Override
	public void onOfferWallClosed() {
		Log.i(this.getClass().getSimpleName(), "Offer Wall Closed");
	}

	@Override
	public void onOfferWallLoadError() {
		Log.i(this.getClass().getSimpleName(), "Offer Wall in Error");
	}

	@Override
	public void onRewardsReceived() {
		Log.i(this.getClass().getSimpleName(), "Received Payout::" + payout);
	}
});
manager.showOfferWall(this);

RFGManager.getInstance() will provide an instance of RFGManager that can be used to do the required stuff.

  • Use setPartnerId() to set Partner ID of the request
  • Use setUserId() to set Unique user ID from your application to identify each user
  • Use setTitle() to set custom Title of the OfferWall
  • Use setEventsCallback() to listen to events during OfferWall lifecycle
  • Use showOfferWall() to show OfferWall

Check if survey is available

Following code can be used to check if any survey is available before showing the OfferWall. This function can be used to trigger any custom logic in your application before OfferWall is displayed to user.

	manager.isSurveyAvailable(new IRFGOfferwallSurveyAvailableCallback() {

	@Override
	public void onRequestCompleted(boolean isAvailable) {
		if(isAvailable) {
			// Show OfferWall, or Display button to Show OfferWall etc
		} else {
			// Notify User that Survey is not available etc.
		}
	}
});
ios-sdk →
  • Download Android SDK file
  • Installation
  • Permissions
  • Usage
    • Show Offer Wall
    • Check if survey is available
Copyright © 2019 Research For Good