iOS

Offerwalls are in-app ads that incentivize users to take particular actions. In return, the user gets an in-app reward and the developer gets paid by the advertiser.

1. Integration

To integrate the PubScale Offerwall, you need to construct a URL and provide a set of parameters for proper configuration.

Construct the Offerwall URL

https://wow.pubscale.com?app_id={app_id}&user_id={user_id}&idfa={idfa}

Parameters

Parameters
Description

app_id (Required)

This is the unique identifier for your app, required for integration.

user_id (Required)

A unique identifier for each user, required to track their activity on the offerwall. We recommend using a UUID as the user_id.

idfa (Optional but Recommended)

For iOS integrations Include the idfa as a parameter when launching the Offerwall. This helps enhance tracking accuracy and plays a key role in fraud prevention.

To integrate the PubScale Offerwall into your iOS App, you have the following options:

Using SFSafariViewController:

For optimal performance and user experience, we recommend launching the Offerwall using SFSafariViewController

Here's a simple Swift example that opens PubScale Offerwall in a SFSafariViewController on iOS

import UIKit
import SafariServices

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        openLinkInSafariViewController()
    }

    func openLinkInSafariViewController() {
        if let url = URL(string: "https://wow.pubscale.com?app_id={app_id}&user_id={user_id}&idfa={idfa}") {
            let safariVC = SFSafariViewController(url: url)
            safariVC.modalPresentationStyle = .formSheet
            present(safariVC, animated: true, completion: nil)
        } else {
            print("Invalid URL")
        }
    }
}

Notes:

  • This code should be placed in a UIViewController subclass.

  • You can call openLinkInSafariViewController() when appropriate (e.g., on a button tap or in viewDidLoad as shown).

  • Don't forget to import SafariServices.

  • Don't forget to replace the {app_id} ,{user_id} and {idfa} with the actula value.

  • If your App is not approved from PubScale you might see an error page. If you see this error,

    • Check your App ID and make sure it is correct.

    • If your App ID is correct then its possible your App ID is not approved yet, in that case please reach out to your Account Manager to get your App approved.

    If your configuration is correct, you will see a page similar to the screenshot below.

2. Setup Server-to-Server(S2S) callbacks

Set up the Server-to-Server (S2S) callbacks to receive instant updates whenever a user completes an offer and earns a reward. When an offer is completed, our server will send a notification to the configured callback URL. This callback provides the necessary information to process and verify the reward for the user in your application. Learn more.

3. Test the OfferWall

Please use the sandbox environment for testing purposes to get instant callbacks and rewards. To learn how to enable the Sandbox environment, click here.

To ensure your OfferWall integration is working perfectly, follow these steps during the testing phase.

  • Open the offerwall and verify that all offers are displayed correctly.

  • Complete an offer and confirm that a callback is received from PubScale server to your server. For the sandbox environment, ensure the callback URL is configured properly to receive sandbox callbacks.

  • Ensure the hashing technique used matches the one specified in the documentation.

  • Verify that the reward value received matches the value displayed for the offer.

  • Confirm that the callback is received only from PubScale's whitelisted server IPs.

Was this helpful?