Skip to content

Commit 7cbd16b

Browse files
committed
release: SDK 2.0.0
1 parent a5468fb commit 7cbd16b

File tree

200 files changed

+28894
-7803
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

200 files changed

+28894
-7803
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ The Batch Android SDK allows you to build meaningful communication experience in
77
Our [📕 setup documentation](https://doc.batch.com/ios/prerequisites) details the steps to take for an easy and successful integration.
88

99
# Prerequisites
10-
The Batch Android SDK requires Android Studio 4 and Android API 15.
10+
The Batch Android SDK requires Android 5.0 (Lollipop / API Level 21).
1111

1212
# Documentation
1313
- [Setup guide](https://doc.batch.com/android/prerequisites): start your implementation here!
Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
object ProjectConsts {
22
const val COMPILE_SDK = 34
33

4-
const val KOTLIN_VERSION = "1.7.21"
5-
const val KOTLIN_COROUTINES_VERSION = "1.6.4"
4+
const val KOTLIN_VERSION = "1.9.0"
5+
const val KOTLIN_COROUTINES_VERSION = "1.7.1"
66

77
const val ANDROID_LINT_VERSION = "30.1.2"
88

9-
const val ANDROID_GRADLE_PLUGIN_VERSION = "8.0.2"
9+
const val ANDROID_GRADLE_PLUGIN_VERSION = "8.3.0"
1010
const val GMS_GRADLE_PLUGIN_VERSION = "4.3.14"
1111
}
1212

1313
object SDKConsts {
14-
const val VERSION = "1.21.1"
15-
const val API_LEVEL = 70
14+
const val VERSION = "2.0.0"
15+
const val API_LEVEL = 200
1616
const val MESSAGING_API_LEVEL = 12
1717

18-
const val MIN_SDK = 15
19-
const val TARGET_SDK = 34
18+
const val MIN_SDK = 21
2019
const val R_PREFIX = "com_batchsdk_"
2120
const val NAMESPACE = "com.batch.android"
2221
const val TEST_NAMESPACE = "com.batch.android.test"
@@ -28,14 +27,6 @@ object SDKConsts {
2827
// usually wants lower versions for compatibility.
2928
object DependenciesVersions {
3029
const val ANDROIDX = "1.0.0"
31-
const val PLAY_SERVICES = "11.8.0"
32-
}
33-
}
34-
35-
object SampleConsts {
36-
object DependenciesVersions {
37-
const val ANDROIDX = "1.1.0"
38-
const val PLAY_SERVICES = "16.0.0"
3930
}
4031
}
4132

Sources/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ org.gradle.jvmargs=-Xmx4096m -Dfile.encoding=UTF-8
1717
org.gradle.caching=true
1818
org.gradle.configureondemand=false
1919
android.useAndroidX=true
20-
android.enableJetifier=true
20+
android.enableJetifier=false
2121
gnsp.disableApplyOnlyOnRootProjectEnforcement=true
2222
kotlin.stdlib.default.dependency=false
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Wed Jul 12 10:10:59 CEST 2023
1+
#Tue Apr 16 15:13:35 CEST 2024
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists

Sources/sdk-stubs/build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ android {
99

1010
defaultConfig {
1111
minSdk = SDKConsts.MIN_SDK
12-
targetSdk = SDKConsts.TARGET_SDK
1312
}
1413

1514
buildTypes {

Sources/sdk/build.gradle.kts

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import org.gradle.api.tasks.testing.logging.TestLogEvent
2-
import org.jetbrains.kotlin.gradle.plugin.mpp.pm20.util.archivesName
32

43
plugins {
54
id("com.android.library")
65
id("org.jetbrains.kotlin.android")
76
}
87

9-
// Required for Groovy compatiblity, which cannot use Consts.kt
8+
// Required for Groovy compatibility, which cannot use Consts.kt
109
ext {
1110
set("mavenGroupId", SDKConsts.MAVEN_GROUP_ID)
1211
set("mavenArtifact", SDKConsts.MAVEN_ARTIFACT)
@@ -26,7 +25,6 @@ android {
2625

2726
defaultConfig {
2827
minSdk = SDKConsts.MIN_SDK
29-
targetSdk = SDKConsts.TARGET_SDK
3028

3129
buildConfigField("String", "SDK_VERSION", "\"${SDKConsts.VERSION}\"")
3230
buildConfigField("Integer", "API_LEVEL", "${SDKConsts.API_LEVEL}")
@@ -71,7 +69,6 @@ android {
7169
}
7270

7371
testOptions {
74-
execution = "ANDROIDX_TEST_ORCHESTRATOR"
7572
unitTests {
7673
isReturnDefaultValues = true
7774
isIncludeAndroidResources = true
@@ -116,42 +113,34 @@ tasks.register("printVersion") {
116113
}
117114

118115
dependencies {
116+
119117
val androidXLibraryVersion = SDKConsts.DependenciesVersions.ANDROIDX
120-
val playServicesVersion = SDKConsts.DependenciesVersions.PLAY_SERVICES
121-
val kotlinVersion = ProjectConsts.KOTLIN_VERSION
122118
val kotlinCoroutinesVersion = ProjectConsts.KOTLIN_COROUTINES_VERSION
123119

124-
compileOnly("com.google.android.gms:play-services-gcm:${playServicesVersion}")
125-
compileOnly("com.google.android.gms:play-services-location:${playServicesVersion}")
126-
compileOnly("com.google.android.gms:play-services-nearby:${playServicesVersion}")
127-
compileOnly("com.google.android.play:review:2.0.1")
128-
compileOnly("com.google.firebase:firebase-iid:21.1.0")
129-
compileOnly("com.google.firebase:firebase-messaging:22.0.0")
120+
api("androidx.core:core:${androidXLibraryVersion}")
121+
130122
compileOnly(project(":sdk-stubs"))
131123
compileOnly(project(":sdk-processor"))
132124
annotationProcessor(project(":sdk-processor"))
133125
lintChecks(project(":sdk-lint"))
134126

135-
api("androidx.core:core:${androidXLibraryVersion}")
136-
compileOnly("androidx.appcompat:appcompat:${androidXLibraryVersion}")
127+
compileOnly("com.google.android.play:review:2.0.1")
128+
compileOnly("com.google.firebase:firebase-messaging:22.0.0")
137129
compileOnly("com.google.android.material:material:${androidXLibraryVersion}")
130+
compileOnly("androidx.appcompat:appcompat:${androidXLibraryVersion}")
138131
compileOnly("androidx.dynamicanimation:dynamicanimation:$androidXLibraryVersion")
139132

140133
androidTestImplementation("junit:junit:4.13.2")
141-
androidTestImplementation("androidx.annotation:annotation:${androidXLibraryVersion}")
142134
androidTestImplementation("androidx.test:core-ktx:1.5.0")
143135
androidTestImplementation("androidx.test:rules:1.5.0")
144136
androidTestImplementation("androidx.test:runner:1.5.2")
145137
androidTestImplementation("androidx.test.ext:junit:1.1.5")
146138
androidTestImplementation("androidx.test.espresso:espresso-intents:3.5.1")
147139
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
148140
androidTestImplementation("androidx.test.ext:truth:1.5.0")
149-
150-
androidTestImplementation("com.google.android.gms:play-services-gcm:${playServicesVersion}")
151-
androidTestImplementation("com.google.android.gms:play-services-location:${playServicesVersion}")
152-
androidTestImplementation("com.google.android.gms:play-services-nearby:${playServicesVersion}")
153141
androidTestImplementation("com.google.firebase:firebase-core:17.4.3")
154142
androidTestImplementation("androidx.appcompat:appcompat:${androidXLibraryVersion}")
143+
androidTestImplementation("androidx.annotation:annotation:${androidXLibraryVersion}")
155144

156145
testImplementation("junit:junit:4.13.2")
157146
testImplementation("org.mockito:mockito-core:5.4.0")
@@ -162,9 +151,6 @@ dependencies {
162151
testImplementation("androidx.test.espresso:espresso-intents:3.5.1")
163152
testImplementation("androidx.test.espresso:espresso-core:3.5.1")
164153
testImplementation("androidx.test.ext:truth:1.5.0")
165-
testImplementation("com.google.android.gms:play-services-gcm:${playServicesVersion}")
166-
testImplementation("com.google.android.gms:play-services-location:${playServicesVersion}")
167-
testImplementation("com.google.android.gms:play-services-nearby:${playServicesVersion}")
168154
testImplementation("androidx.appcompat:appcompat:${androidXLibraryVersion}")
169155

170156
testImplementation("org.robolectric:robolectric:4.9.2")

Sources/sdk/jacoco.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ task testDebugCoverageUnitTest(dependsOn: ['instrument', 'testDebugUnitTest']) {
4141
structure(name: 'TestCoverage') {
4242
classfiles {
4343
fileset(
44-
dir: "$buildDir/intermediates/javac/debug/classes",
44+
dir: "$buildDir/intermediates/javac/debug/compileDebugJavaWithJavac/classes",
4545
excludes: '**/R.class,**/R$*.class,**/BuildConfig.*'
4646
)
4747
}
@@ -81,7 +81,7 @@ task instrument(dependsOn: 'compileDebugUnitTestSources') {
8181
classpath: configurations.jacocoAnt.asPath)
8282

8383
ant.instrument(destdir: offline_instrumented_outputDir) {
84-
fileset(dir: "$buildDir.path/intermediates/javac/debug/classes")
84+
fileset(dir: "$buildDir.path/intermediates/javac/debug/compileDebugJavaWithJavac/classes")
8585
}
8686
}
8787
}

Sources/sdk/proguard-sdk-release.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,8 @@
2020
public *;
2121
}
2222

23-
-keepnames class com.batch.android.BatchPushReceiver
24-
2523
-keepnames class com.batch.android.BatchPushService
2624

27-
-keepnames class com.batch.android.BatchPushInstanceIDService
28-
2925
-keep class com.batch.android.msgpack.core.buffer.MessageBuffer {}
3026

3127
-keep class com.google.android.gms.common.GooglePlayServicesUtil {

Sources/sdk/src/androidTest/java/com/batch/android/TestApplication.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ public class TestApplication extends Application {
99
public void onCreate() {
1010
super.onCreate();
1111
FirebaseApp.initializeApp(this);
12-
Batch.setConfig(new com.batch.android.Config("FAKE_API_KEY"));
12+
Batch.start("FAKE_API_KEY");
1313
}
1414
}

Sources/sdk/src/androidTest/java/com/batch/android/core/GooglePlayServicesHelperTest.java

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import androidx.test.ext.junit.runners.AndroidJUnit4;
1010
import androidx.test.filters.SmallTest;
1111
import com.google.android.gms.common.ConnectionResult;
12-
import java.util.concurrent.CountDownLatch;
1312
import org.junit.Before;
1413
import org.junit.Test;
1514
import org.junit.runner.RunWith;
@@ -23,7 +22,6 @@
2322
public class GooglePlayServicesHelperTest {
2423

2524
private Context appContext;
26-
private CountDownLatch latch;
2725

2826
@Before
2927
public void setUp() {
@@ -33,11 +31,10 @@ public void setUp() {
3331
/**
3432
* Test the version get
3533
*
36-
* @throws Exception
3734
*/
3835
@Test
39-
public void testGetLibVersion() throws Exception {
40-
Integer version = GooglePlayServicesHelper.getGooglePlayServicesLibVersion(appContext);
36+
public void testGetLibVersion() {
37+
Integer version = GooglePlayServicesHelper.getGooglePlayServicesLibVersion();
4138

4239
assertNotNull(version);
4340
assertTrue(version >= 4030500);
@@ -46,24 +43,21 @@ public void testGetLibVersion() throws Exception {
4643
/**
4744
* Test the availability get
4845
*
49-
* @throws Exception
5046
*/
5147
@Test
52-
public void testGetLibAvailability() throws Exception {
48+
public void testGetLibAvailability() {
5349
Integer availability = GooglePlayServicesHelper.getGooglePlayServicesAvailabilityInteger(appContext);
54-
5550
assertNotNull(availability);
56-
assertTrue(availability == 0);
57-
assertTrue("SUCCESS".equals(GooglePlayServicesHelper.getGooglePlayServicesAvailabilityString(availability)));
51+
assertEquals(0, (int) availability);
52+
assertEquals("SUCCESS", GooglePlayServicesHelper.getGooglePlayServicesAvailabilityString(availability));
5853
}
5954

6055
/**
61-
* Test the google environnement availability response
56+
* Test the google environment availability response
6257
*
63-
* @throws Exception
6458
*/
6559
@Test
66-
public void testCheckGoogleServicesAvailability() throws Exception {
60+
public void testCheckGoogleServicesAvailability() {
6761
final Integer playServicesAvailability = GooglePlayServicesHelper.getGooglePlayServicesAvailabilityInteger(
6862
appContext
6963
);

Sources/sdk/src/main/java/com/batch/android/AdsIdentifierProvider.java

Lines changed: 0 additions & 49 deletions
This file was deleted.

Sources/sdk/src/main/java/com/batch/android/AdsIdentifierProviderAvailabilityException.java

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)