Skip to main content

Getting started

Basic configuration#

  • Xcode 12 or later
  • iOS 9.0 or later

    Note: Starting with iOS 9, iOS apps have always used Application Transport Security (ATS), a data transfer security feature that enforces the use of encrypted connections. Before proceeding, please refer to the requirements in App Transport Security to configure your info.plist to ensure that your ads are not affected by ATS.

One, cocoapod integration#

Enter TradPlusSDK download platform, select the required third-party advertising platform according to your needs, click to generate access code, you can Get the pod configuration information you want to add with one click

Second, manual integration#

1. Enter TradPlusSDK download platform, select non-cocoapod access, select the required third-party advertising platform according to your needs, click After generating the access code, download the zip package containing TPSDK and third-party sources

2. Add the decompressed TradPlusFrameworks directory to the Xcode project

3. Project configuration

  • Added -ObjC to "Other Linker Flags". Specific location: add in Xcode project configuration "TARGETS" > "Build Setting" > "Linking" > "Other Linker Flags"

  • In "TARGETS" > "General", set the framework of some third-party sources to Embed & Sign

    • SuperAwesome: Alamofire.framework , Moya.framework , SuperAwesome.framework , SwiftyXMLParser.framework (before v8.6.0)
    • Smaato: OMSDK_Smaato.framework
    • Kuaishou: KSAdSDK.framework
    • Mate: FBAudienceNetwork.framework (since 6.10.0)
    • Verve: OMSDK_Pubnativenet.framework , HyBid.framework
    • Ogury: OMSDK_Ogury.framework
    • Bigo: OMSDK_Bigosg.framework
    • Start.io: StartApp.framework (v4.9.1)
    • Fyber:IASDKCore.framework (since v8.2.1)
    • Amazon: DTBiOSSDK.framework
    • Maio: Maio.framework (v2.0.0+)
    • Tapjoy: Tapjoy.framework(v13.3.0+)
  • Commonly used system dependency libraries, added according to the requirements of the third party source

  • libz.tbd

  • libbz2.tbd

  • libxml2.tbd

  • libresolv.9.tbd

  • libsqlite3.tbd

  • libc++.tbd

  • libc++abi.tbd

  • Accelerate.framework

  • CoreImage.framework

  • CoreLocation.framework

  • JavaScriptCore.framework

  • AppTrackingTransparency.framework

  • EventKit.framework

  • EventKitUI.framework

Apply for IDFA Permission#

On iOS14.5+, IDFA is obtained through a pop-up window, and the user's consent is required to use IDFA. For details, please refer to Adapting iOS14.5+

  1. Add the NSUserTrackingUsageDescription key in info.plist with a custom message describing your usage. The format can refer to the following content.
<key>NSUserTrackingUsageDescription</key>
<string>This identifier will be used to deliver personalized advertisements to you.</string>
  1. After the app starts, the IDFA permission application pops up
//It is recommended to call before TradPlus SDK initialization
if (@available(iOS 14.5, *)) {
[ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
}];

SDK initialization#

      The following code is called in the didFinishLaunchingWithOptions method of the AppDelegate class. The AppId of the application in the TradPlus background must be correctly passed in, otherwise the background cannot accurately count DAU.

#import <TradPlusAds/TradPlus.h>
[TradPlus initSDK:@"tradplus background application corresponding appid" completionBlock:^(NSError *error){
if (!error)
{
MSLogInfo(@"tradplus sdk init success!");
}
}];

Enable http request permission#

Since some advertisements and statistics from third-party sources still use http requests, in order to maximize the benefits of your APP, it is recommended that you enable the http request permission of the APP.

You need to add the following settings to info.plist in the APP project:

<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>

Disclosing data usage in the App Store#

  • APPLE officially requires developers who publish apps on the App Store to disclose certain information about their data usage. Apple has announced that starting December 8, 2020, new apps and app updates will require these disclosures.
  • Learn more about data disclosure requirements.

Enable SKAdNetwork to track conversions#

Three-party channels that support Apple's official SKAdNetwork framework will normally obtain conversions when IDFA cannot be obtained. In order to realize this function, you need to add corresponding SKAdNetworkItems in info.plist. For details, please refer to Adaptation to iOS14.5+

<key>SKAdNetworkItems</key>
<array>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>xxx.skadnetwork</string>
</dict>
 …
</array>

Precautions#

  • Please download and decompress the sdk on the mac, otherwise some file formats will be damaged.
  • Please do not configure the same three-party channel advertising space in different advertising spaces of the same application of TradPlus, which will cause various problems such as callback confusion.
  • The background advertisement configuration will take effect within 30 seconds after modification, and the SDK local configuration cache will expire in 1 hour. If you need to obtain the updated configuration as soon as possible, the developer needs to delete and reinstall the App or adjust the system time by 1 hour.

Facebook Requirements#

      Facebook needs to be downloaded and successfully logged in to display ads, including test ads.

Admob Requirements#

    The unique identifier of the product in Admob must be written in the client, otherwise it will cause the application to crash.

      Info.plist Add the GADApplicationIdentifier value to ca-app-pub-1111111111111111~1111111111, please replace the appid with the appid in the Admob background when the app is published.

other#

When building and testing your app, be sure to use test ads, not live ads. Failure to do so may result in your account being suspended.

  • Set the log level of the SDK
//Enable the SDK to print all logs
[TradPlus setLogLevel:MSLogLevelAll];
  • Developers can use the test mode of the TP background to verify whether it has been connected correctly.

  • For the access of various advertisement types, please refer to: Demo