Skip to content

Commit

Permalink
feat: support for android gradle plugin 8 (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrehan27 authored Apr 18, 2024
1 parent a0c1d2f commit 48b4e06
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 25 deletions.
11 changes: 6 additions & 5 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:7.2.0'
classpath 'com.android.tools.build:gradle:8.3.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand All @@ -26,15 +26,16 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
namespace 'io.customer.customer_io'
compileSdkVersion 33

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = '1.8'
jvmTarget = '17'
}

sourceSets {
Expand All @@ -58,7 +59,7 @@ android {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
// Customer.io SDK
def cioVersion = "3.9.2"
def cioVersion = "3.10.0"
implementation "io.customer.android:tracking:$cioVersion"
implementation "io.customer.android:messaging-push-fcm:$cioVersion"
implementation "io.customer.android:messaging-in-app:$cioVersion"
Expand Down
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<manifest package="io.customer.customer_io"></manifest>
<manifest />
1 change: 1 addition & 0 deletions apps/amiapp_flutter/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ plugins {
}

android {
namespace 'io.customer.amiapp_flutter'
compileSdkVersion 33
ndkVersion flutter.ndkVersion

Expand Down
38 changes: 25 additions & 13 deletions apps/amiapp_flutter/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.customer.amiapp_flutter">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />

<application
android:label="Flutter Sample"
<application
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
android:icon="@mipmap/ic_launcher"
android:label="Flutter Sample">
<activity
android:name=".MainActivity"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:exported="true"
android:hardwareAccelerated="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme" />
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<!-- Deep linking -->
<meta-data android:name="flutter_deeplinking_enabled" android:value="true" />
<meta-data
android:name="flutter_deeplinking_enabled"
android:value="true" />

<intent-filter android:label="@string/filter_view_app_link">
<action android:name="android.intent.action.VIEW" />
Expand Down Expand Up @@ -59,6 +59,18 @@
<data android:pathPrefix="/dashboard" />
</intent-filter>
</activity>
<!-- Register Customer.io Firebase Messaging Service as we want our SDK to handle all push
notifications. This is not required. However, if you have multiple services added for
handling push notifications, you might need to add this service to ensure all
notifications are handled by Customer.io. Read more:
https://www.customer.io/docs/sdk/flutter/push-notifications/multiple-push-providers/ -->
<service
android:name="io.customer.messagingpush.CustomerIOFirebaseMessagingService"
android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.customer.amiapp_flutter">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- The INTERNET permission is required for development. Specifically,
the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
Expand Down
5 changes: 4 additions & 1 deletion apps/amiapp_flutter/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ allprojects {
repositories {
google()
mavenCentral()
maven { url 'https://maven.gist.build' }
// Only required for using locally deployed versions of the SDK
mavenLocal()
// Only required for using SNAPSHOT versions of the SDK
maven { url 'https://s01.oss.sonatype.org/content/repositories/snapshots/' }
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
2 changes: 1 addition & 1 deletion apps/amiapp_flutter/android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pluginManagement {

plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.2.0" apply false
id "com.android.application" version "8.3.1" apply false
id "org.jetbrains.kotlin.android" version "1.7.21" apply false
id "com.google.gms.google-services" version "4.3.15" apply false
}
Expand Down

0 comments on commit 48b4e06

Please sign in to comment.