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.
- Open XCode
- Drag and drop framework from Finder inside your iOS app
- Select Copy items if needed
- Go To Project ->General ->Embedded Binaries
- Click on '+' symbol to add new Framework
-
Select framework, and Click Add button.
-
Select Finish and Apply
-
Open your ViewController and import Framework
import RFGOffer
- 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)")
}