
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
@allure-ai/react-native-iron-source
Advanced tools
React Native package to interface the ironSource SDK. https://ironsrc.com
Iron Source SDK React Native bridge. Supports all ad units (Rewarded Video, Interstitial, Banner, Offerwall).
Many thanks to all contributors of squaretwo/react-native-iron-source and the fork wowmaking/react-native-iron-source](https://github.com/wowmaking/react-native-iron-source).
The fork includes following improvements:
IronSource.setConsent
method@allure-ai/react-native-iron-source | Xcode | IronSourceSDK |
---|---|---|
7.0.0 | <= 11 | <= 7.0.1 |
>= 7.0.3 | >= 12 | >= 7.0.3 |
npm install @allure-ai/react-native-iron-source --save
You can find available versions here.
Add SKAdNetworkIdentifier
to your Info.plist
<key>SKAdNetworkItems</key>
<array>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>SU67R6K2V3.skadnetwork</string>
</dict>
</array>
Add a repo to your android/app/build.gradle
file
allprojects {
repositories {
// Existing repos here
// ...
maven { url 'https://android-sdk.is.com/' }
}
}
$ react-native link @allure-ai/react-native-iron-source
Libraries
➜ Add Files to [your project's name]
node_modules
➜ @allure-ai/react-native-iron-source
and add RNIronSource.xcodeproj
libRNIronSource.a
to your project's Build Phases
➜ Link Binary With Libraries
Cmd+R
)pod 'RNIronSource', :path => '../node_modules/@allure-ai/react-native-iron-source'
to your ios/Podfile
pod install
while in ios
directoryIf you are using Static Frameworks on iOS, you need to manually enable this for the project. To enable Static Framework support, add the following global to the top of your /ios/Podfile file:
$RNIronSourceAsStaticFramework = true
android/app/src/main/java/[...]/MainApplication.java
- Add import com.reactlibrary.RNIronSourcePackage;
to the imports at the top of the file
- Add new RNIronSourcePackage()
to the list returned by the getPackages()
methodandroid/settings.gradle
:
include ':@allure-ai_react-native-iron-source'
project(':@allure-ai_react-native-iron-source').projectDir = new File(rootProject.projectDir, '../node_modules/@allure-ai/react-native-iron-source/android')
android/app/build.gradle
:
implementation project(':@allure-ai_react-native-iron-source')
Do nothing.
Download the iOS SDK from Ironsrc.com
Unzip and rename the directory to IronSourceSDK
Copy the SDK to ~/Documents/IronSourceSDK
Drag the IronSource.framework
to your react native target build phases from the ~/Documents/IronSourceSDK
directory
Add ~/Documents/IronSourceSDK
to your target's Framework Search Paths in Build Settings
Add a repo to your app/build.gradle
file
repositories {
maven { url "https://dl.bintray.com/ironsource-mobile/android-sdk" }
}
WARNING! Make sure you following the doc carefully. If you miss something in the mediation setup process for some network it may not work partially or entirely. Follow guide for each mediation. Add your devices and simulators to test device list in ironsource admin panel.
Official doc:
Warning: Using this syntax means that you lock down your iOS CocoaPods dependencies to versions that we currently use in our organization. We don't recommend doing this because you might want another version at some point.
pod 'RNIronSource', :path => '../node_modules/@allure-ai/react-native-iron-source', :subspecs => [
'Core', # required
'AdColony',
'Admob',
'Amazon',
'AppLovin',
'Chartboost',
'Facebook',
'HyprMX',
'InMobi',
'Maio',
'MediaBrix',
'Tapjoy',
'UnityAds',
'Vungle'
]
You can use example app as a reference.
There is also an older example app for RN <= 0.59.x in this branch.
import { IronSource } from '@allure-ai/react-native-iron-source';
// After user granted consent
IronSource.setConsent(true);
import { IronSource } from '@allure-ai/react-native-iron-source';
IronSource.initializeIronSource('8a19a09d', 'userId', {
validateIntegration: true,
}).then(() => {
console.warn('Init finished');
});
import { IronSourceInterstitials } from '@allure-ai/react-native-iron-source';
IronSourceInterstitials.loadInterstitial();
IronSourceInterstitials.addEventListener('interstitialDidLoad', () => {
IronSourceInterstitials.showInterstitial();
});
import { IronSourceRewardedVideo } from '@allure-ai/react-native-iron-source';
IronSourceRewardedVideo.initializeRewardedVideo();
IronSourceRewardedVideo.addEventListener('ironSourceRewardedVideoAdRewarded', res => {
console.warn('Rewarded!', res)
});
// or use IronSourceRewardedVideo.addEventListener('ironSourceRewardedVideoAvailable')
// to get video status
IronSourceRewardedVideo.isRewardedVideoAvailable().then((available) => {
if (available) {
IronSourceRewardedVideo.showRewardedVideo();
} else {
throw new Error('No video available');
}
})
import { IronSourceBanner } from '@allure-ai/react-native-iron-source';
IronSourceBanner.loadBanner('LARGE');
IronSourceBanner.addEventListener('ironSourceBannerDidLoad', () => {
console.warn('Iron Source banner loaded');
IronSourceBanner.showBanner();
});
import { IronSourceOfferwall } from '@allure-ai/react-native-iron-source';
IronSourceOfferwall.showOfferwall();
IronSourceOfferwall.addEventListener('ironSourceOfferwallReceivedCredits', res => {
console.warn('Got credits', res)
});
Initializes IronSource SDK.
validateIntegration
provides an easy way to verify
that you’ve successfully integrated the ironSource
SDK and any additional adapters; it also makes sure all
required dependencies and frameworks were added for
the various mediated ad networks. It doesn't validate Amazon adapter in current version.
See official docs for Android,
iOS.
There's known issue in ios 12. See known issue section.
IronSource.initializeIronSource('8a19a09d', 'userId', {
validateIntegration: true
})
.then(() => {
console.warn('Init finished');
});
Loads IronSource banner. Returns a promise that will be resolved when banner loads successfully and rejected when it fails.
"BANNER"
, "LARGE"
, "RECTANGLE"
, "SMART"
"top"
or "bottom"
. Default: "bottom"
.IronSourceBanner.loadBanner('BANNER', {
position: 'top',
scaleToFitWidth: true,
})
.then(response => {
console.warn(`width: ${response.width}, height: ${response.height}`);
})
.catch(err => {
console.warn(err.message);
});
IronSourceBanner.hideBanner();
Creates a segment manager
import { IronSourceSegment } from '@allure-ai/react-native-iron-source';
const segment = new IronSourceSegment();
Sets custom user property
segment.setCustomValue('VALUE').forKey('KEY');
Sets custom segment name
segment.setSegmentName('NAME');
Makes currently existing segment active. Once it's active IronSource SDK will use it to serve your ad units based on segments to tailor the user’s ad experience.
segment.activate();
Check if a reward video is available to be shown. Return a Promise resolving a boolean.
IronSourceRewardedVideo.isRewardedVideoAvailable().then((available) => {
if (available) {
// Video available
} else {
// Video not available
}
});
Name | Description |
---|---|
ironSourceBannerDidLoad | Called after a banner ad has been successfully loaded |
ironSourceBannerDidFailToLoadWithError | Called after a banner has attempted to load an ad but failed |
ironSourceBannerDidDismissScreen | Called after a full screen content has been dismissed |
ironSourceBannerWillLeaveApplication | Called when a user would be taken out of the application context |
ironSourceBannerWillPresentScreen | Called when a banner is about to present a full screen content |
ironSourceDidClickBanner | Called after a banner has been clicked |
Name | Description |
---|---|
ironSourceRewardedVideoAvailable | Called after a rewarded video has changed its availability to YES. It means that now you can show the ad |
ironSourceRewardedVideoUnavailable | Called after a rewarded video has changed its availability to NO |
ironSourceRewardedVideoClosedByUser | Called after a rewarded video has been dismissed |
ironSourceRewardedVideoDidStart | Called after a rewarded video has started playing. Note: this event is not available for all supported rewarded video ad networks. Check which events are available per ad network you choose |
ironSourceRewardedVideoClosedByError | Called after a rewarded video has attempted to show but failed |
ironSourceRewardedVideoDidOpen | Called after a rewarded video has been opened |
ironSourceRewardedVideoAdStarted | Called after a rewarded video has been opened |
ironSourceRewardedVideoAdEnded | Called after a rewarded video has finished playing. Note: this event is not available for all supported rewarded video ad networks. Check which events are available per ad network you choose |
ironSourceRewardedVideoAdRewarded | Invoked when the user completed the video and should be rewarded |
Name | Description |
---|---|
interstitialDidLoad | Invoked when Interstitial Ad is ready to be shown after load function was called |
interstitialDidShow | Called each time the Interstitial window has opened successfully |
interstitialDidFailToShowWithError | Called if showing the Interstitial for the user has failed |
didClickInterstitial | Called each time the end user has clicked on the Interstitial ad |
interstitialDidClose | Called each time the Interstitial window is about to close |
interstitialDidOpen | Called each time the Interstitial window is about to open |
interstitialDidFailToLoadWithError | Invoked when there is no Interstitial Ad available after calling load function |
Name | Description |
---|---|
ironSourceOfferwallAvailable | Invoked when there is a change in the Offerwall availability status to YES |
ironSourceOfferwallUnavailable | Invoked when there is a change in the Offerwall availability status to NO |
ironSourceOfferwallDidShow | Called each time the Offerwall successfully loads for the user |
ironSourceOfferwallClosedByUser | Called when the user closes the Offerwall |
ironSourceOfferwallClosedByError | Called each time the Offerwall fails to show |
ironSourceOfferwallReceivedCredits | Called each time the user completes an offer |
ironSourceOfferwallFailedToReceiveCreditsByError | Called when failed to retrieve the users credit balance info |
You can find out more about events in the official doc. Start here if you wish.
Ads may stop loading properly when "Reload" option (or CMD+R) in your React Native app was used. You have to restart the app completely if you want to check that ads load and display correctly.
FAQs
React Native package to interface the ironSource SDK. https://ironsrc.com
We found that @allure-ai/react-native-iron-source demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.