/**	@lua	showOffers
	@text	Displays the Tapjoy marketplace.
				
	@out	nil
*/
int MOAITapjoyAndroid::_showOffers ( lua_State* L ) {
	MOAI_JAVA_LUA_SETUP ( MOAITapjoyAndroid, "" )
	
	jstring userID = self->GetJString ( state.GetValue < cc8* >( 1, 0 ));

	jmethodID showOffers = self->GetStaticMethod ( "showOffers", "()V" );
	self->CallStaticVoidMethod ( showOffers );
	return 0;
}
/**	@lua	setUserId
 	@text	Sets the tapjoy user ID.
 
 	@in		string userId
 */
int MOAITapjoyAndroid::_setUserId ( lua_State *L ) {
	MOAI_JAVA_LUA_SETUP ( MOAITapjoyAndroid, "" )
	
	jstring userID = self->GetJString ( state.GetValue < cc8* >( 1, 0 ));

	jmethodID setUserID = self->GetStaticMethod ( "setUserId", "(Ljava/lang/String;)V" );
	self->CallStaticVoidMethod ( setUserID, userID );
	return 0;
}
示例#3
0
//----------------------------------------------------------------//
int MOAIChartBoostAndroid::_showInterstitial ( lua_State* L ) {
	MOAI_JAVA_LUA_SETUP ( MOAIChartBoostAndroid, "" )

	MOAIJString jlocation = self->GetJString ( state.GetValue < cc8* >( 1, 0 ));

	jmethodID showInterstitial = self->GetStaticMethod ( "showInterstitial", "(Ljava/lang/String;)V" );
	self->CallStaticVoidMethod ( showInterstitial, ( jstring )jlocation );
	return 0;
}
示例#4
0
//----------------------------------------------------------------//
int MOAIChartBoostAndroid::_hasCachedInterstitial ( lua_State* L ) {
	MOAI_JAVA_LUA_SETUP ( MOAIChartBoostAndroid, "" )

	MOAIJString jlocation = self->GetJString ( state.GetValue < cc8* >( 1, 0 ));

	jmethodID cacheInterstitial = self->GetStaticMethod ( "hasCachedInterstitial", "(Ljava/lang/String;)Z" );
	state.Push ( self->CallStaticBooleanMethod ( cacheInterstitial, ( jstring )jlocation ));
	return 1;
}
/**	@lua	init
	@text	Initializes Tapjoy.
				
	@in		string	appId				Available in Tapjoy dashboard settings.
	@in		string	secretKey			Available in Tapjoy dashboard settings.
	@in		number	videoCacheCount
	@out	nil
*/
int MOAITapjoyAndroid::_init ( lua_State* L ) {
	MOAI_JAVA_LUA_SETUP ( MOAITapjoyAndroid, "" )
	
	jstring appID			= self->GetJString ( state.GetValue < cc8* >( 1, "" ));
	jstring appSignature	= self->GetJString ( state.GetValue < cc8* >( 2, "" ));
	int	videoCacheCount		= state.GetValue < int >( 3, 1 );
	
	printf ( "attempting to get init method" );
	jmethodID init = self->GetStaticMethod ( "init", "(Ljava/lang/String;Ljava/lang/String;I)V" );
	self->CallStaticVoidMethod ( init, appID, appSignature, videoCacheCount );
	
	return 0;
}
示例#6
0
//----------------------------------------------------------------//
int MOAIChartBoostAndroid::_init ( lua_State* L ) {
	MOAI_JAVA_LUA_SETUP ( MOAIChartBoostAndroid, "" )
	
	ZLLog::LogF ( 1, ZLLog::CONSOLE, "MOAIChartBoostAndroid::_init\n" );

	ZLLog::LogF ( 1, ZLLog::CONSOLE, "MOAIChartBoostAndroid: Getting jappID...\n" );
	ZLLog::LogF ( 1, ZLLog::CONSOLE, "MOAIChartBoostAndroid: state.GetValue < cc8* >( 1, 0 ): %s\n",state.GetValue < cc8* >( 1, 0 ) );
	MOAIJString jappID			= self->GetJString ( state.GetValue < cc8* >( 1, 0 ));

	ZLLog::LogF ( 1, ZLLog::CONSOLE, "MOAIChartBoostAndroid: Getting jappSignature...\n" );

	MOAIJString jappSignature	= self->GetJString ( state.GetValue < cc8* >( 2, 0 ));
	ZLLog::LogF ( 1, ZLLog::CONSOLE, "MOAIChartBoostAndroid: Got jappSignature\n" );
	jmethodID init = self->GetStaticMethod ( "init", "(Ljava/lang/String;Ljava/lang/String;)V" );

	ZLLog::LogF ( 1, ZLLog::CONSOLE, "MOAIChartBoostAndroid: Calling init\n" );
	self->CallStaticVoidMethod ( init, ( jstring )jappID, ( jstring )jappSignature );
	ZLLog::LogF ( 1, ZLLog::CONSOLE, "MOAIChartBoostAndroid: Done calling init\n" );
	return 0;
}