Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix HypRate functionality on iOS #2

Open
wants to merge 14 commits into
base: haxe3
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add setAppId method to HypRate to set the appid on ios. The method do…
…es nothing on android so is safe to call
Joshua committed Oct 10, 2013
commit eee86b5e98aeb3fc1a3eb138cb68033043cd73a0
10 changes: 10 additions & 0 deletions project/android/fr/hyperfiction/HypRate.java
Original file line number Diff line number Diff line change
@@ -58,6 +58,16 @@ static public void show( ) {
rmm.forceShow( );
}

/**
*
*
* @public
* @return void
*/
static public void setAppId( String appId ){
trace("setAppId does nothing on Android");
}

/**
*
*
5 changes: 5 additions & 0 deletions project/common/ExternalInterface.cpp
Original file line number Diff line number Diff line change
@@ -35,6 +35,11 @@ extern "C"{
// iPhone ---------------------------------------------------------------------------------------------------------

#ifdef IPHONE
value HypRate_setAppId( value s ) {
Hyperfiction::setAppId( val_string( s ) );
return alloc_null( );
}
DEFINE_PRIM( HypRate_setAppId , 1 );

value HypRate_setDialog_title( value s ) {
Hyperfiction::setDialog_title( val_string( s ) );
20 changes: 15 additions & 5 deletions project/iPhone/HypRate.mm
Original file line number Diff line number Diff line change
@@ -14,6 +14,16 @@
#include "include/Appirater.h"
namespace Hyperfiction{

/**
*
*
* @public
* @return void
*/
void setAppId( const char *s ){
[Appirater setAppId:[[[NSString alloc] initWithUTF8String:s] autorelease]];
}

/**
*
*
@@ -63,19 +73,19 @@ void setNeutral_text( const char *s ){
void setCancel_text( const char *s ){
[Appirater setCancel_text:[[[NSString alloc] initWithUTF8String:s] autorelease]];
}

/**
*
*
* @public
* @return void
*/
void start( int minL , int minD , int untilL , int unitD ){
[Appirater setAppId:@"552035781"];
[Appirater setDaysUntilPrompt:1];
[Appirater setUsesUntilPrompt:10];
[Appirater setUsesUntilPrompt:minL];
[Appirater setDaysUntilPrompt:minD];
// Disable significant event criterion
[Appirater setSignificantEventsUntilPrompt:-1];
[Appirater setTimeBeforeReminding:2];
[Appirater setTimeBeforeReminding:unitD];
[Appirater setDebug:YES];
}

3 changes: 2 additions & 1 deletion project/include/HypRate.h
Original file line number Diff line number Diff line change
@@ -13,6 +13,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
#define Device

namespace Hyperfiction{
void setAppId( const char *s );
void setDialog_title( const char *s );
void setDialog_msg( const char *s );
void setPositive_text( const char *s );
@@ -22,4 +23,4 @@ namespace Hyperfiction{
void show( );
}

#endif
#endif
16 changes: 16 additions & 0 deletions src/fr/hyperfiction/HypRate.hx
Original file line number Diff line number Diff line change
@@ -40,6 +40,22 @@ class HypRate{
iMin_days_until_next : Int
) : Void {
}

/**
*
*
* @public
* @return void
*/
#if android
@JNI
#end
#if ios
@CPP
#end
static public function setAppId( appId : String ){

}

/**
*