Skip to content

Commit 20db236

Browse files
committed
release: SDK 1.21.0
1 parent 5bad6fd commit 20db236

38 files changed

+10141
-638
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,5 @@ node_modules/
3333
**/.idea/saveactions_settings.xml
3434
**/.idea/assetWizardSettings.xml
3535
**/.idea/jarRepositories.xml
36+
**/.idea/androidTestResultsUserPreferences.xml
37+
**/.idea/other.xml

Sources/buildSrc/src/main/java/Consts.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ object ProjectConsts {
1111
}
1212

1313
object SDKConsts {
14-
const val VERSION = "1.20.1"
15-
const val API_LEVEL = 61
14+
const val VERSION = "1.21.0"
15+
const val API_LEVEL = 70
1616
const val MESSAGING_API_LEVEL = 12
1717

1818
const val MIN_SDK = 15

Sources/sdk/build.gradle.kts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,10 @@ dependencies {
121121
val kotlinVersion = ProjectConsts.KOTLIN_VERSION
122122
val kotlinCoroutinesVersion = ProjectConsts.KOTLIN_COROUTINES_VERSION
123123

124-
compileOnly("com.google.android.gms:play-services-ads:${playServicesVersion}")
125124
compileOnly("com.google.android.gms:play-services-gcm:${playServicesVersion}")
126125
compileOnly("com.google.android.gms:play-services-location:${playServicesVersion}")
127126
compileOnly("com.google.android.gms:play-services-nearby:${playServicesVersion}")
128-
compileOnly("com.google.android.play:core:1.9.0")
127+
compileOnly("com.google.android.play:review:2.0.1")
129128
compileOnly("com.google.firebase:firebase-iid:21.1.0")
130129
compileOnly("com.google.firebase:firebase-messaging:22.0.0")
131130
compileOnly(project(":sdk-stubs"))
@@ -148,7 +147,6 @@ dependencies {
148147
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
149148
androidTestImplementation("androidx.test.ext:truth:1.5.0")
150149

151-
androidTestImplementation("com.google.android.gms:play-services-ads:${playServicesVersion}")
152150
androidTestImplementation("com.google.android.gms:play-services-gcm:${playServicesVersion}")
153151
androidTestImplementation("com.google.android.gms:play-services-location:${playServicesVersion}")
154152
androidTestImplementation("com.google.android.gms:play-services-nearby:${playServicesVersion}")
@@ -164,7 +162,6 @@ dependencies {
164162
testImplementation("androidx.test.espresso:espresso-intents:3.5.1")
165163
testImplementation("androidx.test.espresso:espresso-core:3.5.1")
166164
testImplementation("androidx.test.ext:truth:1.5.0")
167-
testImplementation("com.google.android.gms:play-services-ads:${playServicesVersion}")
168165
testImplementation("com.google.android.gms:play-services-gcm:${playServicesVersion}")
169166
testImplementation("com.google.android.gms:play-services-location:${playServicesVersion}")
170167
testImplementation("com.google.android.gms:play-services-nearby:${playServicesVersion}")

Sources/sdk/proguard-consumer-rules.txt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,3 @@
2121
public static int GOOGLE_PLAY_SERVICES_VERSION_CODE;
2222
public *** isGooglePlayServicesAvailable(...);
2323
}
24-
25-
-keepclassmembers class com.google.android.gms.ads.identifier.AdvertisingIdClient {
26-
public *** getAdvertisingIdInfo(...);
27-
}
28-
29-
-keepclassmembers class com.google.android.gms.ads.identifier.AdvertisingIdClient$Info {
30-
public *** getId();
31-
public *** isLimitAdTrackingEnabled();
32-
}

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

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

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

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import static org.junit.Assert.assertEquals;
44
import static org.junit.Assert.assertNotNull;
55
import static org.junit.Assert.assertTrue;
6-
import static org.junit.Assert.fail;
76

87
import android.content.Context;
98
import androidx.test.core.app.ApplicationProvider;
@@ -71,31 +70,4 @@ public void testCheckGoogleServicesAvailability() throws Exception {
7170
assertNotNull(playServicesAvailability);
7271
assertEquals(ConnectionResult.SUCCESS, (int) playServicesAvailability);
7372
}
74-
75-
/**
76-
* Test the advertising id value response
77-
*
78-
* @throws Exception
79-
*/
80-
@Test
81-
public void testGetAdvertisingIDValue() throws Exception {
82-
latch = new CountDownLatch(1);
83-
GooglePlayServicesHelper.getAdvertisingIDValue(
84-
appContext,
85-
new GooglePlayServicesHelper.AdvertisingValueListener() {
86-
@Override
87-
public void onValue(String value, boolean limited) {
88-
assertNotNull(value);
89-
latch.countDown();
90-
}
91-
92-
@Override
93-
public void onError(Exception e) {
94-
fail("Error occured : " + e.getMessage());
95-
latch.countDown();
96-
}
97-
}
98-
);
99-
latch.await();
100-
}
10173
}

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22

33
import com.batch.android.annotation.PublicSDK;
44

5+
/**
6+
* @deprecated Batch doesn't collects the Android Advertising Identifier anymore.
7+
*/
58
@PublicSDK
9+
@Deprecated
610
public interface AdsIdentifierProvider {
711
/**
812
* Is this provider available to use? This is the place to check if the libraries are here at
@@ -22,8 +26,10 @@ public interface AdsIdentifierProvider {
2226

2327
/**
2428
* Interface used to callback from
29+
* @deprecated Batch doesn't collects the Android Advertising Identifier anymore.
2530
*/
2631
@PublicSDK
32+
@Deprecated
2733
interface AdsIdentifierListener {
2834
/**
2935
* Called on success with the id & if the user selected to opt-out from ads

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22

33
import com.batch.android.annotation.PublicSDK;
44

5+
/**
6+
*
7+
* @deprecated Batch doesn't collects the Android Advertising Identifier anymore.
8+
*/
59
@PublicSDK
10+
@Deprecated
611
public class AdsIdentifierProviderAvailabilityException extends Exception {
712

813
public AdsIdentifierProviderAvailabilityException(String message) {
Lines changed: 22 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -1,134 +1,67 @@
11
package com.batch.android;
22

3+
import android.content.Context;
34
import androidx.annotation.Nullable;
4-
import com.batch.android.core.Logger;
5-
import com.batch.android.di.providers.PushModuleProvider;
65
import com.batch.android.processor.Module;
76
import com.batch.android.processor.Singleton;
87

98
/**
109
* Object that encapsulate advertising ID
1110
*
11+
* @deprecated Batch doesn't collects the Android Advertising Identifier anymore.
1212
* @hide
1313
*/
1414
@Module
1515
@Singleton
16+
@Deprecated
1617
public final class AdvertisingID {
1718

18-
private static final String TAG = "AdvertisingID";
19-
20-
/**
21-
* Advertising ID value return when not available :
22-
*
23-
* - For Apps with target API level set to 31 (Android 12) or later must declare the normal
24-
* permission com.google.android.gms.AD_ID in the AndroidManifest.xml in order to use
25-
* the getId API
26-
*
27-
* - For all users who have opted out of ads personalization in their device settings
28-
*/
29-
private static final String UNAVAILABLE_AD_ID = "00000000-0000-0000-0000-000000000000";
30-
31-
/**
32-
* Advertising ID
33-
*/
34-
private String advertisingID;
35-
36-
/**
37-
* Is use of advertising id limited
38-
*/
39-
private boolean limited;
40-
41-
/**
42-
* Is advertising ID already available
43-
*/
44-
private boolean advertisingIdReady = false;
45-
46-
// ------------------------------------------------->
47-
48-
public AdvertisingID() {
49-
// Start Advertising ID async get
50-
initAdvertisingID();
51-
}
52-
53-
/**
54-
* Start the thread to retrieve the advertising ID asynchronously
55-
*/
56-
private void initAdvertisingID() {
57-
AdsIdentifierProvider provider = PushModuleProvider.get().getAdsIdentifierProvider();
58-
if (provider != null) {
59-
try {
60-
provider.checkAvailability();
61-
} catch (AdsIdentifierProviderAvailabilityException e) {
62-
Logger.error(TAG, "Could not get Advertising Id: " + e.getMessage());
63-
return;
64-
}
65-
66-
provider.getAdsIdentifier(
67-
new AdsIdentifierProvider.AdsIdentifierListener() {
68-
@Override
69-
public void onSuccess(String id, boolean limited) {
70-
advertisingID = UNAVAILABLE_AD_ID.equals(id) ? null : id;
71-
AdvertisingID.this.limited = limited;
72-
advertisingIdReady = true;
73-
Logger.internal(TAG, "Advertising ID retrieved");
74-
}
75-
76-
@Override
77-
public void onError(Exception e) {
78-
Logger.error(TAG, "Error while retrieving Advertising ID", e);
79-
advertisingIdReady = true;
80-
}
81-
}
82-
);
83-
}
84-
}
85-
86-
// --------------------------------------------->
19+
public AdvertisingID() {}
8720

8821
/**
8922
* Tell if the process to retrieve advertising ID is already complete
9023
*
91-
* @return true if the process is completed
24+
* @return This method always return false.
25+
* @deprecated Batch doesn't support advertising id anymore.
9226
*/
27+
@Deprecated
9328
public boolean isReady() {
94-
return advertisingIdReady;
29+
return false;
9530
}
9631

9732
/**
9833
* Get the advertising ID
9934
*
100-
* @return The advertising ID if available, null otherwise
101-
* @throws IllegalStateException if the advertising id is not available yet (check {@link #isReady()})
35+
* @return This method always return null.
36+
* @throws IllegalStateException Cannot throw
37+
* @deprecated Batch doesn't support advertising id anymore.
10238
*/
39+
@Deprecated
10340
@Nullable
10441
public String get() throws IllegalStateException {
105-
if (!advertisingIdReady) {
106-
throw new IllegalStateException("Advertising ID is not ready yet");
107-
}
108-
109-
return advertisingID;
42+
return null;
11043
}
11144

11245
/**
11346
* Is the use of the advertising ID limited
11447
*
115-
* @return true if the advertising ID limited
116-
* @throws IllegalStateException if the advertising id is not available yet (check {@link #isReady()})
48+
* @return This method always return false.
49+
* @throws IllegalStateException Cannot throw
50+
* @deprecated Batch doesn't support advertising id anymore.
11751
*/
52+
@Deprecated
11853
public boolean isLimited() throws IllegalStateException {
119-
if (!advertisingIdReady) {
120-
throw new IllegalStateException("Advertising ID is not ready yet");
121-
}
122-
123-
return limited;
54+
return false;
12455
}
12556

12657
/**
12758
* Is the advertising ID not null
12859
*
129-
* @return true if its not
60+
* @return This method always return false.
61+
* @deprecated Batch doesn't support advertising id anymore.
13062
*/
63+
@Deprecated
13164
public boolean isNotNull() {
132-
return advertisingID != null;
65+
return false;
13366
}
13467
}

0 commit comments

Comments
 (0)