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
1 change: 1 addition & 0 deletions RNIronSourceOfferwall.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ module.exports = {
...RNIronSourceOfferwall,
initializeOfferwall: () => {}, // Deprecated. Here for backwards compatibility with 2.8.0
showOfferwall: () => RNIronSourceOfferwall.showOfferwall(),
setOWCustomParams: (field, paramValue) => RNIronSourceOfferwall.setOWCustomParams(field, paramValue),
addEventListener,
removeEventListener,
removeAllListeners
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import java.util.HashMap;
import java.util.Map;
import androidx.annotation.Nullable;
import com.facebook.react.bridge.Callback;
import com.facebook.react.bridge.WritableMap;
Expand Down Expand Up @@ -103,6 +105,8 @@ public void onGetOfferwallCreditsFailed(IronSourceError error) {
*/
@Override
public void onOfferwallClosed() {
Log.d(TAG, "onOfferwallClosed() called!");
sendEvent("ironSourceOfferwallClosedByUser", null);
}
});
}
Expand Down Expand Up @@ -130,6 +134,13 @@ public void run() {
});
}

@ReactMethod
public void setOWCustomParams(String field, String paramValue) {
Map<String, String> owParams = new HashMap<String, String>();
owParams.put(field, paramValue);
SupersonicConfig.getConfigObj().setOfferwallCustomParams(owParams);
}

private void sendEvent(String eventName, @Nullable WritableMap params) {
getReactApplicationContext().getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class).emit(eventName, params);
}
Expand Down
9 changes: 8 additions & 1 deletion ios/RNIronSourceOfferWall.m
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ -(void)safeInitializeOfferwall
if ([IronSource hasOfferwall]) {
NSLog(@"showOfferwall - offerwall available");
[self sendEventWithName:kIronSourceOfferwallAvailable body:nil];

dispatch_async(dispatch_get_main_queue(), ^{
[IronSource showOfferwallWithViewController:RCTPresentedViewController()];
});
Expand All @@ -61,6 +61,13 @@ -(void)safeInitializeOfferwall
}
}

RCT_EXPORT_METHOD(setOWCustomParams:(NSString *)field paramValue:(NSString *)paramValue)
{
NSMutableDictionary * owDic = [[NSMutableDictionary alloc] init];
owDic[field] = paramValue;
[ISConfigurations configurations].offerwallCustomParameters = owDic;
}


#pragma mark delegate events

Expand Down