Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 RedPill

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,22 @@ IronSourceRewardedVideo.isRewardedVideoAvailable().then((available) => {
});
```

### IronSourceRewardedVideo.isRewardedVideoPlacementCapped(PlacementName)
Check if a reward video placement is capped.
Take a string corresponding to the placement desired and return a boolean.
If a wrong placement name is given, the function is applied to the default placement configured.

```javascript
async isRewardedVideoPlacementCapped(placementName) {
try {
return IronSourceRewardedVideo.isRewardedVideoPlacementCapped(placementName);
}
catch (e) {
console.error('isRewardedVideoPlacementCapped failed: ', e);
}
}
```

## Events

### Banner events
Expand Down
2 changes: 1 addition & 1 deletion RNIronSource.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ Pod::Spec.new do |s|
s.static_framework = false
end

end
end
1 change: 1 addition & 0 deletions RNIronSourceRewardedVideo.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ module.exports = {
...RNIronSourceRewardedVideo,
initializeRewardedVideo: () => RNIronSourceRewardedVideo.initializeRewardedVideo(),
showRewardedVideo: (placementName) => RNIronSourceRewardedVideo.showRewardedVideo(placementName),
isRewardedVideoPlacementCapped: (placementName) => RNIronSourceRewardedVideo.isRewardedVideoPlacementCapped(placementName),
isRewardedVideoAvailable: () => RNIronSourceRewardedVideo.isRewardedVideoAvailable(),
setDynamicUserId: (userId) => RNIronSourceRewardedVideo.setDynamicUserId(userId),
addEventListener,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,18 @@ public void run() {
});
}

@ReactMethod
public void isRewardedVideoPlacementCapped(final String placementName, Promise promise) {
try {
Log.d(TAG, "isRewardedVideoPlacementCapped() called!!");
promise.resolve(IronSource.isRewardedVideoPlacementCapped(placementName));
}
catch (Exception e) {
Log.d(TAG, "isRewardedVideoPlacementCapped error %s", e);
promise.reject("isRewardedVideoPlacementCapped, Error, " + e);
}
}

@ReactMethod
public void isRewardedVideoAvailable(Promise promise) {
try {
Expand Down
2 changes: 1 addition & 1 deletion ios/RNIronSource.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ - (dispatch_queue_t)methodQueue
{
NSLog(@"initializeIronSource called!! with key %@ and user id %@", appId, userId);
[IronSource setUserId:userId];
[IronSource initWithAppKey:appId];
[IronSource initWithAppKey:appId adUnits:@[IS_REWARDED_VIDEO]];

BOOL validateIntegration = [RCTConvert BOOL:options[@"validateIntegration"]];
if (validateIntegration) {
Expand Down
11 changes: 11 additions & 0 deletions ios/RNIronSourceRewardedVideo.m
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,17 @@ - (dispatch_queue_t)methodQueue
}
}

RCT_EXPORT_METHOD(isRewardedVideoPlacementCapped:(NSString*)placementName : (RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
{
@try {
resolve(@([IronSource isRewardedVideoCappedForPlacement:@"Placement"]));
}
@catch (NSException *exception) {
NSLog(@"isRewardedVideoCappedForPlacement, Error, %@", exception.reason);
reject(@"isRewardedVideoCappedForPlacement, Error, %@", exception.reason, nil);
}
}

RCT_EXPORT_METHOD(isRewardedVideoAvailable:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
{
@try {
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@wowmaking/react-native-iron-source",
"version": "3.3.6",
"version": "3.3.11",
"description": "React Native package to interface the ironSource SDK. https://ironsrc.com",
"main": "index.js",
"scripts": {
Expand Down