Commit 9bef1a8d authored by Matyáš Latner's avatar Matyáš Latner

#421 Added support for different debug and release sentry dsn keys for ios....

#421 Added support for different debug and release sentry dsn keys for ios. Removed Flurry, which wasnt compatible with ARMv7
parent cb6b7530
......@@ -29,7 +29,7 @@ android {
applicationIdSuffix rootProject.applicationIdBranch + rootProject.applicationIdDebugSuffix
buildConfigField ASSETS_CHECKSUM_FIELD_TYPE, ASSETS_CHECKSUM_FIELD_NAME, rootProject.ext.assetsChecksumPattern
resValue "string", "app_name", "${tablexiaAppName}"
resValue "string", "sentry_dsn", project.hasProperty('SENTRY_DSN_DEBUG') ? "$SENTRY_DSN_DEBUG" : "$project.sentryDSNFallbackValue";
resValue "string", "sentry_dsn", project.hasProperty('TABLEXIA_SENTRY_DSN_DEBUG') ? "$TABLEXIA_SENTRY_DSN_DEBUG" : "$project.sentryDSNFallbackValue";
resValue "string", "sentry_dsn_fallback_value", "$project.sentryDSNFallbackValue";
}
release {
......@@ -37,7 +37,7 @@ android {
applicationIdSuffix rootProject.applicationIdBranch
buildConfigField ASSETS_CHECKSUM_FIELD_TYPE, ASSETS_CHECKSUM_FIELD_NAME, rootProject.ext.assetsChecksumPattern
resValue "string", "app_name", "${tablexiaAppName}"
resValue "string", "sentry_dsn", project.hasProperty('SENTRY_DSN_RELEASE') ? "$SENTRY_DSN_RELEASE" : "$project.sentryDSNFallbackValue";
resValue "string", "sentry_dsn", project.hasProperty('TABLEXIA_SENTRY_DSN_RELEASE') ? "$TABLEXIA_SENTRY_DSN_RELEASE" : "$project.sentryDSNFallbackValue";
resValue "string", "sentry_dsn_fallback_value", "$project.sentryDSNFallbackValue";
}
devel.initWith(buildTypes.debug)
......
......@@ -28,7 +28,7 @@ task debugJar(type: Jar) {
attributes 'Version-Name': tablexiaVersionName
attributes 'Assets-Cheksums': getMapConvertedToString(rootProject.ext.assetsChecksum)
attributes 'Sentry-DSN': project.hasProperty('SENTRY_DSN_DEBUG') ? "$SENTRY_DSN_DEBUG" : "$project.sentryDSNFallbackValue";
attributes 'Sentry-DSN': project.hasProperty('TABLEXIA_SENTRY_DSN_DEBUG') ? "$TABLEXIA_SENTRY_DSN_DEBUG" : "$project.sentryDSNFallbackValue";
attributes 'Sentry-DSN-Fallback': "$project.sentryDSNFallbackValue";
}
}
......@@ -48,7 +48,7 @@ task releaseJar(type: Jar) {
attributes 'Version-Name': tablexiaVersionName
attributes 'Assets-Cheksums': getMapConvertedToString(rootProject.ext.assetsChecksum)
attributes 'Sentry-DSN': project.hasProperty('SENTRY_DSN_RELEASE') ? "$SENTRY_DSN_RELEASE" : "$project.sentryDSNFallbackValue";
attributes 'Sentry-DSN': project.hasProperty('TABLEXIA_SENTRY_DSN_RELEASE') ? "$TABLEXIA_SENTRY_DSN_RELEASE" : "$project.sentryDSNFallbackValue";
attributes 'Sentry-DSN-Fallback': "$project.sentryDSNFallbackValue";
}
}
......
......@@ -24,6 +24,10 @@
<string>${app.build}</string>
<key>cz.nic.tablexia.BuildType</key>
<string>${app.buildtype}</string>
<key>cz.nic.tablexia.SentryDSN</key>
<string>${app.sentryDSN}</string>
<key>cz.nic.tablexia.SentryDSNFallback</key>
<string>${app.sentryDSNFallback}</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIViewControllerBasedStatusBarAppearance</key>
......
......@@ -30,7 +30,7 @@ def updateRoboVMProperties(String buildType, String applicationId, String iconNa
props.setProperty('app.buildtype', buildType)
props.setProperty('app.build', '' + tablexiaVersionCode)
props.setProperty('app.executable', tablexiaAppName + '-' + buildType + '-' + tablexiaVersionName)
props.setProperty('app.sentryDSNFallbackValue', sentryDSNFallbackValue)
props.setProperty('app.sentryDSNFallback', sentryDSNFallbackValue)
props.setProperty('app.sentryDSN', DSN)
props.store(propsFile.newDataOutputStream(), '')
......@@ -53,11 +53,11 @@ task copyNatives << {
}
}
copy {
from 'libs/'
into 'build/libs/ios'
include '*.a'
}
//copy {
// from 'libs/'
// into 'build/libs/ios'
// include '*.a'
//}
}
// Updates a robovm.xml file.
......@@ -104,7 +104,7 @@ tasks.create(name: "createDebugIPA", type: org.robovm.gradle.tasks.ArchiveTask)
doFirst {
robovm.iosSignIdentity = TABLEXIA_IOS_SIGNING_IDENTITY
robovm.iosProvisioningProfile = TABLEXIA_IOS_DEBUG_PROVISIONING
String DSN = project.hasProperty('SENTRY_DSN_DEBUG') ? "$SENTRY_DSN_DEBUG" : sentryDSNFallbackValue;
String DSN = project.hasProperty('TABLEXIA_SENTRY_DSN_DEBUG') ? "$TABLEXIA_SENTRY_DSN_DEBUG" : sentryDSNFallbackValue;
updateRoboVMProperties("debug", applicationIdDebug, 'Icon_debug', DSN)
}
}
......@@ -113,7 +113,7 @@ tasks.create(name: "createReleaseIPA", type: org.robovm.gradle.tasks.ArchiveTask
doFirst {
robovm.iosSignIdentity = TABLEXIA_IOS_SIGNING_IDENTITY
robovm.iosProvisioningProfile = TABLEXIA_IOS_RELEASE_PROVISIONING
String DSN = project.hasProperty('SENTRY_DSN_RELEASE') ? "$SENTRY_DSN_RELEASE" : sentryDSNFallbackValue;
String DSN = project.hasProperty('TABLEXIA_SENTRY_DSN_RELEASE') ? "$TABLEXIA_SENTRY_DSN_RELEASE" : sentryDSNFallbackValue;
updateRoboVMProperties("release", applicationIdRelease, 'Icon_release', DSN)
}
}
......
package cz.nic.tablexia;
import org.robovm.apple.foundation.NSObject;
import org.robovm.objc.annotation.Method;
import org.robovm.objc.annotation.NativeClass;
import org.robovm.apple.foundation.NSException;
@NativeClass
public class Flurry extends NSObject {
/**
* Starts session with apiKey
* [ObjC] + (void)startSession:(NSString *)apiKey;
*/
@Method(selector = "startSession:")
public static native void start(String apiKey);
//TODO + (void) startSession:(NSString *)apiKey withOptions:(id)options;
@Method(selector = "logError:message:exception:")
public static native void logError(String errorID, String message, NSException exception);
//+ (void)logError:(NSString *)errorID message:(NSString *)message exception:(NSException *)exception;
/**
* Sets session properties. Immutable map mapping values to keys...
*
* @note You should not pass private or confidential information about your origin info in a
* custom origin. A maximum of 20 parameter names may be associated with any origin. Sending
* over 20 parameter names with a single origin will result in no parameters being logged
* for that origin.
* [ObjC] + (void)sessionProperties:(NSDictionary *)parameters;
*/
//@Method(selector = "sessionProperties:")
//public static native void sessionProperties(NSDictionary parameters);
//TODO - Not Tested Yet! Add import blabla... NSDic
/**
* Enabled/Disables crash reporting feature
* [ObjC] + (void)setCrashReportingEnabled:(BOOL)value;
*/
@Method(selector = "setCrashReportingEnabled:")
public static native void setCrashReportingEnabled(boolean value);
/**
* Sets sessions continue time. Basicaly how long is session kept active
* after the app has been minimalized/hidden.
* [ObjC] + (void)setSessionContinueSeconds:(int)seconds;
*/
@Method(selector = "setSessionContinueSeconds:")
public static native void setSessionContinueSeconds(int seconds);
/**
* Set current version of application
* [ObjC] + (void)setAppVersion:(NSString *)version;
*/
@Method(selector = "setAppVersion:")
public static native void setAppVersion(String version);
/**
* Set current users ID for logging
* [ObjC] + (void)setUserID:(NSString *)userID;
*/
@Method(selector = "setUserID:")
public static native void setUserID(String userID);
/**
* Set currents users age
* [ObjC] + (void)setAge:(int)age;
*/
@Method(selector = "setAge:")
public static native void setUserAge(int age);
/**
* Set currents users gender
* [ObjC] + (void)setGender:(NSString *)gender;
*/
@Method(selector = "setGender:")
public static native void setUserGender(String gneder);
/**
* Return flurry agent version
* [ObjC] + (NSString *)getFlurryAgentVersion;
*/
@Method(selector = "getFlurryAgentVersion")
public static native String getFlurryAgentVersion();
/**
* Enables/Disables errors in log
* [ObjC] + (void)setShowErrorInLogEnabled:(BOOL)value;
*/
@Method(selector = "setShowErrorInLogEnabled:")
public static native void setShowErrorInLogEnabled(boolean value);
/**
* Enables/Disables debug log
* [ObjC] + (void)setDebugLogEnabled:(BOOL)value;
*/
@Method(selector = "setDebugLogEnabled:")
public static native void setDebugLogEnabled(boolean value);
/**
* Returns true if active session exists
* [ObjC] + (BOOL)activeSessionExists;
*/
@Method(selector = "activeSessionExists")
public static native boolean activeSessionExists();
/**
* Returns session id
* [ObjC] + (NSString*)getSessionID;
*/
@Method(selector = "getSessionID")
public static native String getSessionID();
/**
* Sets whether or not should session be enabled when app is in background
* [ObjC] + (void)setBackgroundSessionEnabled:(BOOL)setBackgroundSessionEnabled;
*/
@Method(selector = "setBackgroundSessionEnabled:")
public static native void setBackgroundSessionEnabled(boolean setBackgroundSessionEnabled);
}
\ No newline at end of file
......@@ -41,10 +41,10 @@ public class IOSLauncher extends IOSApplication.Delegate {
NSDictionary infoDictionary = NSBundle.getMainBundle().getInfoDictionary();
String buildType = infoDictionary.get(new NSString("cz.nic.tablexia.BuildType")).toString();
String sentryDSNFallback = infoDictionary.get(new NSString("app.sentryDSNFallbackValue")).toString();
String sentryDSN = infoDictionary.get(new NSString("app.sentryDSN")).toString();
String sentryDSNFallback = infoDictionary.get(new NSString("cz.nic.tablexia.SentryDSNFallback")).toString();
String sentryDSN = infoDictionary.get(new NSString("cz.nic.tablexia.SentryDSN")).toString();
String DSN = (sentryDSNFallback == null || sentryDSN == null || sentryDSN.equals(sentryDSNFallback)) ? null : sentryDSN;
tablexiaIOSFiles = new TablexiaIOSFiles();
IOSApplication iosApplication = new IOSApplication(new Tablexia(buildType,
Locale.getDefault(),
......@@ -65,17 +65,6 @@ public class IOSLauncher extends IOSApplication.Delegate {
@Override
public boolean didFinishLaunching(UIApplication application, UIApplicationLaunchOptions launchOptions) {
if(TablexiaSettings.getInstance().getBuildType().isAnalytics()) {
Flurry.start(TablexiaBuildConfig.FLURRY_KEY);
Flurry.setAppVersion(TablexiaBuildConfig.VERSION_NAME);
//Flurry.setShowErrorInLogEnabled(true);
//Flurry.setDebugLogEnabled(true);
if(TablexiaSettings.getInstance().getBuildType().isBugReport())
Flurry.setCrashReportingEnabled(true);
}
boolean result = super.didFinishLaunching(application, launchOptions);
Gdx.files = tablexiaIOSFiles;
return result;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment