From ca932a2ce6a796a85d5262b4e9d61ab041e5c49f Mon Sep 17 00:00:00 2001 From: DanielEliraz Date: Wed, 16 Feb 2022 14:29:35 -0800 Subject: [PATCH] revert android to api 30 (#823) --- CODEOWNERS | 2 +- lib/android/app/build.gradle | 4 +--- .../wix/reactnativenotifications/RNNotificationsPackage.java | 2 +- .../core/NotificationIntentAdapter.java | 2 +- .../core/notification/PushNotification.java | 2 +- 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/CODEOWNERS b/CODEOWNERS index a5a52936f..2db79cfa4 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1 +1 @@ -* @yogevbd +* @DanielEliraz diff --git a/lib/android/app/build.gradle b/lib/android/app/build.gradle index 7ae0ea37f..00f0149f1 100644 --- a/lib/android/app/build.gradle +++ b/lib/android/app/build.gradle @@ -1,14 +1,12 @@ import groovy.json.JsonSlurper apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-android-extensions' def safeExtGet(prop, fallback) { rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback } -def DEFAULT_COMPILE_SDK_VERSION = 31 +def DEFAULT_COMPILE_SDK_VERSION = 30 def DEFAULT_MIN_SDK_VERSION = 21 def DEFAULT_KOTLIN_VERSION = "1.3.61" def DEFAULT_KOTLIN_STDLIB_VERSION = "kotlin-stdlib-jdk8" diff --git a/lib/android/app/src/main/java/com/wix/reactnativenotifications/RNNotificationsPackage.java b/lib/android/app/src/main/java/com/wix/reactnativenotifications/RNNotificationsPackage.java index c6913caf5..e3f177a50 100644 --- a/lib/android/app/src/main/java/com/wix/reactnativenotifications/RNNotificationsPackage.java +++ b/lib/android/app/src/main/java/com/wix/reactnativenotifications/RNNotificationsPackage.java @@ -63,7 +63,7 @@ public void onActivityCreated(Activity activity, Bundle savedInstanceState) { Intent intent = activity.getIntent(); if (NotificationIntentAdapter.canHandleIntent(intent)) { - Bundle notificationData = android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.S ? + Bundle notificationData = android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.R ? NotificationIntentAdapter.extractPendingNotificationDataFromIntent(intent) : intent.getExtras(); final IPushNotification pushNotification = PushNotification.get(mApplication.getApplicationContext(), notificationData); if (pushNotification != null) { diff --git a/lib/android/app/src/main/java/com/wix/reactnativenotifications/core/NotificationIntentAdapter.java b/lib/android/app/src/main/java/com/wix/reactnativenotifications/core/NotificationIntentAdapter.java index 1a36dc17c..617d8a271 100644 --- a/lib/android/app/src/main/java/com/wix/reactnativenotifications/core/NotificationIntentAdapter.java +++ b/lib/android/app/src/main/java/com/wix/reactnativenotifications/core/NotificationIntentAdapter.java @@ -14,7 +14,7 @@ public class NotificationIntentAdapter { @SuppressLint("UnspecifiedImmutableFlag") public static PendingIntent createPendingNotificationIntent(Context appContext, PushNotificationProps notification) { - if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.S) { + if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.R) { Intent mainActivityIntent = appContext.getPackageManager().getLaunchIntentForPackage(appContext.getPackageName()); mainActivityIntent.putExtra(PUSH_NOTIFICATION_EXTRA_NAME, notification.asBundle()); TaskStackBuilder taskStackBuilder = TaskStackBuilder.create(appContext); diff --git a/lib/android/app/src/main/java/com/wix/reactnativenotifications/core/notification/PushNotification.java b/lib/android/app/src/main/java/com/wix/reactnativenotifications/core/notification/PushNotification.java index c95f0d221..a2d4fdc7d 100644 --- a/lib/android/app/src/main/java/com/wix/reactnativenotifications/core/notification/PushNotification.java +++ b/lib/android/app/src/main/java/com/wix/reactnativenotifications/core/notification/PushNotification.java @@ -214,7 +214,7 @@ private void notifyOpenedToJS() { } protected void launchOrResumeApp() { - if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.S) { + if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.R) { final Intent intent = mAppLaunchHelper.getLaunchIntent(mContext); mContext.startActivity(intent); }