Help Center/Details/

How to integrate CSJ iOS SDK via MoPub Mediation

Starting from version v3.4.0.0, Pangle iOS SDK is divided into CSJ iOS SDK and Pangle iOS SDK, here is the details for separated ios sdks. The most important thing is that CSJ iOS SDK only could be used for China Mainland traffic and Pangle iOS SDK only could be used for Non China Mainland traffic.


MoPub would only certify Pangle iOS SDK since v3.4.0.0. This guide is intended for publishers who still want to integrate CSJ iOS SDK via MoPub mediation. [Not custom event]


Prerequisites

Developers should have already imported Pangle iOS SDK and Pangle Adapters through MoPub integration tool. For example, as code below:

pod 'MoPub-Pangle-Adapters', '3.9.0.8.0'


Implementation

Broadly speaking, there are 3 steps to integrate CSJ iOS SDK via MoPub.

  • Import CSJ iOS SDK
  • Locate the user devices
  • Set territory before initializing MoPub SDK

Step1: Import CSJ iOS SDK

CocoaPods (preferred)

Open your project's Podfile and add the line pod 'Ads-Global' , '3.4.2.8' :subspecs => ['Domestic'] to your app's target:

pod 'MoPub-Pangle-Adapters', '3.9.0.8.0'//this is the prerequisite

pod 'Ads-Global' , '3.9.0.8', :subspecs => ['Domestic']//add this line to your app's target

Note: you must import the same sdk version for CSJ SDK and Pangle SDK, for example, if you have imported v3.9.0.8 Pangle SDK from MoPub Integration Tool, you also need to import the same version of CSJ SDK.

Manually

Download CSJ iOS SDK from the Pangle platform, unzip the file and find the BUCNAuxiliary.framework, then only import this framework into your iOS project.
截屏2021-03-19 下午4.36.47.png

截屏2021-03-19 下午4.38.02.png

Note: you must import the same sdk version for CSJ SDK and Pangle SDK, for example, if you have imported v3.9.0.8 Pangle SDK from MoPub Integration Tool, you also need to import the same version of CSJ SDK. If you can't find the same version of CSJ SDK in your account, please contact your account manager or email us(pangle_support@bytedance.com).

Step2: Locate user devices

This step should be done by developers. We would suggest to locate users with the following ways:

  • Locate user devices through IP address.
  • Locate user devices through GPS info, GPS should be collected by developers, Pangle SDK won't collect GPS info.
  • Locate user devices through developer's user account infomation(If app support) or internal ids.

Note: If developers have built a china version for their apps(this version only be used in China mainland), for those apps, step 2 is not needed and could hardcode BUAdSDKTerritory_CN at step 3.

Step3: Set territory before initializing MoPub SDK

Once the user is located, call setTerritory method to pass the region to Pangle SDK according to the user location.

//@param territory : Regional value: 1.BUAdSDKTerritory_CN  2.BUAdSDKTerritory_NO_CN

[BUAdSDKManager setTerritory: (BUAdSDKTerritory)territory];
  • BUAdSDKTerritory_CN for China mainland traffic(China mainland, Hong Kong, Marco)
  • BUAdSDKTerritory_NO_CN for Non China mainland traffic(others countries and regions)

Important: This step must be done before initializing MoPub SDK

Did the content solve your problem?