From e9da61411a6f1c993d528b659ebb3e5147aa44cc Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Wed, 2 Jul 2014 00:09:36 -0300 Subject: Fixed Bugs & Joypad in Android ================================ -resolved many graphical glitches with multiple lights in GLES2 render -fixes and WIP apk expansion -joystick support for Android by Ariel --- platform/iphone/app_delegate.mm | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) (limited to 'platform/iphone') diff --git a/platform/iphone/app_delegate.mm b/platform/iphone/app_delegate.mm index c5ac5d9263..9ba95ff0c5 100644 --- a/platform/iphone/app_delegate.mm +++ b/platform/iphone/app_delegate.mm @@ -37,6 +37,12 @@ #include "modules/FacebookScorer_ios/FacebookScorer.h" #endif +#ifdef MODULE_GAME_ANALYTICS_ENABLED +#import "modules/game_analytics/ios/MobileAppTracker.framework/Headers/MobileAppTracker.h" +//#import "modules/game_analytics/ios/MobileAppTracker.h" +#import +#endif + #define kFilteringFactor 0.1 #define kRenderingFrequency 60 #define kAccelerometerFrequency 100.0 // Hz @@ -210,7 +216,36 @@ static int frame_count = 0; //OSIPhone::screen_width = rect.size.width - rect.origin.x; //OSIPhone::screen_height = rect.size.height - rect.origin.y; - mainViewController = view_controller; + mainViewController = view_controller; + +#ifdef MODULE_GAME_ANALYTICS_ENABLED + printf("********************* didFinishLaunchingWithOptions\n"); + if(!Globals::get_singleton()->has("mobileapptracker/advertiser_id")) + { + return; + } + if(!Globals::get_singleton()->has("mobileapptracker/conversion_key")) + { + return; + } + + String adid = GLOBAL_DEF("mobileapptracker/advertiser_id",""); + String convkey = GLOBAL_DEF("mobileapptracker/conversion_key",""); + + NSString * advertiser_id = [NSString stringWithUTF8String:adid.utf8().get_data()]; + NSString * conversion_key = [NSString stringWithUTF8String:convkey.utf8().get_data()]; + + // Account Configuration info - must be set + [MobileAppTracker initializeWithMATAdvertiserId:advertiser_id + MATConversionKey:conversion_key]; + + // Used to pass us the IFA, enables highly accurate 1-to-1 attribution. + // Required for many advertising networks. + [MobileAppTracker setAppleAdvertisingIdentifier:[[ASIdentifierManager sharedManager] advertisingIdentifier] + advertisingTrackingEnabled:[[ASIdentifierManager sharedManager] isAdvertisingTrackingEnabled]]; + +#endif + }; - (void)applicationWillTerminate:(UIApplication*)application { @@ -240,6 +275,10 @@ static int frame_count = 0; - (void) applicationDidBecomeActive:(UIApplication *)application { printf("********************* did become active\n"); +#ifdef MODULE_GAME_ANALYTICS_ENABLED + printf("********************* mobile app tracker found\n"); + [MobileAppTracker measureSession]; +#endif [view_controller.view startAnimation]; // FIXME: resume seems to be recommended elsewhere } -- cgit v1.2.3