iOS: Flurry SDK w/ Monkey
Monkey Forums/Monkey Code/iOS: Flurry SDK w/ Monkey
| ||
Native iOS Code:/* ** Flurry.cpp */ #import "FlurryAPI.h" static void _uncaughtExceptionHandler( NSException *exception ) { [FlurryAPI logError:@"Uncaught Exception" message:@"Crash!" exception:exception]; } void Flurry_Init( String ApiKey ) { printf( "%s\n", __func__ ); NSSetUncaughtExceptionHandler( &_uncaughtExceptionHandler ); [FlurryAPI startSession:ApiKey.ToNSString()]; [FlurryAPI setSessionReportsOnCloseEnabled:YES]; [FlurryAPI setSessionReportsOnPauseEnabled:YES]; } void Flurry_LogEvent( String eventName ) { printf( "%s: %s\n", __func__, eventName.ToCString<char>() ); [FlurryAPI logEvent:eventName.ToNSString()]; } void Flurry_LogEventTimed( String eventName ) { printf( "%s: %s\n", __func__, eventName.ToCString<char>() ); [FlurryAPI logEvent:eventName.ToNSString() timed:YES]; } void Flurry_EndTimedEvent( String eventName ) { printf( "%s: %s\n", __func__, eventName.ToCString<char>() ); [FlurryAPI endTimedEvent:eventName.ToNSString() withParameters:nil]; } Monkey Interface: 'flurry.monkey Private Import "flurry.cpp" Extern '<-- Externs 'Public' by default Function Flurry_Init:Void( ApiKey$ ) Function Flurry_LogEvent:Void( eventName$ ) Function Flurry_LogEventTimed:Void( eventName$ ) Function Flurry_EndTimedEvent:Void( eventName$ ) Usage: 'main.monkey Import flurry Function Main() Flurry_Init( "<api-key-here>" ) Flurry_LogEvent( "<event-name-here>" ) End Enjoy! |
| ||
Hello David I start working with flurry and is no compilating :(. In new flurry version (4.x) name of header file is Flurry.h. I change you FlurryApi.h to Flurry.h and placed this file in module folder. But monkey say is error. fatal error: 'Flurry.h' file not found #import "Flurry.h". In zip this code on a module. https://dl.dropbox.com/u/8580859/flurry.zip Where do I put the file Flurry.h, to make it work? |