Skip to content

Commit

Permalink
Merge pull request #18 from Explore-In-HMS/update_banner
Browse files Browse the repository at this point in the history
Added Banner Ad unit support
  • Loading branch information
ertug-sagman0 authored Jul 27, 2023
2 parents bf539a5 + 551fbc9 commit 3e2c58c
Show file tree
Hide file tree
Showing 7 changed files with 326 additions and 13 deletions.
6 changes: 6 additions & 0 deletions .idea/kotlinc.xml

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

1 change: 0 additions & 1 deletion .idea/misc.xml

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

72 changes: 67 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Huawei-IronSource Mediation Github Documentation

![Latest Version](https://img.shields.io/badge/latestVersion-1.1.3-yellow) ![Kotlin](https://img.shields.io/badge/language-kotlin-blue)
![Latest Version](https://img.shields.io/badge/latestVersion-1.2.0-yellow) ![Kotlin](https://img.shields.io/badge/language-kotlin-blue)
<br>
![Supported Platforms](https://img.shields.io/badge/Supported_Platforms:-Native_Android_-orange)
![Supported Platforms](https://img.shields.io/badge/-Flutter_-blue)


# Introduction
Expand All @@ -11,9 +12,10 @@ This is a project to demonstrate how to use IronSource’s mediation feature wit

# Compatibility

| | | Interstitial Ad | Rewarded Ad |
| --- | --- | --- | --- |
| Native (Java/Kotlin) | |||
| Platform | Banner Ad | Interstitial Ad | Rewarded Ad |
|----------------------|-----------| --- | --- |
| Native (Java/Kotlin) ||||
| Flutter (Dart) ||||


# How to start?
Expand Down Expand Up @@ -126,6 +128,14 @@ The HUAWEI Ads SDK (com.huawei.hms:ads) has integrated the required permissions.

# Version Change History

## 1.2.0

<ul>
<li>Banner Ad support added </li>
<li>Huawei Ads SDK version upgraded to <a href="https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/publisher-service-version-change-history-0000001050066909"><i>latest version</i></a>.</li>
<li>IronSource Android SDK version upgraded from 7.3.0 to <a href="https://developers.is.com/ironsource-mobile/android/android-sdk/#step-1"><i>7.3.0.1</i></a>.</li>
</ul>

## 1.1.3

<ul>
Expand Down Expand Up @@ -160,8 +170,11 @@ Firstly, integrate the IronSource SDK for Android

**Note** :
1) Developers can find app level build.gradle in their project from __**"app-folder/app/build.gradle"**__
2) 2) If you use the native ad format in your application, please submit a ticket [here](https://developer.huawei.com/consumer/en/support/feedback) to get support from Huawei.
2) If you use the native ad format in your application, please submit a ticket [here](https://developer.huawei.com/consumer/en/support/feedback) to get support from Huawei.

### **Banner Ad**

To use Banner ads in Native android apps, please check the IronSource SDK. Click [here](https://developers.is.com/ironsource-mobile/android/banner-integration-android/) to get more information about IronSource SDKs Banner Ad development.

### **Interstitial Ad**

Expand All @@ -172,6 +185,18 @@ To use Rewarded ads in Native android apps, please check the IronSource SDK. Cli

## **Sample Codes Based on Ad Types**

### **Banner Ad**

```jsx
// instantiate IronSourceBanner object, using the IronSource.createBanner API
val banner = IronSource.createBanner(this, ISBannerSize(320, 50))
// init the IronSource SDKAPP_KEY
IronSource.init(this, APP_KEY, IronSource.AD_UNIT.BANNER);
// load ad into the created banner
IronSource.loadBanner(banner);
// add IronSourceBanner to your container
findViewById<FrameLayout>(R.id.frame).addView(banner)
```
### **Interstitial Ad**

```jsx
Expand Down Expand Up @@ -204,12 +229,46 @@ To use Rewarded ads in Native android apps, please check the IronSource SDK. Cli
IronSource.showRewardedVideo()
```

## Flutter
This section demonstrates how to use IronSource feature with Huawei Ads Kit on Flutter.

Make sure to check the article on [How to use Huawei Ads with IronSource Mediation in Flutter?](https://medium.com/huawei-developers/how-to-use-huawei-ads-with-ironsource-mediation-in-flutter-cdf07e33ee18)

**Supported Ad Formats are:** Banner Ads, Interstitial Ads and Rewarded Ads.

Firstly, integrate the IronSource Flutter Plugin to Flutter.

For more details on IronSource Flutter Plugin visit [here](https://developers.is.com/ironsource-mobile/flutter/flutter-plugin/)

### **Banner Ads**
To use Banner ads in Flutter , please check the IronSource Flutter Plugin. Click [here](https://developers.is.com/ironsource-mobile/flutter/banner-integration-flutter/) to get more information about IronSource Flutter Banner Ad development.

### **Interstitial Ads**
To use Interstitial ads in Flutter, please check the IronSource Flutter Plugin. Click [here](https://developers.is.com/ironsource-mobile/flutter/interstitial-integration-flutter/) to get more information about IronSource Flutter Interstitial Ad development.

### **Rewarded Ads**
To use Rewarded ads in Flutter, please check the IronSource Flutter Plugin. Click [here](https://developers.is.com/ironsource-mobile/flutter/rewarded-video-integration-flutter/) to get more information about IronSource Flutter Banner Ad development.




#### **Step 1:**
Add the line **ironsource_mediation: ^1.1.0** to the dependicies section of your pubspec.yalm file
#### **Step 2:**
Go to android file of your project and add necessary configurations in [**Integrate the Huawei Mediation SDK**](#integrate-huawei-sdk) section

After these configurations is completed you can display Huawei Ads.


# Screenshots

## IronSource Ads
<table>
<tr>
<td>
<img src="https://github.com/Explore-In-HMS/huawei.ads.ironsource_mediation/assets/48774168/0e342edc-e42c-4c61-9473-eeb8441b0535" width="200">

Banner Ad
<td>
<img src="https://user-images.githubusercontent.com/19581388/144861246-62110f27-c0a5-451b-a28d-0cb4087c2c48.jpg" width="200">

Expand All @@ -228,7 +287,10 @@ Rewarded Ad
## Huawei Ads
<table>
<tr>
<td>
<img src="https://github.com/Explore-In-HMS/huawei.ads.ironsource_mediation/assets/48774168/c78f7428-3d55-4c06-83f8-56bf9efb1b52" width="200">

Banner Ad
<td>
<img src="https://user-images.githubusercontent.com/19581388/144861185-0991ebf4-7814-4642-bd2d-f83ad5a241bb.jpg" width="200">

Expand Down
3 changes: 1 addition & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ buildscript {
maven {
url 'https://android-sdk.is.com/'
}
maven { url 'https://developer.huawei.com/repo/' } // Add this line
maven {url "https://jitpack.io"} // Add this line
maven { url 'https://developer.huawei.com/repo/' }
}
dependencies {
classpath "com.android.tools.build:gradle:4.1.2"
Expand Down
22 changes: 18 additions & 4 deletions huaweiadsadapter/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ plugins {
id 'com.android.library'
id 'kotlin-android'
id 'com.github.dcendents.android-maven'
id 'maven-publish'
}

android {
compileSdkVersion 31
compileSdkVersion 33
buildToolsVersion "30.0.3"

defaultConfig {
minSdkVersion 16
targetSdkVersion 31
targetSdkVersion 33
versionCode 1
versionName "1.0"

Expand Down Expand Up @@ -41,10 +42,23 @@ dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.5.10"

implementation 'androidx.core:core-ktx:1.9.0'
implementation 'com.ironsource.sdk:mediationsdk:7.3.0'
implementation 'com.ironsource.sdk:mediationsdk:7.3.0.1'

compileOnly('com.huawei.hms:ads:3.4.61.304')
compileOnly('com.huawei.hms:ads:3.4.62.302')
}
repositories {
mavenCentral()
}

afterEvaluate {
publishing {
publications {
release(MavenPublication) {
from components.release
groupId = 'com.github.Explore-In-HMS'
artifactId = 'huawei.ads.ironsource_mediation'
version = '1.2.0'
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import com.ironsource.mediationsdk.adunit.adapter.utility.AdapterErrors
class HuaweiAdsAdapterCustomAdapter : BaseAdapter() {

private fun getVersion() = ADAPTER_VERSION
private var ADAPTER_VERSION = "1.1.0"
private var ADAPTER_VERSION = "1.2.0"
private val TAG = HuaweiAdsAdapterCustomAdapter::class.simpleName


Expand Down
Loading

0 comments on commit 3e2c58c

Please sign in to comment.