File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
src/main/java/com/onesignal Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -33,8 +33,12 @@ dependencies {
33
33
compileOnly ' com.google.android.gms:play-services-gcm:12.0.1'
34
34
api ' com.google.firebase:firebase-messaging:12.0.1'
35
35
36
+ // Can be compileOnly in 4.0.0, can't change until then as some projects may rely on this
36
37
implementation ' com.google.android.gms:play-services-location:12.0.1'
37
38
39
+ // Required for GoogleApiAvailability
40
+ implementation ' com.google.android.gms:play-services-base:12.0.1'
41
+
38
42
api ' com.android.support:support-v4:27.1.1'
39
43
api ' com.android.support:customtabs:27.1.1'
40
44
Original file line number Diff line number Diff line change 12
12
import static com .onesignal .OSUtils .getResourceString ;
13
13
14
14
class GooglePlayServicesUpgradePrompt {
15
-
16
- private static final String GOOGLE_PLAY_SERVICES_PACKAGE_NAME = "com.google.android.gms" ;
17
- private static final String GOOGLE_PLAY_STORE_PACKAGE_NAME = "com.android.vending" ;
18
-
19
15
private static final int PLAY_SERVICES_RESOLUTION_REQUEST = 9000 ;
20
16
21
17
static boolean isGMSInstalledAndEnabled () {
22
18
try {
23
19
PackageManager pm = OneSignal .appContext .getPackageManager ();
24
- PackageInfo info = pm .getPackageInfo (GOOGLE_PLAY_SERVICES_PACKAGE_NAME , PackageManager .GET_ACTIVITIES );
20
+ PackageInfo info = pm .getPackageInfo (GoogleApiAvailability . GOOGLE_PLAY_SERVICES_PACKAGE , PackageManager .GET_ACTIVITIES );
25
21
26
22
return info .applicationInfo .enabled ;
27
23
} catch (PackageManager .NameNotFoundException e ) {}
@@ -32,7 +28,7 @@ static boolean isGMSInstalledAndEnabled() {
32
28
private static boolean isGooglePlayStoreInstalled () {
33
29
try {
34
30
PackageManager pm = OneSignal .appContext .getPackageManager ();
35
- PackageInfo info = pm .getPackageInfo (GOOGLE_PLAY_STORE_PACKAGE_NAME , PackageManager .GET_ACTIVITIES );
31
+ PackageInfo info = pm .getPackageInfo (GoogleApiAvailability . GOOGLE_PLAY_SERVICES_PACKAGE , PackageManager .GET_ACTIVITIES );
36
32
String label = (String ) info .applicationInfo .loadLabel (pm );
37
33
return (label != null && !label .equals ("Market" ));
38
34
} catch (Throwable e ) {}
You can’t perform that action at this time.
0 commit comments