Skip to content

Commit

Permalink
added error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Rajat Dhamija authored and Rajat Dhamija committed Sep 7, 2023
1 parent ba8b832 commit e221564
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .safedk/hashes.safedk
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#Wed Sep 06 16:28:53 IST 2023
json=-1009632347
#Thu Sep 07 11:38:46 IST 2023
json=-725478122
2 changes: 1 addition & 1 deletion .safedk/plugin.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
#Wed Sep 06 16:28:53 IST 2023
#Thu Sep 07 11:38:46 IST 2023
gcyVX2np_6N23XxVZWl_N5eTnUgybgZyIMqdBXeWJG4Rniy3LcTOhMvrRTQLpcMePJw9t1uk4O0X2yHg2RNpE9=pA3NAGLWSFkdUbKoK9gLEDnpXe6x8XU6D2TgT5vsHlZXt4FATcoLWTvA3fHBVhG6hh7HJWJa6JD1akUlTlVgwx
sdk_analysis_plugin_version=4.9.1
set_multidex=true
7 changes: 4 additions & 3 deletions adsdk/src/main/java/com/appyhigh/adsdk/AdSdk.kt
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,14 @@ object AdSdk {
private var isAppLovinInitialized = false
private var updateDialog: Dialog? = null
private var isNotShownAlready = true
fun isPopupEnabled(): Boolean {
fun isPopupEnabled(context: Context): Boolean {
SharedPrefs.init(context)
adConfig.init()
return adConfig.isPopupEnabled()
}

fun showPopupAd(context: Activity) {
if (isPopupEnabled() && isNotShownAlready) {
if (isPopupEnabled(context) && isNotShownAlready) {
isNotShownAlready = false
updateDialog = Dialog(context)
updateDialog?.setContentView(R.layout.update_dialog)
Expand Down Expand Up @@ -208,7 +209,7 @@ object AdSdk {
addTestDevice(testDevice, advertisingId, application)
DynamicAds().fetchRemoteAdConfiguration(application.packageName)
try {
if (isPopupEnabled()) {
if (isPopupEnabled(context = application.applicationContext)) {
adInitializeListener.onHardStopEnabled(adConfig.getRedirectUri())
return
}
Expand Down

0 comments on commit e221564

Please sign in to comment.