Skip to content

Commit ac34e51

Browse files
Merge pull request #35 from BranchMetrics/SDK-2312
[SDK-2312] Updated Branch Android SDK version and AEP SDK's
2 parents ed5b585 + 42dc21b commit ac34e51

File tree

8 files changed

+43
-31
lines changed

8 files changed

+43
-31
lines changed

AdobeBranchExample/build.gradle

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ android {
2020
sourceCompatibility JavaVersion.VERSION_1_8
2121
targetCompatibility JavaVersion.VERSION_1_8
2222
}
23+
packagingOptions {
24+
exclude 'META-INF/com.android.tools/proguard/coroutines.pro'
25+
}
2326
}
2427

2528
dependencies {
@@ -35,10 +38,10 @@ dependencies {
3538
api project(path: ':AdobeBranchExtension')
3639

3740
// Adobe
38-
implementation 'com.adobe.marketing.mobile:analytics:2.0.2'
39-
implementation 'com.adobe.marketing.mobile:userprofile:2.0.0'
40-
implementation 'com.adobe.marketing.mobile:core:2.2.0'
41-
implementation 'com.adobe.marketing.mobile:lifecycle:2.0.2'
42-
implementation 'com.adobe.marketing.mobile:identity:2.0.2'
41+
implementation 'com.adobe.marketing.mobile:analytics:2.0.3'
42+
implementation 'com.adobe.marketing.mobile:userprofile:2.0.1'
43+
implementation 'com.adobe.marketing.mobile:core:2.6.2'
44+
implementation 'com.adobe.marketing.mobile:lifecycle:2.0.4'
45+
implementation 'com.adobe.marketing.mobile:identity:2.0.3'
4346
implementation 'com.adobe.marketing.mobile:signal:2.0.1'
4447
}

AdobeBranchExample/src/main/AndroidManifest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
android:theme="@style/AppTheme">
1616
<activity
1717
android:name=".ProductActivity"
18-
android:label="@string/app_name"
1918
android:launchMode="singleTask"
20-
android:theme="@style/AppTheme.NoActionBar">
19+
android:theme="@style/AppTheme.NoActionBar"
20+
android:exported="true">
2121
<intent-filter>
2222
<action android:name="android.intent.action.MAIN" />
2323

AdobeBranchExample/src/main/java/io/branch/adobe/demo/DemoApplication.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package io.branch.adobe.demo;
22

33
import android.app.Application;
4+
import android.util.Log;
45

56
import com.adobe.marketing.mobile.Analytics;
67
import com.adobe.marketing.mobile.Extension;
@@ -20,24 +21,26 @@
2021

2122
public class DemoApplication extends Application {
2223
private static final String ADOBE_APP_ID = "d10f76259195/b0503e1a5dce/launch-9948a3b3a89d-development";
24+
private static final String TAG = "AdobeBranchExample::";
2325

2426
@Override
2527
public void onCreate() {
2628
super.onCreate();
2729

2830
Branch.enableLogging();
2931

32+
3033
// Initialize
3134
initAdobeBranch();
3235
Analytics.setVisitorIdentifier("custom_identifier_1234"); // to test custom visitor ID (key: "vid")
3336
}
3437

3538
private void initAdobeBranch() {
36-
PrefHelper.Debug("initAdobeBranch()");
39+
Log.d(TAG, "initAdobeBranch()");
3740

3841
MobileCore.setApplication(this);
3942
MobileCore.configureWithAppID(ADOBE_APP_ID);
40-
MobileCore.setLogLevel(LoggingMode.ERROR);
43+
MobileCore.setLogLevel(LoggingMode.VERBOSE);
4144

4245
// NOTE! following code will enable you to configure exclusion list or allow list, but you can't define both!
4346
// If you don't configure any, all events will send to Branch which is not ideal!
@@ -55,7 +58,7 @@ private void initAdobeBranch() {
5558
extensions.add(Signal.EXTENSION);
5659
extensions.add(AdobeBranchExtension.EXTENSION);
5760
MobileCore.registerExtensions(extensions, o -> {
58-
PrefHelper.Debug("AEP Mobile SDK is initialized");
61+
Log.d(TAG, "AEP Mobile SDK is initialized");
5962
});
6063

6164
}

AdobeBranchExample/src/main/java/io/branch/adobe/demo/ProductActivity.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import android.content.Intent;
44
import android.os.Bundle;
55
import android.text.TextUtils;
6+
import android.util.Log;
67
import android.view.View;
78
import android.widget.AdapterView;
89
import android.widget.ListAdapter;
@@ -30,6 +31,7 @@
3031

3132
public class ProductActivity extends AppCompatActivity {
3233
private List<SwagModel> swagModelList;
34+
private static final String TAG = "AdobeBranchExample::";
3335

3436
@Override
3537
protected void onCreate(Bundle savedInstanceState) {
@@ -80,14 +82,14 @@ public void onItemClick(AdapterView<?> parent, View view, int position, long id)
8082
ListAdapter customAdapter = new SwagAdapter(this, R.layout.swag_item, swagModelList);
8183
listView.setAdapter(customAdapter);
8284
} catch (JSONException e) {
83-
PrefHelper.Debug("Error initializing List: " + e.getLocalizedMessage());
85+
Log.d(TAG, "Error initializing List: " + e.getLocalizedMessage());
8486
}
8587
}
8688

8789
private Branch.BranchReferralInitListener branchInitSessionCallback = new Branch.BranchReferralInitListener() {
8890
@Override
8991
public void onInitFinished(JSONObject referringParams, BranchError error) {
90-
PrefHelper.Debug("initBranchSession, referringParams = " + referringParams + ", error = " + error);
92+
Log.d(TAG, "initBranchSession, referringParams = " + referringParams + ", error = " + error);
9193
if (referringParams == null) return;
9294
try {
9395
// You would think that there was an easier way to figure this out than looking at LinkProperties code

AdobeBranchExtension/build.gradle

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,18 @@ dependencies {
3636
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
3737

3838
// Branch
39-
api 'io.branch.sdk.android:library:5.4.0'
39+
api 'io.branch.sdk.android:library:5.11.0'
4040
implementation ('com.google.android.gms:play-services-ads-identifier:17.0.0')
4141
// for Huawei devices without GMS, adding it requires bumping up min api level to 19 though, so we
4242
// leave it up to the client to add it following Branch documentation here: https://help.branch.io/developers-hub/docs/android-basic-integration
4343
//implementation 'com.huawei.hms:ads-identifier:3.4.28.305'
4444

4545
// Adobe
46-
androidTestImplementation 'com.adobe.marketing.mobile:analytics:2.0.2'
47-
androidTestImplementation 'com.adobe.marketing.mobile:userprofile:2.0.0'
48-
implementation 'com.adobe.marketing.mobile:core:2.2.0'
49-
implementation 'com.adobe.marketing.mobile:lifecycle:2.0.2'
50-
implementation 'com.adobe.marketing.mobile:identity:2.0.2'
46+
androidTestImplementation 'com.adobe.marketing.mobile:analytics:2.0.3'
47+
androidTestImplementation 'com.adobe.marketing.mobile:userprofile:2.0.1'
48+
implementation 'com.adobe.marketing.mobile:core:2.6.2'
49+
implementation 'com.adobe.marketing.mobile:lifecycle:2.0.4'
50+
implementation 'com.adobe.marketing.mobile:identity:2.0.3'
5151
implementation 'com.adobe.marketing.mobile:signal:2.0.1'
5252

5353
androidTestImplementation project(path: ':AdobeBranchExtension')

AdobeBranchExtension/src/main/java/io/branch/adobe/extension/AdobeBranchExtension.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
import java.util.concurrent.atomic.AtomicBoolean;
1818

1919
import io.branch.referral.Branch;
20+
import io.branch.referral.BranchLogger;
2021
import io.branch.referral.BranchPluginSupport;
21-
import io.branch.referral.PrefHelper;
2222
import io.branch.referral.util.BRANCH_STANDARD_EVENT;
2323
import io.branch.referral.util.BranchEvent;
2424
import io.branch.referral.util.CurrencyType;
@@ -73,7 +73,7 @@ protected void onRegistered() {
7373
AdobeBranch.getAutoInstance( MobileCore.getApplication().getApplicationContext());
7474
registerListeners();
7575

76-
PrefHelper.Debug("AdobeBranchExtension was successfully registered.");
76+
BranchLogger.d(TAG + "AdobeBranchExtension was successfully registered.");
7777
}
7878

7979
private void registerListeners() {
@@ -99,12 +99,12 @@ public boolean readyForEvent(Event event) {
9999
}
100100

101101
void handleAdobeEvent(final Event event) {
102-
PrefHelper.Debug(TAG + String.format("Started processing new event [%s] of type [%s] and source [%s]",
102+
BranchLogger.d(TAG + String.format("Started processing new event [%s] of type [%s] and source [%s]",
103103
branchEventNameFromAdobeEvent(event), event.getType(), event.getSource()));
104104

105105
if (Branch.getInstance() == null) {
106106
// Branch is not initialized.
107-
PrefHelper.Debug("Branch is not initialized yet. Can not handle Adobe event.");
107+
BranchLogger.d(TAG + "Branch is not initialized yet. Can not handle Adobe event.");
108108
return;
109109
}
110110

@@ -115,7 +115,7 @@ void handleAdobeEvent(final Event event) {
115115
} else if (isTrackedEvent(event)) {
116116
handleEvent(event);
117117
} else {
118-
PrefHelper.Debug(TAG + "Event Dropped: " + branchEventNameFromAdobeEvent(event));
118+
BranchLogger.d(TAG + "Event Dropped: " + branchEventNameFromAdobeEvent(event));
119119
}
120120
}
121121

@@ -151,7 +151,7 @@ private boolean isSharedStateEvent(final Event event) {
151151
private void handleBranchConfigurationEvent(final Event event) {
152152
Map<String, Object> eventData = event.getEventData();
153153
if (eventData != null) {
154-
PrefHelper.Debug("Configuring AdobeBranch");
154+
BranchLogger.d(TAG + "Configuring AdobeBranch");
155155

156156
Object object = eventData.get(AdobeBranch.KEY_APICONFIGURATION);
157157

@@ -167,7 +167,7 @@ private void handleBranchConfigurationEvent(final Event event) {
167167

168168
} catch (Exception e) {
169169
// Internal Error.
170-
PrefHelper.LogAlways(TAG + "handleBranchConfigurationEvent Exception" + e.getMessage());
170+
BranchLogger.w(TAG + "Error while configuring AdobeBranch" + e.getMessage());
171171
}
172172
} else if (object == null) {
173173
apiWhitelist = null;
@@ -198,7 +198,7 @@ private void handleSharedStateEvent(final Event event) {
198198

199199
if (extensionSharedState != null) {
200200
for (Map.Entry<String, Object> entry : extensionSharedState.getValue().entrySet()) {
201-
PrefHelper.Debug(String.format("identity extension shared state = %s", extensionSharedState.toString()));
201+
BranchLogger.d(String.format("identity extension shared state = %s", extensionSharedState));
202202

203203
Object value = entry.getValue();
204204
if (value == null) continue;
@@ -244,13 +244,13 @@ private void handleEvent(final Event event) {
244244
BranchEvent branchEvent = branchEventFromAdobeEvent(event);
245245
if (branchEvent != null) {
246246
try {
247-
PrefHelper.Debug(TAG + "Track BranchEvent: " + branchEvent.getEventName());
247+
BranchLogger.d(TAG + "Track BranchEvent: " + branchEvent.getEventName());
248248

249249
branchEvent.logEvent(MobileCore.getApplication().getApplicationContext());
250250

251251
deviceDataSharedState(event);
252252
} catch (Exception e) {
253-
PrefHelper.LogAlways(TAG + "handleTrackEvent Exception" + e.getMessage());
253+
BranchLogger.w(TAG + "handleTrackEvent Exception" + e.getMessage());
254254
}
255255
}
256256
}

ChangeLog.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
# Adobe Branch SDK Extension change log
22

3+
- v2.1.0
4+
* April 1, 2024
5+
* Update Branch Android SDK to 5.11.0
6+
* Updated AEP SDKs
7+
38
- v2.0.0
49
* June 20, 2023
510
* Update Branch Android SDK to 5.4.2
611
* Updated from ACPCore to AEPCore
712

8-
913
- v1.4.0
1014
* January 12, 2023
1115
* Update Branch Android SDK to 5.2.7

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ org.gradle.jvmargs=-Xmx1536m
1111
# This option should only be used with decoupled projects. More details, visit
1212
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
1313
# org.gradle.parallel=true
14-
VERSION_NAME=2.0.0
15-
VERSION_CODE=200000
14+
VERSION_NAME=2.1.0
15+
VERSION_CODE=200100
1616
GROUP=io.branch.sdk.android
1717

1818
POM_NAME=Branch Adobe Android SDK

0 commit comments

Comments
 (0)