Skip to content

Commit

Permalink
Disabled SplashAd, Added new setIABUSPrivacyString
Browse files Browse the repository at this point in the history
  • Loading branch information
itsSoufianeDev committed Feb 28, 2023
1 parent 11317c8 commit c58ee69
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 114 deletions.
11 changes: 7 additions & 4 deletions plugin.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<plugin id="cordova-plugin-startapp-ads" version="1.3.0"
<plugin id="cordova-plugin-startapp-ads" version="1.3.1"
xmlns="http://apache.org/cordova/ns/plugins/1.0">
<name>StartApp Ads</name>
<description />
Expand All @@ -18,7 +18,8 @@
<platform name="android">
<config-file mode="merge" parent="/manifest/application" target="AndroidManifest.xml">

<meta-data android:name="com.startapp.sdk.APPLICATION_ID" android:value="209797308" />
<meta-data android:name="com.startapp.sdk.RETURN_ADS_ENABLED" android:value="false" />
<meta-data android:name="com.startapp.sdk.SPLASH_ENABLED" android:value="false" />

<provider
android:name="com.startapp.sdk.adsbase.StartAppInitProvider"
Expand Down Expand Up @@ -71,6 +72,7 @@
<source-file src="src/android/StartAppInApp-4.10.2.jar" target-dir="libs" />
</platform>

<!--
<platform name="ios">
<config-file parent="/*" target="config.xml">
<feature name="StartAppAds">
Expand All @@ -82,10 +84,11 @@
<source-file src="src/ios/StartAppAds.m" />
<framework src="src/ios/StartApp.framework" custom="true" />
<!--<framework src="StoreKit.framework" weak="true" />
<framework src="StoreKit.framework" weak="true" />
<framework src="Foundation.framework" />
<framework src="CoreGraphics.framework" />
<framework src="UIKit.framework" />-->
<framework src="UIKit.framework" />
</platform>
-->
</plugin>
14 changes: 14 additions & 0 deletions src/android/StartAppAdsPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,15 @@ public void run() {
});
return true;
}
else if(action.equals("setIABUSPrivacyString")) {
cordova.getActivity().runOnUiThread(new Runnable() {
public void run() {
String IABString = args.optString(0);
setIABUSPrivacyString(IABString, PUBLIC_CALLBACKS);
}
});
return true;
}
return false;
}

Expand All @@ -138,6 +147,11 @@ public void setConsent(Boolean consented, CallbackContext callbackContext) {
StartAppSDK.setUserConsent(cordova.getActivity(), "pas", System.currentTimeMillis(), consented);
}

public void setIABUSPrivacyString(String IABString, CallbackContext callbackContext) {
Log.d(TAG, "Setting IAB US Privacy To: " + IABString);
StartAppSDK.getExtras(cordova.getActivity()).edit().putString("IABUSPrivacy_String", IABString).apply();
}

public void loadBanner(CallbackContext callbackContext){
startAppBanner = new Banner(cordova.getActivity(), new BannerListener() {
@Override
Expand Down
24 changes: 0 additions & 24 deletions src/ios/StartAppAds.h

This file was deleted.

86 changes: 0 additions & 86 deletions src/ios/StartAppAds.m

This file was deleted.

3 changes: 3 additions & 0 deletions www/startappads.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ var StartAppAds = {
setConsent: function(consented) {
exec(function(){}, function(){}, "StartAppAdsPlugin", "setConsent", [ consented ]);
},
setIABUSPrivacyString: function(IABString){
exec(function(){}, function(){}, "StartAppAdsPlugin", "setIABUSPrivacyString", [ IABString ]);
},
loadBanner: function() {
exec(function(){}, function(){}, "StartAppAdsPlugin", "loadBanner", []);
},
Expand Down

0 comments on commit c58ee69

Please sign in to comment.