Update the flurry SDK version.

This commit is contained in:
zhangbin 2013-06-06 11:21:45 +08:00
parent f26530748a
commit 5b43951e8c
9 changed files with 130 additions and 52 deletions

View File

@ -1 +1 @@
b1b3d66b623e17b0419f2c24e07da7caeaedc2c3 0fd2439e2bfeee847ea873ee45b6177b5208db97

View File

@ -31,6 +31,7 @@ import org.json.JSONObject;
import android.content.Context; import android.content.Context;
import android.util.Log; import android.util.Log;
import com.flurry.android.Constants;
import com.flurry.android.FlurryAgent; import com.flurry.android.FlurryAgent;
public class AnalyticsFlurry implements InterfaceAnalytics { public class AnalyticsFlurry implements InterfaceAnalytics {
@ -119,15 +120,7 @@ public class AnalyticsFlurry implements InterfaceAnalytics {
@Override @Override
public String getSDKVersion() { public String getSDKVersion() {
LogD("getSDKVersion invoked!"); return "3.2.0";
String ret = "";
try {
int nRet = FlurryAgent.getAgentVersion();
ret = "Flurry android ver " + nRet;
} catch(Exception e){
LogE("Exception in getSDKVersion", e);
}
return ret;
} }
protected void logTimedEventBeginWithParams(JSONObject eventInfo) { protected void logTimedEventBeginWithParams(JSONObject eventInfo) {
@ -191,10 +184,16 @@ public class AnalyticsFlurry implements InterfaceAnalytics {
} }
} }
protected void setGender(byte gender) { protected void setGender(int gender) {
LogD("setGender invoked!"); LogD("setGender invoked!");
try { try {
FlurryAgent.setGender(gender); byte bGender;
if (1 == gender) {
bGender = Constants.MALE;
} else {
bGender = Constants.FEMALE;
}
FlurryAgent.setGender(bGender);
} catch(Exception e){ } catch(Exception e){
LogE("Exception in setGender", e); LogE("Exception in setGender", e);
} }

View File

@ -50,7 +50,7 @@ THE SOFTWARE.
interfaces of flurry SDK interfaces of flurry SDK
*/ */
- (void) setAge: (NSNumber*) age; - (void) setAge: (NSNumber*) age;
- (void) setGender: (NSString*) gender; - (void) setGender: (NSNumber*) gender;
- (void) setUserId: (NSString*) userId; - (void) setUserId: (NSString*) userId;
- (void) setUseHttps: (NSNumber*) enabled; - (void) setUseHttps: (NSNumber*) enabled;
- (void) logPageView; - (void) logPageView;

View File

@ -97,7 +97,7 @@ THE SOFTWARE.
- (NSString*) getSDKVersion - (NSString*) getSDKVersion
{ {
return [Flurry getFlurryAgentVersion]; return @"4.2.1";
} }
- (NSString*) getPluginVersion - (NSString*) getPluginVersion
@ -112,10 +112,17 @@ THE SOFTWARE.
[Flurry setAge:nAge]; [Flurry setAge:nAge];
} }
- (void) setGender: (NSString*) gender - (void) setGender: (NSNumber*) gender
{ {
OUTPUT_LOG(@"Flurry setGender invoked (%@)", gender); OUTPUT_LOG(@"Flurry setGender invoked (%@)", gender);
[Flurry setGender:gender]; int nValue = [gender intValue];
NSString* strGender;
if (nValue == 1) {
strGender = @"m";
} else {
strGender = @"f";
}
[Flurry setGender:strGender];
} }
- (void) setUserId: (NSString*) userId - (void) setUserId: (NSString*) userId

82
plugin/plugins/flurry/proj.ios/Flurry.h Normal file → Executable file
View File

@ -20,7 +20,7 @@
* attract high-quality users and monetize your user base see <a href="http://support.flurry.com/index.php?title=Publishers">Support Center - Publishers</a>. * attract high-quality users and monetize your user base see <a href="http://support.flurry.com/index.php?title=Publishers">Support Center - Publishers</a>.
* *
* @author 2009 - 2012 Flurry, Inc. All Rights Reserved. * @author 2009 - 2012 Flurry, Inc. All Rights Reserved.
* @version 4.0.0 * @version 4.2.0
* *
*/ */
@interface Flurry : NSObject { @interface Flurry : NSObject {
@ -124,6 +124,19 @@
*/ */
+ (void)setSecureTransportEnabled:(BOOL)value; + (void)setSecureTransportEnabled:(BOOL)value;
/*!
* @brief Enable automatic collection of crash reports.
* @since 4.1
*
* This is an optional method that collects crash reports when enabled. The
* default value is @c NO.
*
* @note This method must be called prior to invoking #startSession:.
*
* @param value @c YES to enable collection of crash reports.
*/
+ (void)setCrashReportingEnabled:(BOOL)value;
//@} //@}
/*! /*!
@ -135,6 +148,9 @@
* for the period the app is in the foreground until your app is backgrounded for the * for the period the app is in the foreground until your app is backgrounded for the
* time specified in #setSessionContinueSeconds:. If the app is resumed in that period * time specified in #setSessionContinueSeconds:. If the app is resumed in that period
* the session will continue, otherwise a new session will begin. * the session will continue, otherwise a new session will begin.
*
* Crash reporting will not be enabled. See #startSession:enableCrashReporting: for
* more information.
* *
* @note If testing on a simulator, please be sure to send App to background via home * @note If testing on a simulator, please be sure to send App to background via home
* button. Flurry depends on the iOS lifecycle to be complete for full reporting. * button. Flurry depends on the iOS lifecycle to be complete for full reporting.
@ -155,6 +171,39 @@
+ (void)startSession:(NSString *)apiKey; + (void)startSession:(NSString *)apiKey;
/*!
* @brief Start a Flurry session for the project denoted by @c apiKey.
* @since 4.0.8
*
* This method serves as the entry point to Flurry Analytics collection. It must be
* called in the scope of @c applicationDidFinishLaunching passing in the launchOptions param.
* The session will continue
* for the period the app is in the foreground until your app is backgrounded for the
* time specified in #setSessionContinueSeconds:. If the app is resumed in that period
* the session will continue, otherwise a new session will begin.
*
* @note If testing on a simulator, please be sure to send App to background via home
* button. Flurry depends on the iOS lifecycle to be complete for full reporting.
*
* @see #setSessionContinueSeconds: for details on setting a custom session timeout.
*
* @code
* - (BOOL) application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Optional Flurry startup methods
[Flurry startSession:@"YOUR_API_KEY" withOptions:launchOptions];
// ....
}
* @endcode
*
* @param apiKey The API key for this project.
* @param options passed launchOptions from the applicatin's didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
*/
+ (void) startSession:(NSString *)apiKey withOptions:(id)options;
/** @name Event and Error Logging /** @name Event and Error Logging
* Methods for reporting custom events and errors during the session. * Methods for reporting custom events and errors during the session.
*/ */
@ -547,12 +596,18 @@
* @code * @code
CLLocationManager *locationManager = [[CLLocationManager alloc] init]; CLLocationManager *locationManager = [[CLLocationManager alloc] init];
[locationManager startUpdatingLocation]; [locationManager startUpdatingLocation];
* @endcode
*
* After starting the location manager, you can set the location with Flurry. You can implement
* CLLocationManagerDelegate to be aware of when the location is updated. Below is an example
* of how to use this method, after you have recieved a location update from the locationManager.
*
* @code
CLLocation *location = locationManager.location; CLLocation *location = locationManager.location;
[Flurry setLatitude:location.coordinate.latitude [Flurry setLatitude:location.coordinate.latitude
longitude:location.coordinate.longitude longitude:location.coordinate.longitude
horizontalAccuracy:location.horizontalAccuracy horizontalAccuracy:location.horizontalAccuracy
verticalAccuracy:location.verticalAccuracy]; verticalAccuracy:location.verticalAccuracy];
* @endcode * @endcode
* @param latitude The latitude. * @param latitude The latitude.
* @param longitude The longitude. * @param longitude The longitude.
@ -588,7 +643,7 @@
* @brief Set session to report when app is sent to the background. * @brief Set session to report when app is sent to the background.
* @since 2.7 * @since 2.7
* *
* Use this method report session data when the app is paused. The default value is @c NO. * Use this method report session data when the app is paused. The default value is @c YES.
* *
* @param setSessionReportsOnPauseEnabled YES to send on pause, NO to omit reporting on pause. * @param setSessionReportsOnPauseEnabled YES to send on pause, NO to omit reporting on pause.
* *
@ -604,7 +659,18 @@
* @param value YES to enable event logging, NO to stop custom logging. * @param value YES to enable event logging, NO to stop custom logging.
* *
*/ */
+ (void)setEventLoggingEnabled:(BOOL)value; + (void)setEventLoggingEnabled:(BOOL)value;
/*!
* @brief Set device push token.
* @since 2.7
*
* After the device has successfully registered with APNS, call this method to set the push token received from APNS.
*
*
*/
+ (void)setPushToken:(NSString *)pushToken;
//@} //@}

View File

@ -1 +1 @@
ec28ecfb3c84a48adf091f84229fdf90b049072d 9bd56193e2377b31e9254506f3ed39b4c185b4e9

View File

@ -29,7 +29,7 @@ echo
echo echo
echo Now publish protocols echo Now publish protocols
echo --------------------------------- echo ---------------------------------
./toolsForPublish/publishPlugin.sh "protocols" ${TARGET_ROOT} ${PLUGIN_ROOT} 1 ./toolsForPublish/publishPlugin.sh "protocols" ${TARGET_ROOT} ${PLUGIN_ROOT}
echo --------------------------------- echo ---------------------------------
#publish plugins #publish plugins

View File

@ -1,6 +1,7 @@
# Modify mk file # Modify mk file
MK_FILE_PATH=$1 MK_FILE_PATH=$1
TEMP_FILE_PATH=$(dirname ${MK_FILE_PATH})/temp.txt TEMP_FILE_PATH=$(dirname ${MK_FILE_PATH})/temp.txt
SELECTED_PLUGINS=(${NEED_PUBLISH//:/ })
############################### ###############################
# functions used # functions used
@ -23,28 +24,34 @@ getStaticModuleName()
if [ -f ${MK_FILE_PATH} ]; then if [ -f ${MK_FILE_PATH} ]; then
ADD_MODULE_STR="" ADD_MODULE_STR=""
ADD_IMPORT_STR="" ADD_IMPORT_STR=""
for plugin_name in ${SELECTED_PLUGINS[@]}
do
PLUGIN_MK_FILE=${TARGET_ROOT}/${plugin_name}/android/Android.mk
if [ ! -f "${PLUGIN_MK_FILE}" ]; then
continue
fi
plugin_name="protocols" PLUGIN_MODULE_NAME="$(getStaticModuleName ${plugin_name})"
PLUGIN_MODULE_NAME="$(getStaticModuleName ${plugin_name})" HAVE_PLUGIN=`grep "^\([\s]*[^#]*\)${PLUGIN_MODULE_NAME}" ${MK_FILE_PATH}`
HAVE_PLUGIN=`grep "^\([\s]*[^#]*\)${PLUGIN_MODULE_NAME}" ${MK_FILE_PATH}` if [ "${HAVE_PLUGIN}" ]; then
if [ "${HAVE_PLUGIN}" ]; then # already have this plugin
# already have this plugin echo "Plugin ${plugin_name} have added in Android.mk"
echo "Plugin ${plugin_name} have added in Android.mk" continue
continue
else
if [ -z "${ADD_MODULE_STR}" ]; then
ADD_MODULE_STR=${PLUGIN_MODULE_NAME}
else else
ADD_MODULE_STR="${ADD_MODULE_STR} ${PLUGIN_MODULE_NAME}" if [ -z "${ADD_MODULE_STR}" ]; then
ADD_MODULE_STR=${PLUGIN_MODULE_NAME}
else
ADD_MODULE_STR="${ADD_MODULE_STR} ${PLUGIN_MODULE_NAME}"
fi
NEW_LINE="\$(call import-module,${plugin_name}/android)"
if [ -z "${ADD_IMPORT_STR}" ]; then
ADD_IMPORT_STR=${NEW_LINE}
else
ADD_IMPORT_STR="${ADD_IMPORT_STR}:${NEW_LINE}"
fi
fi fi
done
NEW_LINE="\$(call import-module,${plugin_name}/android)"
if [ -z "${ADD_IMPORT_STR}" ]; then
ADD_IMPORT_STR=${NEW_LINE}
else
ADD_IMPORT_STR="${ADD_IMPORT_STR}:${NEW_LINE}"
fi
fi
# Modify the mk file if necessary # Modify the mk file if necessary
if [ "${ADD_MODULE_STR}" ]; then if [ "${ADD_MODULE_STR}" ]; then
@ -109,3 +116,4 @@ else
fi fi
exit 0 exit 0

View File

@ -101,8 +101,8 @@ if [ -d "${ANDROID_PROJ_DIR}/ForAssets" ]; then
fi fi
#Build C++ code #Build C++ code
BUILD_CPLUSPLUS=$4 BUILD_NATIVE_SCRIPT=${ANDROID_PROJ_DIR}/build_native.sh
if [ $BUILD_CPLUSPLUS ]; then if [ -f $BUILD_NATIVE_SCRIPT ]; then
echo "Build C++ code" echo "Build C++ code"
@ -120,11 +120,9 @@ if [ $BUILD_CPLUSPLUS ]; then
fi fi
#invoke ndk build for plugin project #invoke ndk build for plugin project
if [ -f "${ANDROID_PROJ_DIR}/build_native.sh" ]; then ./build_native.sh
./build_native.sh LIB_FILE="$(getLibraryFileName)"
LIB_FILE="$(getLibraryFileName)" cp -rf "${ANDROID_PROJ_DIR}/obj/local/armeabi/${LIB_FILE}" "${TARGET_DIR}/android"
cp -rf "${ANDROID_PROJ_DIR}/obj/local/armeabi/${LIB_FILE}" "${TARGET_DIR}/android"
fi
#generate mk file for prebuild #generate mk file for prebuild
${PLUGIN_ROOT}/tools/toolsForPublish/genPrebuildMK.sh ${ANDROID_PROJ_DIR}/jni/Android.mk ${TARGET_DIR}/android/Android.mk ${PLUGIN_ROOT}/tools/toolsForPublish/genPrebuildMK.sh ${ANDROID_PROJ_DIR}/jni/Android.mk ${TARGET_DIR}/android/Android.mk