Skip to content

Commit

Permalink
Change Events API
Browse files Browse the repository at this point in the history
  • Loading branch information
bagaturchess committed Feb 12, 2023
1 parent 349e814 commit 0adc237
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 124 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,16 @@ private void request_sync(AdLoadFlow_Interstitial flow) {
//flow.cleanCurrent();

try {

IEventsManager eventsManager = Application_Base.getInstance().getEventsManager();
Context context = (getActivity() != null) ? getActivity() : Application_Base.getInstance();
eventsManager.register(context,
eventsManager.create(IEvent_Base.MARKETING, IEvent_Base.MARKETING_HOME_AD_INTERSTITIAL_OPENED, "APP_LIST".hashCode(),
"MARKETING", "HOME_AD_INTERSTITIAL_OPENED", "APP_LIST"));
IEvent_Base.EVENT_MARKETING_HOME_AD_INTERSTITIAL_OPENED.createByVarianceInCategory3(
"APP_LIST".hashCode(),
"APP_LIST"
)
);

} catch (Exception e) {
e.printStackTrace();
}
Expand All @@ -223,8 +228,11 @@ private void request_sync(AdLoadFlow_Interstitial flow) {
Context context = (getActivity() != null) ? getActivity() : Application_Base.getInstance();

eventsManager.register(context,
eventsManager.create(IEvent_Base.MARKETING, IEvent_Base.MARKETING_HOME_AD_INTERSTITIAL_OPENED, promoted.getID().hashCode(),
"MARKETING", "HOME_AD_INTERSTITIAL_OPENED", "" + promoted.getID()));
IEvent_Base.EVENT_MARKETING_HOME_AD_INTERSTITIAL_OPENED.createByVarianceInCategory3(
promoted.getID().hashCode(),
context.getString(promoted.getName())
)
);

} catch(Exception e) {

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,16 @@
import org.metatrans.commons.ads.api.IAdsConfigurations;
import org.metatrans.commons.ads.impl.AdsConfigurations_DynamicImpl;
import org.metatrans.commons.ads.impl.AdsManager;
import org.metatrans.commons.analytics.Analytics_ActivitiesStack;
import org.metatrans.commons.analytics.IAnalytics;
import org.metatrans.commons.model.GameData_Base;

import java.util.List;


public abstract class Application_Base_Ads extends Application_Base {


private AdsManager adsmanager;

private IAnalytics acitvities_stack = new Analytics_ActivitiesStack();

private IAdsConfigurations adsConfigurations;


Expand Down Expand Up @@ -68,12 +66,22 @@ public boolean openInterstitial() {

protected Activity getInterstitialActivity() {

return ((Analytics_ActivitiesStack) getAnalytics()).getInterstitialActivity();
List<Activity> stack = getActivitiesStack().getActivitiesStack();

for (Activity current: stack) {

if (current instanceof IActivityInterstitial) {

return current;
}
}

return null;

/* TODO: Use standard Android approach
ActivityManager m = (ActivityManager) getSystemService( ACTIVITY_SERVICE );
//TODO: Use standard Android approach (if there is any without additional permissions)
/*ActivityManager m = (ActivityManager) getSystemService( ACTIVITY_SERVICE );
List<ActivityManager.RunningTaskInfo> runningTaskInfoList = m.getRunningTasks(10);
List<ActivityManager.RunningTaskInfo> runningTaskInfoList = m.getRAppTasks();
Iterator<ActivityManager.RunningTaskInfo> iterator = runningTaskInfoList.iterator();
Expand All @@ -89,12 +97,6 @@ protected Activity getInterstitialActivity() {
}


@Override
public IAnalytics getAnalytics() {
return acitvities_stack;
}


@Override
public GameData_Base createGameDataObject() {
throw new UnsupportedOperationException();
Expand Down

0 comments on commit 0adc237

Please sign in to comment.