Skip to content

Commit

Permalink
Merge pull request #229 from apptentive/branch_5.7.1
Browse files Browse the repository at this point in the history
Release 5.7.1
  • Loading branch information
twinklesharma1311 authored Aug 26, 2021
2 parents d4671f2 + 753f8cb commit 74d3028
Show file tree
Hide file tree
Showing 23 changed files with 51 additions and 237 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# 2021-08-26 - v5.7.1

#### Fixes

* Fix a couple of issues related to Android 12
* Fix Navigate to Link interaction for API 30+

# 2021-08-04 - v5.7.0

#### Improvements
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use your app, to talk to them at the right time, and in the right way.

##### [Release Notes](https://learn.apptentive.com/knowledge-base/android-sdk-release-notes/)

##### Binary releases are hosted for Maven [here](http://search.maven.org/#artifactdetails|com.apptentive|apptentive-android|5.7.0|aar)
##### Binary releases are hosted for Maven [here](http://search.maven.org/#artifactdetails|com.apptentive|apptentive-android|5.7.1|aar)

#### Reporting Bugs

Expand Down
9 changes: 9 additions & 0 deletions apptentive/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,13 @@
<receiver android:name=".module.engagement.notification.ApptentiveNotificationInteractionBroadcastReceiver"
android:exported="false"/>
</application>

<queries>
<!-- Browser -->
<intent>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
</intent>
</queries>
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
import com.apptentive.android.sdk.partners.apptimize.ApptentiveApptimizeTestInfo;
import com.apptentive.android.sdk.storage.*;
import com.apptentive.android.sdk.util.*;
import com.apptentive.android.sdk.util.AdvertiserManager.AdvertisingIdClientInfo;
import com.apptentive.android.sdk.util.threading.DispatchQueue;
import com.apptentive.android.sdk.util.threading.DispatchTask;

Expand Down Expand Up @@ -1101,7 +1100,6 @@ public void onReceiveNotification(ApptentiveNotification notification) {
}

checkSendVersionChanges(conversation);
updateConversationAdvertiserIdentifier(conversation);
}
} else if (notification.hasName(NOTIFICATION_CONVERSATION_WILL_LOGOUT)) {
Conversation conversation = notification.getRequiredUserInfo(NOTIFICATION_KEY_CONVERSATION, Conversation.class);
Expand All @@ -1115,17 +1113,6 @@ public void onReceiveNotification(ApptentiveNotification notification) {
storeManifestResponse(appContext, manifest);
} else if (notification.hasName(NOTIFICATION_APP_ENTERED_FOREGROUND)) {
onAppEnterForeground();

if (Configuration.load().isCollectingAdID()) {
// update advertiser id every time we come back from the background
if (AdvertiserManager.updateAdvertisingIdClientInfo(appContext)) {
// update active conversation's device info
Conversation conversation = getConversation();
if (conversation != null) {
updateConversationAdvertiserIdentifier(conversation);
}
}
}
} else if (notification.hasName(NOTIFICATION_APP_ENTERED_BACKGROUND)) {
onAppEnterBackground();
} else if (notification.hasName(NOTIFICATION_CONFIGURATION_FETCH_DID_FINISH)) {
Expand All @@ -1134,17 +1121,6 @@ public void onReceiveNotification(ApptentiveNotification notification) {
return;
}

if (configuration.isCollectingAdID()) {
// update advertiser id since the current customer needs it
if (AdvertiserManager.updateAdvertisingIdClientInfo(appContext)) {
// update active conversation's device info
Conversation conversation = getConversation();
if (conversation != null) {
updateConversationAdvertiserIdentifier(conversation);
}
}
}

if (configuration.isCollectingApptimizeData()) {
tryUpdateApptimizeData();
}
Expand Down Expand Up @@ -1175,26 +1151,6 @@ private void storeManifestResponse(Context context, String manifest) {

//endregion

//region Advertiser Identifier

private void updateConversationAdvertiserIdentifier(Conversation conversation) {
checkConversationQueue();

try {
Configuration config = Configuration.load();
if (config.isCollectingAdID()) {
AdvertisingIdClientInfo info = AdvertiserManager.getAdvertisingIdClientInfo();
String advertiserId = info != null && !info.isLimitAdTrackingEnabled() ? info.getId() : null;
conversation.getDevice().setAdvertiserId(advertiserId);
}
} catch (Exception e) {
ApptentiveLog.e(ADVERTISER_ID, e, "Exception while updating conversation advertiser id");
logException(e);
}
}

//endregion

//region Error Reporting

private static void logException(Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ public enum ApptentiveLogTag {
PUSH,
UTIL,
TROUBLESHOOT,
ADVERTISER_ID,
PARTNERS,
SECURITY,
IN_APP_REVIEW
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,5 +147,4 @@ public class ApptentiveNotifications {
public static final String NOTIFICATION_KEY_MANIFEST = "manifest";
public static final String NOTIFICATION_KEY_MESSAGE_STORE = "messageStore";
public static final String NOTIFICATION_KEY_INTERVAL = "interval";
public static final String NOTIFICATION_KEY_ADVERTISER_CLIENT_INFO = "clientInfo";
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
// TODO: get rid of JSONObject
public class Configuration extends JSONObject {
private static final String KEY_METRICS_ENABLED = "metrics_enabled";
private static final String KEY_COLLECT_AD_ID = "collect_ad_id";
private static final String KEY_APP_DISPLAY_NAME = "app_display_name";
private static final String KEY_MESSAGE_CENTER = "message_center";
private static final String KEY_MESSAGE_CENTER_FG_POLL = "fg_poll";
Expand Down Expand Up @@ -86,10 +85,6 @@ public boolean isMetricsEnabled() {
return getBoolean(KEY_METRICS_ENABLED, true);
}

public boolean isCollectingAdID() {
return getBoolean(KEY_COLLECT_AD_ID, false);
}

public String getAppDisplayName() {
try {
if (!isNull(KEY_APP_DISPLAY_NAME)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ public class DevicePayload extends JsonPayload {
private static final String KEY_LOCALE_LANGUAGE_CODE = "locale_language_code";
private static final String KEY_LOCALE_RAW = "locale_raw";
private static final String KEY_UTC_OFFSET = "utc_offset";
@SensitiveDataKey private static final String KEY_ADVERTISER_ID = "advertiser_id";
private static final String KEY_INTEGRATION_CONFIG = "integration_config";

static {
Expand Down Expand Up @@ -184,10 +183,6 @@ public void setUtcOffset(String utcOffset) {
put(KEY_UTC_OFFSET, utcOffset);
}

public void setAdvertiserId(String advertiserId) {
put(KEY_ADVERTISER_ID, advertiserId);
}

@Override
protected String getJsonContainer() {
return "device";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ private Object doGetValue(String query) {
case other:
return null;
}
break;
}
case device: {
QueryPart subQuery = QueryPart.parse(tokens[1]);
Expand Down Expand Up @@ -288,6 +289,7 @@ private Object doGetValue(String query) {
case other:
return null;
}
break;
}
case random: {
if (tokens.length == 3) { // random/<key>/percent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ public class Device implements Saveable, DataChangedListener {
private String localeLanguageCode;
private String localeRaw;
private String utcOffset;
private String advertiserId;
private IntegrationConfig integrationConfig;

private transient DataChangedListener listener;
Expand Down Expand Up @@ -102,7 +101,6 @@ public Device clone() {
clone.localeLanguageCode = localeLanguageCode;
clone.localeRaw = localeRaw;
clone.utcOffset = utcOffset;
clone.advertiserId = advertiserId;
if (integrationConfig != null) {
clone.integrationConfig = integrationConfig.clone();
}
Expand Down Expand Up @@ -376,17 +374,6 @@ public void setUtcOffset(String utcOffset) {
}
}

public String getAdvertiserId() {
return advertiserId;
}

public void setAdvertiserId(String advertiserId) {
if (!StringUtils.equal(this.advertiserId, advertiserId)) {
this.advertiserId = advertiserId;
notifyDataChanged();
}
}

public IntegrationConfig getIntegrationConfig() {
return integrationConfig;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
import androidx.core.content.ContextCompat;

import com.apptentive.android.sdk.ApptentiveLog;
import com.apptentive.android.sdk.model.Configuration;
import com.apptentive.android.sdk.util.AdvertiserManager;
import com.apptentive.android.sdk.util.Constants;
import com.apptentive.android.sdk.util.StringUtils;

Expand Down Expand Up @@ -55,22 +53,6 @@ public Device generateNewDevice(Context context) {
device.setBuildType(Build.TYPE);
device.setBuildId(Build.ID);

// advertiser id
try {
Configuration configuration = Configuration.load();
if (configuration.isCollectingAdID()) {
AdvertiserManager.AdvertisingIdClientInfo info = AdvertiserManager.getAdvertisingIdClientInfo();
if (info != null && !info.isLimitAdTrackingEnabled()) {
device.setAdvertiserId(info.getId());
} else {
ApptentiveLog.w("Advertising ID tracking is not available or limited");
}
}
} catch (Exception e) {
ApptentiveLog.e(e, "Exception while collecting advertising ID");
logException(e);
}

// Second, set the stuff that requires querying system services.
try {
setupTelephony(context, device);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,6 @@ public static DevicePayload getDiffPayload(Device oldDevice, Device newDevice) {
changed = true;
}

if (oldDevice == null || !equal(oldDevice.getAdvertiserId(), newDevice.getAdvertiserId())) {
ret.setAdvertiserId(newDevice.getAdvertiserId());
changed = true;
}

if (oldDevice == null || !equal(oldDevice.getIntegrationConfig(), newDevice.getIntegrationConfig())) {
IntegrationConfig integrationConfig = newDevice.getIntegrationConfig();
ret.setIntegrationConfig(integrationConfig != null ? integrationConfig.toJson() : null);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
public class Constants {

public static final int API_VERSION = 10;
private static final String APPTENTIVE_SDK_VERSION = "5.7.0";
private static final String APPTENTIVE_SDK_VERSION = "5.7.1";

public static final int DEFAULT_CONNECT_TIMEOUT_MILLIS = 45000;
public static final int DEFAULT_READ_TIMEOUT_MILLIS = 45000;
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.2'
classpath 'com.android.tools.build:gradle:4.2.2'
classpath 'com.github.3mph4515:gradle-hockeyapp-plugin:3.7.6'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
Expand Down
Loading

0 comments on commit 74d3028

Please sign in to comment.