public static String getUserAgentString() { return String.format(USER_AGENT_STRING, Constants.getApptentiveSdkVersion()); }
device.setCarrier(tm.getSimOperatorName()); device.setCurrentCarrier(tm.getNetworkOperatorName()); device.setNetworkType(Constants.networkTypeAsString(tm.getNetworkType()));
public ApptentiveHttpClient(String apptentiveKey, String apptentiveSignature, String serverURL) { if (StringUtils.isNullOrEmpty(apptentiveKey)) { throw new IllegalArgumentException("Illegal Apptentive Key: '" + apptentiveKey + "'"); } if (StringUtils.isNullOrEmpty(apptentiveSignature)) { throw new IllegalArgumentException("Illegal Apptentive Signature: '" + apptentiveSignature + "'"); } if (StringUtils.isNullOrEmpty(serverURL)) { throw new IllegalArgumentException("Illegal server URL: '" + serverURL + "'"); } this.apptentiveKey = apptentiveKey; this.apptentiveSignature = apptentiveSignature; this.serverURL = serverURL; this.userAgentString = String.format(USER_AGENT_STRING, Constants.getApptentiveSdkVersion()); }
"App Version Name", versionName, "App Version Code", versionCode, "Apptentive SDK", com.apptentive.android.sdk.util.Constants.getApptentiveSdkVersion(), "Device Model", Build.MODEL, "Android OS Version", Build.VERSION.RELEASE,
public static Sdk generateCurrentSdk(Context context) { Sdk sdk = new Sdk(); // First, get all the information we can load from static resources. sdk.setVersion(Constants.getApptentiveSdkVersion()); sdk.setPlatform("Android"); // Distribution and distribution version are optionally set in the manifest by the wrapping platform (Cordova, mParticle, etc.) Resources resources = context.getResources(); sdk.setDistribution(resources.getString(R.string.apptentive_distribution)); sdk.setDistributionVersion(resources.getString(R.string.apptentive_distribution_version)); ApptentiveLog.v("SDK: %s:%s", sdk.getDistribution(), sdk.getDistributionVersion()); return sdk; }
private static HttpRequest createTokenVerificationRequest(String apptentiveAppKey, String apptentiveAppSignature, String token, HttpRequest.Listener<HttpJsonRequest> listener) { // TODO: move this logic to ApptentiveHttpClient String URL = Constants.CONFIG_DEFAULT_SERVER_URL + "/debug_token/verify"; HttpRequest request = new HttpJsonRequest(URL, createVerityRequestObject(token)); request.setTag(TAG_VERIFICATION_REQUEST); request.setMethod(HttpRequestMethod.POST); request.setRequestManager(HttpRequestManager.sharedManager()); request.setRequestProperty("X-API-Version", Constants.API_VERSION); request.setRequestProperty("APPTENTIVE-KEY", apptentiveAppKey); request.setRequestProperty("APPTENTIVE-SIGNATURE", apptentiveAppSignature); request.setRequestProperty("Content-Type", "application/json"); request.setRequestProperty("Accept", "application/json"); request.setRequestProperty("User-Agent", String.format(USER_AGENT_STRING, Constants.getApptentiveSdkVersion())); request.setRetryPolicy(createVerityRequestRetryPolicy()); request.addListener(listener); return request; }
if (sApptentiveInternal == null) { try { ApptentiveLog.i("Registering Apptentive Android SDK %s", Constants.getApptentiveSdkVersion()); ApptentiveLog.v("ApptentiveKey=%s ApptentiveSignature=%s", apptentiveKey, apptentiveSignature); sApptentiveInternal = new ApptentiveInternal(application, apptentiveKey, apptentiveSignature, baseURL, shouldEncryptStorage);
case version: Apptentive.Version ret = new Apptentive.Version(); ret.setVersion(Constants.getApptentiveSdkVersion()); return ret;
final String currentSdkVersion = Constants.getApptentiveSdkVersion(); if (!StringUtils.equal(lastSeenSdkVersion, currentSdkVersion)) { sdkChanged = true;