Skip to content

Commit

Permalink
Merge pull request #2 from hashcube/feature-changes-for-andorid
Browse files Browse the repository at this point in the history
module supersonic updated as ironsource
  • Loading branch information
vivekb91 authored Jun 12, 2017
2 parents fd6a751 + e9612f9 commit 0427cb5
Show file tree
Hide file tree
Showing 31 changed files with 121 additions and 120 deletions.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Game Closure DevKit Module: Supersonic / ironSource
# Game Closure DevKit Module: Ironsource / ironSource


This module allows you to display interstitial, video ads and offerwalls
from the Supersonic mediation service.
from the Ironsource mediation service.

Both iOS and Android targets are supported.

Expand All @@ -12,33 +12,33 @@ Install the module into your application using the standard
devkit install process.

~~~
devkit install https://github.com/hashcube/supersonic
devkit install https://github.com/hashcube/ironsource
~~~

## Setup

Setup supersonic by configuring the supersonicApp key in manifest.json.
The supersonicAppKey can be fetched from the Supersonic/ironsource dashboard
Setup ironsource by configuring the ironsourceApp key in manifest.json.
The ironsourceAppKey can be fetched from the Ironsource/ironsource dashboard

#### Manifest.json
~~~
"android": {
"supersonicAppKey": "key",
"ironsourceAppKey": "key",
},
~~~

~~~
"ios": {
"supersonicAppKey": "key",
"ironsourceAppKey": "key",
},
~~~

You must add all of the providers you wish to bundle with your application
to the `addons.supersonic.<PLATFORM>.providers` lists or they will not be
to the `addons.ironsource.<PLATFORM>.providers` lists or they will not be
included in the build and you will not be able to use them in your game.
~~~
"addons": {
"supersonic": {
"ironsource": {
"android": {
"providers": [
"chartboost",
Expand Down Expand Up @@ -66,16 +66,16 @@ The plugin comes with several ad providers already
available in order to make using the plugin as easy as possible.

Adding one of the included providers is usually as easy as adding
the provider name to the manifest `addons.supersonic.[platform].providers`
list and adding any necessary SDK keys. The supersonic module will
the provider name to the manifest `addons.ironsource.[platform].providers`
list and adding any necessary SDK keys. The ironsource module will
use the providers list to automatically create all of your configuration

To use any of these, in the game please add it the `addons` block in manifest.json
as mentioned before.

## Integrating Additional Providers

To integrate additional providers supportd by supersonic, you'll need to
To integrate additional providers supportd by ironsource, you'll need to
manually add all of the files and configuration to the correct locations in
the build/providers/<provider_name> folder.

Expand Down
32 changes: 16 additions & 16 deletions build/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,34 +48,34 @@ exports.onBeforeBuild = function (api, app, config, cb) {
// read manifest for which providers are enabled
if (config.target === 'native-android') {
if (!app.manifest.addons ||
!app.manifest.addons.supersonic ||
!app.manifest.addons.supersonic.android ||
!app.manifest.addons.supersonic.android.providers) {
console.warn('{supersonic} No providers found -- looked in manifest.addons.supersonic.android.providers');
!app.manifest.addons.ironsource ||
!app.manifest.addons.ironsource.android ||
!app.manifest.addons.ironsource.android.providers) {
console.warn('{ironsource} No providers found -- looked in manifest.addons.ironsource.android.providers');
} else {
providers = app.manifest.addons.supersonic.android.providers;
providers = app.manifest.addons.ironsource.android.providers;
}
folder = 'android';
} else {
if (!app.manifest.addons ||
!app.manifest.addons.supersonic ||
!app.manifest.addons.supersonic.ios ||
!app.manifest.addons.supersonic.ios.providers) {
console.warn('{supersonic} No providers found -- looked in manifest.addons.supersonic.ios.providers');
!app.manifest.addons.ironsource ||
!app.manifest.addons.ironsource.ios ||
!app.manifest.addons.ironsource.ios.providers) {
console.warn('{ironsource} No providers found -- looked in manifest.addons.ironsource.ios.providers');
} else {
providers = app.manifest.addons.supersonic.ios.providers;
providers = app.manifest.addons.ironsource.ios.providers;
}
folder = 'ios';
}

// always include supersonic
providers.push('supersonic');
// always include ironsource
providers.push('ironsource');

// read provider config and copy any necessary files
for (i = 0; i < providers.length; i++) {

provider = providers[i];
console.log("{supersonic} Adding provider", provider);
console.log("{ironsource} Adding provider", provider);
dirname = path.join(__dirname, 'providers', provider, folder);

// read provider config.json
Expand Down Expand Up @@ -131,7 +131,7 @@ exports.onBeforeBuild = function (api, app, config, cb) {
);
}

// path to plugin platform folder (eg: supersonic/android)
// path to plugin platform folder (eg: ironsource/android)
platformPath = path.join(__dirname, '..', folder);

// remove the target folder in the plugin and recreate with correct content
Expand Down Expand Up @@ -187,7 +187,7 @@ exports.onBeforeBuild = function (api, app, config, cb) {

return Promise.all(writePromises);
}).spread(function () {
console.log("{supersonic} Finished setting up providers");
console.log("{ironsource} Finished setting up providers");
cb();
});
}
Expand Down Expand Up @@ -311,7 +311,7 @@ var mergeConfig = function (config, newConfig) {
} else {
// warn about overwriting keys
console.warn(
"{supersonic} Warning - onBeforeBuild config overwrote existing key",
"{ironsource} Warning - onBeforeBuild config overwrote existing key",
key
);
config[key] = newConfig[key];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"copyFiles": [
"SupersonicPlugin.java"
"IronsourcePlugin.java"
],
"jars": [
"mediationsdk-6.6.1.jar"
Expand Down
Loading

0 comments on commit 0427cb5

Please sign in to comment.