Research For Good

› Docusaurus

Android

  • Android SDK

iOS

  • iOS SDK

iOS SDK Integration

Download iOS Framework file

Download the Framework file from this link, and extract the contents

Installation

First, the .framework file needs to be imported into your iOS application

Note:- Application is both Swift and Objective-C Compatible. Symbols are taken care of automatically.

  1. Open XCode
  2. Drag and drop framework from Finder inside your iOS app
  3. Select Copy items if needed

Add Framework# 1

  1. Go To Project ->General ->Embedded Binaries

Add Framework# 2

  1. Click on '+' symbol to add new Framework

Add Framework# 3

  1. Select framework, and Click Add button.

  2. Select Finish and Apply

  3. Open your ViewController and import Framework

import RFGOffer
                                        
  1. Initialize the Framework with Partner ID, User ID and Title of the SDK
self.offer = RFGOfferWall(partnerId: "PARTNER_ID", userId: " USER_ID", title: "Offers")

Usage

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.

self.offer.isOfferAvailable { [weak self](available) in
    // Do something
}

Show Offer Wall

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

self?.offer.showOfferWall(onViewController: self!)

Following delegate functions can be used to listen to events during OfferWall lifecycle

func offerWall(_ manager: RFGOffer.RFGOfferWall, didStart url: URL) {
    print("offerWall didStartLoading")
}

func offerWall(_ manager: RFGOffer.RFGOfferWall, didFinish url: URL) {
    print("offerWall didFinishLoading")
}

func offerWall(_ manager: RFGOffer.RFGOfferWall, didFail url: URL, withError error: Error) {
    print("offerWall didfaiFlToLoadWithError:\(error)")
}

func offerWall(_ manager: RFGOffer.RFGOfferWall, didGetPayout payout: Double) {
    print("offerWall payout:\(payout)")
}

  • Download iOS Framework file
  • Installation
  • Usage
    • Check if survey is available
    • Show Offer Wall
Copyright © 2019 Research For Good