Skip to main content

Installation

Install using the npm package manager:
npm install @content-ignite/mobile-sdk-react-native

Android Prerequisites

Requirements

  • Minimum SDK version of 24 or higher
  • Compile SDK version of 36 or higher

iOS Prerequisites

Requirements

  • Use Xcode 16.0 or higher.
  • Target iOS 17.2 or higher.

Updating your Info.plist

  1. Before installing, update the application Info.plist to add a GADApplicationIdentifier key with a string value of your Ad Manager app ID found in the Ad Manager UI and of the form ca-app-pub-################~##########. If you do not have this ID, please contact the Content Ignite team.
  2. Next add a SKAdNetworkItems key to your Info.plist with SKAdNetworkIdentifier values for Google (cstr6suwn9.skadnetwork) and select third-party buyers who have provided these values to Google.

Initialisation

Initialise the SDK once, early in your app’s lifecycle (for example in a top-level useEffect) and before rendering any ads. ContentIgniteSDK.initialise takes a configuration object and returns a promise that resolves to true once the SDK is ready.

Required

  • publisherId: string: A unique identifier for the publisher in the Fusion platform, provided by Content Ignite.
  • googleId: string: Your Google Ad Manager app ID, of the form ca-app-pub-################~##########.
  • debugFeature: boolean: Enables the in-app debug menu — see Using the Debug features.

Optional

  • testAds: boolean: Serve test creatives instead of live ads during development. Defaults to false.
  • appOpenPlacementId: string: Enables App Open ads via the CIAppOpenAd API — see App Open.
import ContentIgniteSDK from '@content-ignite/mobile-sdk-react-native';

export default function App() {
  const [isSDKInitialised, setIsSDKInitialized] = useState(false);

  useEffect(() => {
    initializeSDK();
  }, []);

  const initializeSDK = async () => {
    try {
      await ContentIgniteSDK.initialise({
        publisherId: '<PUBLISHER-ID>',
        googleId: "ca-app-pub-3940256099942544~3347511713",
        appOpenPlacementId: "<APP-OPEN-PLACEMENT-ID>",
        testAds: true,
        debugFeature: true,
      }).then(() => {
        console.log('SDK initialized');
      setIsSDKInitialized(true);
      });
    } catch (error) {
      console.error('Failed to initialize SDK:', error);
      setIsSDKInitialized(false);
    }
  }
  ...

Select an ad format

Content Ignite Mobile SDK is now imported and you’re ready to implement an ad. We offer a number of different formats:

App Open

Ads that appear when a user opens or switches back to your app.

Banner

Flexibly sized format for placing ads anywhere in your app.

Interstitial

Full-screen ads that are designed to appear between content transitions.