Additional SDK Settings - Xamarin iOS

GDPR – Managing Consent

ironSource’s mediation platform and network support publisher communication of a user’s consent choice, including passing this information to mediated networks (for supported networks).

To use ironSource’s API to update a user’s consent status, use this functions:

If the user provided consent, please set the following flag to true:

IronSource.SetConsent(true);

If the user did not consent, please set the following flag to false:

IronSource.SetConsent(false);

It’s recommended to set the API prior to SDK Initialization.

A detailed article regarding ironSource’s approach to GDPR and user consent can be found here.

CCPA Compliance

ironSource’s mediation platform (SDK Version 6.14.0 and above) supports publishers to restrict the sale of end users personal information under the California Consumer Privacy Act (CCPA).

The notification about personal information of specific users located in California should be handled based on a “do not sell” setting, by setting its value to “true” or “false”.

The API should be set before initializing the SDK.

If the user has opted out of “sale” of personal information:

IronSource.setMetaDataWithKey("do_not_sell", "YES"];

If “sale” of personal information is permitted:

IronSource.setMetaDataWithKey("do_not_sell", "NO"];

A detailed article regarding ironSource’s approach to CCPA can be found here.

Define Segments

You can now easily tailor the way you serve your ads to fit a specific audience! You’ll need to inform our servers of the users’ details so the SDK will know to serve ads according to the segment the user belongs to.

ironSource supports three methods to convey data to our servers to outline the user segment, namely:

  • Device Properties: the ironSource SDK collects certain standard parameters that pertain to the users’ device automatically such as location, device model, device manufacturer, app version, OS, etc. You do not need to convey this data to us. 
  • User Properties: comprehensive user data such as age, gender, creation date, etc. (see full list of supported segment properties with descriptions below) must be relayed through the API. Follow the instructions to send us your user’s details so our SDK can categorize your different users based on the segments you defined on the ironSource platform. 
  • Custom Segments: you can create a custom segment without conveying user details to our servers and tailor ad settings for that user segment.

Pass User Properties

Once you’ve defined segments on the ironSource platform, you’ll need to inform our servers of the user’s particulars.

Segments must be set before initializing the SDK.

Define the properties that will be sent to our servers on which to base the segments. You can transmit this information through one of the following methods:

  1. If you are familiar with the segment that the user belongs to, enter the segment name:
    ISSegment segment = new ISSegment ();
            segment.SegmentName = "nameOfSegment";
    
  2. Send us the user details. ironSource provides a range of standard user properties that you can set to attribute a user to a segment in the API.  Scroll down for a table of the support user segment properties.
    // Create segment object
    ISSegment segment = new ISSegment();
    // Set user age
    segment.Age = age;
    // Set user gender
    segment.Gender = "gender";
    // Set user's level
    segment.Level = levelnumber;
    // Set user's paying status, boolean
    segment.Paying = payingStatus;
    

    In addition, you can set up to 5 custom user properties per segment:

    // Set user's custom var
    segment.SetCustomValue(“8", “custom”);

Next, to serve your ad units based on segments to tailor the user’s ad experience, call the following function complete with either the segment name or user properties:

IronSource.SetSegment(segment);

Supported User Segment Properties

Segment Properties Type Limitation Description
SegmentName String
  • alphanumeric
  • up to 32 letters
The given name of the segment in your ironSource account
Age Int 1-99 The user’s age
Gender String female or male The user’s gender
Paying Boolean True or False
  • True if the user has spent any money on in-app purchases
  • False if the user has not spent any money on in-app purchases
iap_total Double 1-999999.99 The total amount of money that the user has spent on in-app purchases
userCreationDate Long Cannot be smaller than 0 The date the user installed the app, e.g. [NSDate date]
Custom Parameters key=string, value=string
  • ironSource supports up to 5 custom parameters
  • alphanumeric
  • up to 32 letters
Any additional data you’d like to dispatch to our server

Register to callbacks listener:

IronSource.SetSegmentDelegate(segDelegate);

Sample implementation – to receives the segment name that your user belongs to, implement the following:

    1. Create a class which inherits from ISSegmentDelegate
      1.     public class SegmentDelegate : ISSegmentDelegate
            {
                readonly UIViewController viewController;
                public SegmentDelegate(ViewController viewController)
                {
                    this.viewController = viewController;
                }
                public override void DidReceiveSegement(string segment)
                {
                }
        

      2. Create an object
        SegmentDelegate mSegmentDelegate;
        // define the listener 
        mSegmentDelegate = new SegmentDelegate(this);
        IronSource.SetSegmentDelegate(mSegmentDelegate);
        

    If the callback string (segment name) returns empty, there were no correlating segments found for the user in the ironSource segment module.

    Custom Parameters for Xamarin

    The ironSource SDK supports custom parameters for Rewarded Video and Offerwall. You can pass custom parameters upon the initialization of the ad unit and receive the parameters upon a user’s completion event.
    You can now pass custom parameters for all mediation networks on the ironSource mediation platform.

    Note:
    1. Custom parameters work in conjunction with server-to-server completion callbacks only. You will receive the parameter as part of the callback string.
    2. You may insert more than one custom parameter in the init request. 

Implementation Code

Rewarded Video

Note:
    • Custom Parameters can be added once per session for Rewarded Video.
    • Custom Parameters should be called before initiating the Rewarded Video.
public void SetRewardedVideoServerParameters(NSDictionary<string, string> dictionary);
public void ClearRewardedVideoServerParameters();