Getting Started
This section explains how to get started with BlueStack React Native Plugin. It guides you through the process of adding the BlueStack React Native Plugin to your project. BlueStack SDK React Native plugin provides functionalities for monetizing your mobile application: from premium sales with rich media, video and innovative formats, it facilitates all standard display formats. BlueStack SDK React Native plugin can be used for Ios and Android Apps.
Prerequisites
- Use React Native 0.70 or higher
- Android
- Target Android API level 19 or higher
- iOS
- iOS 12.2 or higher
1. Plugin Integration
Installation
npm install @azerion/bluestack-sdk-react-native
Import components
import {
BluestackSDK,
BannerAdView,
BannerAdType,
InterstitialAdManager,
RewardedAdManager,
} from "@azerion/bluestack-sdk-react-native";
To include Preferences, import following components
import {
AdPreference,
ProviderType,
GenderType,
LocationType,
} from "@azerion/bluestack-sdk-react-native";
2. SDK Implementation
Initializing the SDK
You need to initialize SDK using the App Id (depends on the platform), before you request any kind of ads.
You can also set the 2nd parameter (optional) enableDebug
to true
, if you want to enable debug option.
By default enableDebug
is false
.
You have to register your app in BlueStack console to get an App Id for your app.
Here's an example of how to initialize the SDK:
BluestackSDK.initialize(appId, true)
.then(() => {
console.log("BluestackSdk initialized");
})
.catch((e) => {
console.log("BluestackSdk failed to initialize: " + e);
});