Skip to content

Commit

Permalink
Prepare for release 13.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
chshapiro committed Jul 27, 2022
1 parent 2524008 commit 7634500
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 99 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 13.0.0

##### Breaking
- Updated to [Braze Android SDK 22.0.0](https://github.com/Appboy/appboy-android-sdk/blob/master/CHANGELOG.md#2200).
- Updated to analytics-android 4.10.1.

## 12.0.0

##### Breaking
Expand Down
4 changes: 2 additions & 2 deletions appboy-segment-integration/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ dependencies {
google()
}

compileOnly 'com.segment.analytics.android:analytics:4.3.1'
compileOnly 'com.segment.analytics.android:analytics:4.10.1'

api 'com.appboy:android-sdk-ui:21.0.0+'
api 'com.appboy:android-sdk-ui:22.0.0+'

testImplementation 'junit:junit:4.12'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import androidx.test.core.app.ApplicationProvider;
import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner;

import com.appboy.Appboy;
import com.braze.Braze;
import com.braze.configuration.BrazeConfig;
import com.segment.analytics.Analytics;
Expand All @@ -18,7 +17,7 @@
import static org.junit.Assert.assertEquals;

@RunWith(AndroidJUnit4ClassRunner.class)
public class AppboyAndroidTest {
public class BrazeAndroidTest {

@BeforeClass
public static void beforeClass() {
Expand All @@ -34,9 +33,9 @@ public void testIdentifyCallsChangeUser() {
.userId(testUserId)
.traits(createTraits(testUserId))
.build();
AppboyIntegration integration = new AppboyIntegration(Appboy.getInstance(ApplicationProvider.getApplicationContext()), "token", Logger.with(Analytics.LogLevel.DEBUG), true);
AppboyIntegration integration = new AppboyIntegration(Braze.getInstance(ApplicationProvider.getApplicationContext()), "token", Logger.with(Analytics.LogLevel.DEBUG), true);

integration.identify(identifyPayload);
assertEquals(testUserId, Appboy.getInstance(ApplicationProvider.getApplicationContext()).getCurrentUser().getUserId());
assertEquals(testUserId, Braze.getInstance(ApplicationProvider.getApplicationContext()).getCurrentUser().getUserId());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@
import androidx.annotation.RestrictTo;
import androidx.annotation.VisibleForTesting;

import com.appboy.Appboy;
import com.appboy.IAppboy;
import com.appboy.enums.Gender;
import com.appboy.enums.Month;
import com.appboy.enums.SdkFlavor;
import com.braze.models.outgoing.BrazeProperties;
import com.appboy.models.outgoing.AttributionData;
import com.braze.models.outgoing.BrazeProperties;
import com.braze.Braze;
import com.braze.IBraze;
import com.braze.enums.BrazeSdkMetadata;
import com.braze.support.StringUtils;
import com.braze.BrazeUser;
Expand Down Expand Up @@ -43,8 +42,8 @@
import java.util.Locale;
import java.util.Set;

public class AppboyIntegration extends Integration<Appboy> {
private static final String APPBOY_KEY = "Appboy";
public class AppboyIntegration extends Integration<Braze> {
private static final String BRAZE_KEY = "Appboy";
private static final Set<String> MALE_TOKENS = new HashSet<>(Arrays.asList("M",
"MALE"));
private static final Set<String> FEMALE_TOKENS = new HashSet<>(Arrays.asList("F",
Expand All @@ -62,7 +61,7 @@ public class AppboyIntegration extends Integration<Appboy> {
public static final Factory FACTORY = new Factory() {
@Override
public Integration<?> create(ValueMap settings, Analytics analytics) {
Logger logger = analytics.logger(APPBOY_KEY);
Logger logger = analytics.logger(BRAZE_KEY);
String apiKey = settings.getString(API_KEY_KEY);
SdkFlavor flavor = SdkFlavor.SEGMENT;
boolean inAppMessageRegistrationEnabled =
Expand All @@ -82,15 +81,15 @@ public Integration<?> create(ValueMap settings, Analytics analytics) {
}

final Context applicationContext = analytics.getApplication().getApplicationContext();
Appboy.configure(applicationContext, builder.build());
Braze.configure(applicationContext, builder.build());
Braze.getInstance(applicationContext);
logger.verbose("Configured Braze+Segment integration and initialized Appboy.");
logger.verbose("Configured Braze+Segment integration and initialized Braze.");
return new AppboyIntegration(applicationContext, apiKey, logger, inAppMessageRegistrationEnabled);
}

@Override
public String key() {
return APPBOY_KEY;
return BRAZE_KEY;
}
};

Expand All @@ -99,7 +98,7 @@ public String key() {
private final boolean mAutomaticInAppMessageRegistrationEnabled;
private final Context mContext;
// Only used for testing
private final IAppboy mBraze;
private final IBraze mBraze;

public AppboyIntegration(Context context,
String token,
Expand All @@ -113,12 +112,12 @@ public AppboyIntegration(Context context,
}

@RestrictTo(RestrictTo.Scope.TESTS)
public AppboyIntegration(IAppboy appboy,
public AppboyIntegration(IBraze braze,
String token,
Logger logger,
boolean automaticInAppMessageRegistrationEnabled) {
mContext = null;
mBraze = appboy;
mBraze = braze;
mToken = token;
mLogger = logger;
mAutomaticInAppMessageRegistrationEnabled = automaticInAppMessageRegistrationEnabled;
Expand All @@ -129,15 +128,15 @@ public String getToken() {
}

@Override
public Appboy getUnderlyingInstance() {
public Braze getUnderlyingInstance() {
if (mContext != null) {
return (Appboy) Braze.getInstance(mContext);
return (Braze) Braze.getInstance(mContext);
} else {
return (Appboy) mBraze;
return (Braze) mBraze;
}
}

public IAppboy getInternalInstance() {
public IBraze getInternalInstance() {
if (mContext != null) {
return Braze.getInstance(mContext);
} else {
Expand All @@ -158,7 +157,7 @@ public void identify(IdentifyPayload identify) {

BrazeUser currentUser = getInternalInstance().getCurrentUser();
if (currentUser == null) {
mLogger.info("Appboy.getCurrentUser() was null, aborting identify");
mLogger.info("Braze.getCurrentUser() was null, aborting identify");
return;
}

Expand Down
Loading

0 comments on commit 7634500

Please sign in to comment.