{"_id":"@allure-ai/react-native-iron-source","_rev":"1-27318813bffef2c5d4f29564caec5986","name":"@allure-ai/react-native-iron-source","dist-tags":{"latest":"7.0.5"},"versions":{"7.0.5":{"name":"@allure-ai/react-native-iron-source","version":"7.0.5","description":"React Native package to interface the ironSource SDK.  https://ironsrc.com","main":"index.js","scripts":{"postinstall":"./scripts/linkSKAdNetwork.sh SU67R6K2V3 ../../.."},"bin":{"rnis-linker":"scripts/linkSKAdNetwork.sh"},"keywords":["react-native","ironsrc","iron source"],"repository":{"type":"git","url":"git+https://github.com/allure-ai/react-native-iron-source.git"},"homepage":"https://github.com/allure-ai/react-native-iron-source#README","author":{"name":"Allure AI","email":"opensource@allure.id","url":"https://github.com/allure-ai"},"license":"MIT","peerDependencies":{"react-native":">= 0.40.0"},"devDependencies":{"json":"^10.0.0"},"gitHead":"c7dbd171193483964195a0563fdd82aad6d09396","bugs":{"url":"https://github.com/allure-ai/react-native-iron-source/issues"},"_id":"@allure-ai/react-native-iron-source@7.0.5","_nodeVersion":"16.13.0","_npmVersion":"8.1.0","dist":{"integrity":"sha512-CBqlqDoE7Nj3hSHHb/dxq9iuW8ENpDskAN35x97aMugr+h+gl0RnYLWPwRMS/oDypj0B/VrIj1b000VEzwZVYA==","shasum":"06364856fbbd83c183f67368e3ac34631cd8b717","tarball":"https://registry.npmjs.org/@allure-ai/react-native-iron-source/-/react-native-iron-source-7.0.5.tgz","fileCount":37,"unpackedSize":100503,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhurrFCRA9TVsSAnZWagAAA3gP/isEZZWMIo1VhQ+xFkqq\n9Yasl9qX7r8jvywD9BQdIpl/vsy43RvGzzNaQufmFU3A+60yIUdoIAaayDLi\nJJ7LaFU4vYZObm6NCE8hcf6MQUkFG+X+yJPwsRdhbns/yBFYjwL4cKSvN9r6\naJNSJkRv66s+bE7uehp0GpT9a/8dbRygQ2BCT7aK/o62Oj6vQenloNJFcJ/Y\nnwQ8X41k+dVEX+GUtEeDWR0k7ogJHEBSHeQ0kL/lEqOskIXNozO3jnD8DZtL\n0/eSa84WGuITn2L9RZ8lHExbCx/Q68FZ6fxtEtPR3BpB5/9jKe8mE5Ix42bJ\n9emxICgGXF1lxVdOjqSOX21KDBfKF9DB8HWAN+fSf3GYlTBWPy4WtLpxGz28\nCk0EvGkKhornRCEcF7C5dFTp8SIfsdZT01hdhFkjX9N1LrQXuTvIDe1z8MWw\nZBtwjHyEjkBeQ2w37jJnsJymyS2vaGyUGENvbheJqDPXXjFobdY2aam1lD+D\nOgnBwNp7++S3MLzjzmNFRw1xHnmcssJq6nBF4gnFwnup4rhPUo+oF/+fWf59\nekuzaaA+VDTT3x/A3nWrA6Xf52dw1ITB23ArV6eNUSc8/lW375w6aUzGG5Y9\nFXiIoRwZl0fejbkg/XZiAYuZ9XWd9eGckjFvpyFEZB/+7lGyyVDSvM19Wo5F\nSkYn\r\n=LKyx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHr0DiDeSguNQll7ltwpPhogco8eKzH3tHkj9ghe/PKEAiBaMakqmOHClTB3zpD3o4+kxGaGwGdosOXmIF49sIqLnw=="}]},"_npmUser":{"name":"didithilmy","email":"npm@hilmy.org"},"directories":{},"maintainers":[{"name":"didithilmy","email":"npm@hilmy.org"},{"name":"allureai","email":"opensource@allure.id"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-iron-source_7.0.5_1639627461663_0.850839926277936"},"_hasShrinkwrap":false}},"time":{"created":"2021-12-16T04:04:21.582Z","7.0.5":"2021-12-16T04:04:21.852Z","modified":"2022-04-04T13:35:12.169Z"},"maintainers":[{"name":"didithilmy","email":"npm@hilmy.org"},{"name":"allureai","email":"opensource@allure.id"}],"description":"React Native package to interface the ironSource SDK.  https://ironsrc.com","homepage":"https://github.com/allure-ai/react-native-iron-source#README","keywords":["react-native","ironsrc","iron source"],"repository":{"type":"git","url":"git+https://github.com/allure-ai/react-native-iron-source.git"},"author":{"name":"Allure AI","email":"opensource@allure.id","url":"https://github.com/allure-ai"},"bugs":{"url":"https://github.com/allure-ai/react-native-iron-source/issues"},"license":"MIT","readme":"\n# @allure-ai/react-native-iron-source\n\n[Iron Source SDK](https://developers.ironsrc.com/) React Native bridge. \nSupports all ad units (Rewarded Video, Interstitial, Banner, Offerwall).\n\nMany thanks to all contributors of [squaretwo/react-native-iron-source](https://github.com/squaretwo/react-native-iron-source) and the fork wowmaking/react-native-iron-source](https://github.com/wowmaking/react-native-iron-source). \n\nThe fork includes following improvements:\n* Banner implementation\n* Bug fixes for Offerwall, Interstitial, Rewarded\n* Documentation\n* Installation using CocoaPods\n* Easier installation on android \n* [Validate integration option](https://developers.ironsrc.com/ironsource-mobile/ios/integration-helper-ios/)\n* `IronSource.setConsent` method\n* Working Example App\n* etc\n\n## Compatibility table\n\n| @allure-ai/react-native-iron-source | Xcode  | IronSourceSDK |\n| ----------------------------------- | ------ | ------------- |\n| 7.0.0                               | <= 11  | <= 7.0.1      |\n| \\>= 7.0.3                           | \\>= 12 | \\>= 7.0.3     |\n\n## Getting started\n\n`npm install @allure-ai/react-native-iron-source --save`\n\nYou can find available versions [here](https://github.com/allure-ai/react-native-iron-source/releases).\n\n### RN >= 0.60\n\n#### iOS\nAdd `SKAdNetworkIdentifier` to your Info.plist\n```xml\n<key>SKAdNetworkItems</key>\n<array>\n    <dict>\n        <key>SKAdNetworkIdentifier</key>\n        <string>SU67R6K2V3.skadnetwork</string>\n    </dict>\n</array>\n```\n \n#### Android\n Add a repo to your `android/app/build.gradle` file \n ```\n allprojects {\n     repositories {\n         // Existing repos here\n         // ...\n         \n         maven { url 'https://android-sdk.is.com/' }\n     }\n }\n ```\n\n\n<details>\n  <summary>\n    expand/collapse\n    <h3>RN < 0.60</h3>\n  </summary>\n\n  #### Mostly automatic installation\n  \n  `$ react-native link @allure-ai/react-native-iron-source`\n  \n  #### Manual installation\n  \n  \n  ##### iOS\n  \n  1. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]`\n  2. Go to `node_modules` ➜ `@allure-ai/react-native-iron-source` and add `RNIronSource.xcodeproj`\n  3. In XCode, in the project navigator, select your project. Add `libRNIronSource.a` to your project's `Build Phases` ➜ `Link Binary With Libraries`\n  4. Run your project (`Cmd+R`)\n  \n  ##### iOS CocoaPods\n  1. Add `pod 'RNIronSource', :path => '../node_modules/@allure-ai/react-native-iron-source'` to your `ios/Podfile`\n  2. Run `pod install` while in `ios` directory\n  \n  #### Allow iOS Static Frameworks\n  If 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:\n  `$RNIronSourceAsStaticFramework = true`\n\n  ##### Android\n  \n  1. Open up `android/app/src/main/java/[...]/MainApplication.java`\n    - Add `import com.reactlibrary.RNIronSourcePackage;` to the imports at the top of the file\n    - Add `new RNIronSourcePackage()` to the list returned by the `getPackages()` method\n  2. Append the following lines to `android/settings.gradle`:\n    \t```\n    \tinclude ':@allure-ai_react-native-iron-source'\n    \tproject(':@allure-ai_react-native-iron-source').projectDir = new File(rootProject.projectDir, \t'../node_modules/@allure-ai/react-native-iron-source/android')\n    \t```\n  3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:\n    \t```\n      implementation project(':@allure-ai_react-native-iron-source')\n    \t```\n  \n  ### Manual Setup\n  \n  #### IronSource iOS SDK\n  \n  ##### For projects with CocoaPods\n  \n  Do nothing.\n  \n  ##### For other projects\n  \n  1. Download the iOS SDK from [Ironsrc.com](http://developers.ironsrc.com/ironsource-mobile/ios/ios-sdk/)\n  2. Unzip and rename the directory to `IronSourceSDK`\n  3. Copy the SDK to `~/Documents/IronSourceSDK`\n  4. Drag the `IronSource.framework` to your react native target build phases from the `~/Documents/IronSourceSDK` directory\n  5. Add `~/Documents/IronSourceSDK` to your target's Framework Search Paths in Build Settings\n  \n  \n  #### Android\n  Add a repo to your `app/build.gradle` file \n  ```\n  repositories {\n      maven { url \"https://dl.bintray.com/ironsource-mobile/android-sdk\" }\n  }\n  ```\n</details>\n\n## Mediation Setup\n\n**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.\n\nOfficial doc:\n- [Android](https://developers.ironsrc.com/ironsource-mobile/android/mediation-networks-android/#step-1).\n- [iOS](https://developers.ironsrc.com/ironsource-mobile/ios/mediation-networks-ios/#step-1).\n\n<details>\n <summary>Optional syntax (not recommended)</summary>\n \n__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.\n\n```\npod 'RNIronSource', :path => '../node_modules/@allure-ai/react-native-iron-source', :subspecs => [\n    'Core', # required\n    'AdColony',\n    'Admob',\n    'Amazon',\n    'AppLovin',\n    'Chartboost',\n    'Facebook',\n    'HyprMX',\n    'InMobi',\n    'Maio',\n    'MediaBrix',\n    'Tapjoy',\n    'UnityAds',\n    'Vungle'\n]\n```\n</details>\n\n## Usage\n\nYou can use [example app](https://github.com/allure-ai/react-native-iron-source/tree/master/ExampleApp) as a reference.\n\nThere is also an older example app for RN <= 0.59.x [in this branch](https://github.com/allure-ai/react-native-iron-source/tree/example-app-59/ExampleApp).\n\n### Initialization\n\n<details>\n <summary>1. (Optional) Obtain user's consent to share user data with ad network publishers.</summary>\n \n ```javascript\n import { IronSource } from '@allure-ai/react-native-iron-source';\n\n // After user granted consent\n\n IronSource.setConsent(true);\n ```\n</details> \n\n2. Initialize IronSource SDK\n\n```javascript\nimport { IronSource } from '@allure-ai/react-native-iron-source';\n\nIronSource.initializeIronSource('8a19a09d', 'userId', {\n  validateIntegration: true,\n}).then(() => {\n  console.warn('Init finished');\n});\n```\n\n### Interstitial\n\n```javascript\nimport { IronSourceInterstitials } from '@allure-ai/react-native-iron-source';\n\nIronSourceInterstitials.loadInterstitial();\nIronSourceInterstitials.addEventListener('interstitialDidLoad', () => {\n  IronSourceInterstitials.showInterstitial();\n});\n```\n### Rewarded Video\n\n```javascript\nimport { IronSourceRewardedVideo } from '@allure-ai/react-native-iron-source';\n\n\nIronSourceRewardedVideo.initializeRewardedVideo();\nIronSourceRewardedVideo.addEventListener('ironSourceRewardedVideoAdRewarded', res => {\n  console.warn('Rewarded!', res)\n});\n\n// or use IronSourceRewardedVideo.addEventListener('ironSourceRewardedVideoAvailable') \n// to get video status\nIronSourceRewardedVideo.isRewardedVideoAvailable().then((available) => {\n  if (available) {\n    IronSourceRewardedVideo.showRewardedVideo();\n  } else {\n    throw new Error('No video available');\n  }\n})\n```\n### Banner\n\n```javascript\nimport { IronSourceBanner } from '@allure-ai/react-native-iron-source';\n\nIronSourceBanner.loadBanner('LARGE');\nIronSourceBanner.addEventListener('ironSourceBannerDidLoad', () => {\n  console.warn('Iron Source banner loaded');\n  IronSourceBanner.showBanner();\n});\n```\n### Offerwall\n\n```javascript\nimport { IronSourceOfferwall } from '@allure-ai/react-native-iron-source';\n\nIronSourceOfferwall.showOfferwall();\nIronSourceOfferwall.addEventListener('ironSourceOfferwallReceivedCredits', res => {\n  console.warn('Got credits', res)\n});\n```\n\n\n## API (Incomplete)\n\n### IronSource.initializeIronSource(ironSourceAppKey, userId, options)\nInitializes IronSource SDK. \n\n `validateIntegration` provides an easy way to verify \nthat you’ve successfully integrated the ironSource \nSDK and any additional adapters; it also makes sure all\n required dependencies and frameworks were added for \n the various mediated ad networks. It doesn't validate Amazon adapter in current version.\n See official docs for [Android](https://developers.ironsrc.com/ironsource-mobile/android/integration-helper-android/), \n [iOS](https://developers.ironsrc.com/ironsource-mobile/ios/integration-helper-ios/).\n  There's known issue in ios 12. See known issue section.\n#### Parameter(s)\n* **ironSourceAppKey:** String. Can be found in Iron Source administrator's interface\n* **userId:** String. Any unique user id.\n* **options:** Object (optional)\n    * **validateIntegration:** Boolean. Default: false\n#### Returns Promise\n\n```javascript\nIronSource.initializeIronSource('8a19a09d', 'userId', {\n  validateIntegration: true\n})\n  .then(() => {\n    console.warn('Init finished');\n  });\n```\n\n### IronSourceBanner.loadBanner(options)\nLoads IronSource banner. Returns a promise that will be resolved when banner loads successfully and rejected when it fails.\n\n#### Parameter(s)\n* **size**: String. Supported values: `\"BANNER\"`, `\"LARGE\"`, `\"RECTANGLE\"`, `\"SMART\"`\n* **options:** Object (optional)\n    * **position:** String. Supported values: `\"top\"` or `\"bottom\"`. Default: `\"bottom\"`.\n    * **scaleToFitWidth:** Boolean. Default: false\n#### Returns Promise of\n* **response:** Object\n    * **width:** Number\n    * **height:** Number\n\n```javascript\nIronSourceBanner.loadBanner('BANNER', {\n  position: 'top',\n  scaleToFitWidth: true,\n})\n  .then(response => {\n    console.warn(`width: ${response.width}, height: ${response.height}`);\n  })\n  .catch(err => {\n    console.warn(err.message);\n  });\n```\n\n### IronSourceBanner.hideBanner()\n```javascript\nIronSourceBanner.hideBanner();\n```\n\n### IronSourceSegment constructor\nCreates a segment manager\n```javascript\nimport { IronSourceSegment } from '@allure-ai/react-native-iron-source';\n\nconst segment = new IronSourceSegment();\n```\n\n### IronSourceSegment.setCustomValue\nSets custom user property\n```javascript\nsegment.setCustomValue('VALUE').forKey('KEY');\n```\n\n### IronSourceSegment.setSegmentName\nSets custom segment name\n\n```javascript\nsegment.setSegmentName('NAME');\n```\n\n### IronSourceSegment.activate\nMakes 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.\n\n```javascript\nsegment.activate();\n```\n\n### IronSourceRewardedVideo.isRewardedVideoAvailable\nCheck if a reward video is available to be shown.\nReturn a Promise resolving a boolean.\n\n```javascript\nIronSourceRewardedVideo.isRewardedVideoAvailable().then((available) => {\n  if (available) {\n    // Video available\n  } else {\n    // Video not available\n  }\n});\n```\n\n## Events\n\n### Banner events\n| Name | Description |\n| ---- | ----------- |\n| ironSourceBannerDidLoad | Called after a banner ad has been successfully loaded |\n| ironSourceBannerDidFailToLoadWithError | Called after a banner has attempted to load an ad but failed |\n| ironSourceBannerDidDismissScreen | Called after a full screen content has been dismissed |\n| ironSourceBannerWillLeaveApplication | Called when a user would be taken out of the application context |\n| ironSourceBannerWillPresentScreen | Called when a banner is about to present a full screen content |\n| ironSourceDidClickBanner | Called after a banner has been clicked |\n\n### Rewarded video events\n| Name | Description |\n| ---- | ----------- |\n| ironSourceRewardedVideoAvailable | Called after a rewarded video has changed its availability to YES. It means that now you can show the ad |\n| ironSourceRewardedVideoUnavailable | Called after a rewarded video has changed its availability to NO |\n| ironSourceRewardedVideoClosedByUser | Called after a rewarded video has been dismissed |\n| 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 |\n| ironSourceRewardedVideoClosedByError | Called after a rewarded video has attempted to show but failed |\n| ironSourceRewardedVideoDidOpen | Called after a rewarded video has been opened |\n| ironSourceRewardedVideoAdStarted | Called after a rewarded video has been opened |\n| 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 |\n| ironSourceRewardedVideoAdRewarded | Invoked when the user completed the video and should be rewarded |\n\n### Interstitial events\n| Name | Description |\n| ---- | ----------- |\n| interstitialDidLoad | Invoked when Interstitial Ad is ready to be shown after load function was called |\n| interstitialDidShow | Called each time the Interstitial window has opened successfully |\n| interstitialDidFailToShowWithError | Called if showing the Interstitial for the user has failed |\n| didClickInterstitial | Called each time the end user has clicked on the Interstitial ad |\n| interstitialDidClose | Called each time the Interstitial window is about to close |\n| interstitialDidOpen | Called each time the Interstitial window is about to open |\n| interstitialDidFailToLoadWithError | Invoked when there is no Interstitial Ad available after calling load function |\n\n\n### Offerwall events\n| Name | Description |\n| ---- | ----------- |\n| ironSourceOfferwallAvailable | Invoked when there is a change in the Offerwall availability status to YES |\n| ironSourceOfferwallUnavailable | Invoked when there is a change in the Offerwall availability status to NO |\n| ironSourceOfferwallDidShow | Called each time the Offerwall successfully loads for the user |\n| ironSourceOfferwallClosedByUser | Called when the user closes the Offerwall |\n| ironSourceOfferwallClosedByError | Called each time the Offerwall fails to show |\n| ironSourceOfferwallReceivedCredits | Called each time the user completes an offer |\n| ironSourceOfferwallFailedToReceiveCreditsByError | Called when failed to retrieve the users credit balance info |\n\nYou can find out more about events in the official doc. Start [here](https://developers.ironsrc.com/ironsource-mobile/ios/rewarded-video-integration-ios/) if you wish.\n\n## Known issues\n\nAds 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.\n\n---\n\n\n","readmeFilename":"README.md"}