diff --git a/example/.gitignore b/example/.gitignore index c08fafe5..85802530 100644 --- a/example/.gitignore +++ b/example/.gitignore @@ -45,3 +45,4 @@ app.*.map.json /android/app/release android/app/.cxx/ +lib/firebase_options.dart diff --git a/example/.metadata b/example/.metadata index 526e166a..08cb0a96 100644 --- a/example/.metadata +++ b/example/.metadata @@ -4,7 +4,42 @@ # This file should be version controlled and should not be manually edited. version: - revision: 60bd88df915880d23877bfc1602e8ddcf4c4dd2a - channel: stable + revision: "19074d12f7eaf6a8180cd4036a430c1d76de904e" + channel: "stable" project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: 19074d12f7eaf6a8180cd4036a430c1d76de904e + base_revision: 19074d12f7eaf6a8180cd4036a430c1d76de904e + - platform: android + create_revision: 19074d12f7eaf6a8180cd4036a430c1d76de904e + base_revision: 19074d12f7eaf6a8180cd4036a430c1d76de904e + - platform: ios + create_revision: 19074d12f7eaf6a8180cd4036a430c1d76de904e + base_revision: 19074d12f7eaf6a8180cd4036a430c1d76de904e + - platform: linux + create_revision: 19074d12f7eaf6a8180cd4036a430c1d76de904e + base_revision: 19074d12f7eaf6a8180cd4036a430c1d76de904e + - platform: macos + create_revision: 19074d12f7eaf6a8180cd4036a430c1d76de904e + base_revision: 19074d12f7eaf6a8180cd4036a430c1d76de904e + - platform: web + create_revision: 19074d12f7eaf6a8180cd4036a430c1d76de904e + base_revision: 19074d12f7eaf6a8180cd4036a430c1d76de904e + - platform: windows + create_revision: 19074d12f7eaf6a8180cd4036a430c1d76de904e + base_revision: 19074d12f7eaf6a8180cd4036a430c1d76de904e + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/example/README.md b/example/README.md index d83502f3..5e40545c 100644 --- a/example/README.md +++ b/example/README.md @@ -2,15 +2,15 @@ Demonstrates how to use the twilio_voice plugin. -## Getting Started +## Getting Started - Android -This project is a starting point for a Flutter application. - -A few resources to get you started if this is your first Flutter project: - -- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) -- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) - -For help getting started with Flutter, view our -[online documentation](https://flutter.dev/docs), which offers tutorials, -samples, guidance on mobile development, and a full API reference. +- Create firebase project +- Create android application +- install `flutterfire_cli` + ```shell + dart pub global activate flutterfire_cli + ``` +- run in terminal + ```shell + flutterfire configure --project=[your_firebase_project_name] --android-app-id=[your_android_app_id] --platforms=android + ``` \ No newline at end of file diff --git a/example/android/.gitignore b/example/android/.gitignore index b877f0cf..a267ec0d 100644 --- a/example/android/.gitignore +++ b/example/android/.gitignore @@ -5,7 +5,11 @@ gradle-wrapper.jar /gradlew.bat /local.properties GeneratedPluginRegistrant.java -/app/google-services.json +.cxx/ +google-services.json + # Remember to never publicly share your keystore. -# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app +# See https://flutter.dev/to/reference-keystore key.properties +**/*.keystore +**/*.jks diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle deleted file mode 100644 index d254d35c..00000000 --- a/example/android/app/build.gradle +++ /dev/null @@ -1,60 +0,0 @@ -plugins { - id "com.android.application" - id "kotlin-android" - id "dev.flutter.flutter-gradle-plugin" -} - -def localProperties = new Properties() -def localPropertiesFile = rootProject.file('local.properties') -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader('UTF-8') { reader -> - localProperties.load(reader) - } -} - -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') -if (flutterVersionCode == null) { - flutterVersionCode = '1' -} - -def flutterVersionName = localProperties.getProperty('flutter.versionName') -if (flutterVersionName == null) { - flutterVersionName = '1.0' -} - -android { - compileSdk rootProject.ext.compileSdkVersion - - defaultConfig { - // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "com.twilio.twilio_voice_example" - minSdkVersion rootProject.ext.minSdkVersion - targetSdkVersion rootProject.ext.targetSdkVersion - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName - } - - buildTypes { - release { - // TODO: Add your own signing config for the release build. - // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig signingConfigs.debug - - // Includes the default ProGuard rules files that are packaged with - // the Android Gradle plugin. To learn more, go to the section about - // R8 configuration files. - proguardFiles getDefaultProguardFile( - 'proguard-android-optimize.txt'), - 'proguard-rules.pro' - - ndk { - abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86_64' - } - } - } - namespace 'com.twilio.twilio_voice_example' -} - -flutter { - source '../..' -} diff --git a/example/android/app/build.gradle.kts b/example/android/app/build.gradle.kts new file mode 100644 index 00000000..b8e8291a --- /dev/null +++ b/example/android/app/build.gradle.kts @@ -0,0 +1,52 @@ +plugins { + id("com.android.application") + // START: FlutterFire Configuration + id("com.google.gms.google-services") + // END: FlutterFire Configuration + id("kotlin-android") + // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. + id("dev.flutter.flutter-gradle-plugin") +} + +android { + namespace = "com.twilio.twilio_voice_example" + compileSdk = flutter.compileSdkVersion + ndkVersion = flutter.ndkVersion + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + + kotlinOptions { + jvmTarget = JavaVersion.VERSION_17.toString() + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId = "com.twilio.twilio_voice_example" + // You can update the following values to match your application needs. + // For more information, see: https://flutter.dev/to/review-gradle-config. + minSdk = 26 + targetSdk = flutter.targetSdkVersion + versionCode = flutter.versionCode + versionName = flutter.versionName + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig = signingConfigs.getByName("debug") + } + } +} + +flutter { + source = "../.." +} + +dependencies { + implementation(platform("com.google.firebase:firebase-bom:34.6.0")) + implementation("com.google.firebase:firebase-analytics") +} diff --git a/example/android/app/src/debug/AndroidManifest.xml b/example/android/app/src/debug/AndroidManifest.xml index f880684a..399f6981 100644 --- a/example/android/app/src/debug/AndroidManifest.xml +++ b/example/android/app/src/debug/AndroidManifest.xml @@ -1,5 +1,6 @@ - diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml index 20b8c32d..41d0c873 100644 --- a/example/android/app/src/main/AndroidManifest.xml +++ b/example/android/app/src/main/AndroidManifest.xml @@ -1,49 +1,45 @@ - - + + android:label="twilio_voice_example" + android:name="${applicationName}" + android:icon="@mipmap/ic_launcher"> - - + android:name="io.flutter.embedding.android.NormalTheme" + android:resource="@style/NormalTheme" + /> - - + + - - - - - + + + + + + + diff --git a/example/android/app/src/main/java/com/twilio/twilio_voice_example/MainActivity.java b/example/android/app/src/main/java/com/twilio/twilio_voice_example/MainActivity.java deleted file mode 100644 index e3e1c5b1..00000000 --- a/example/android/app/src/main/java/com/twilio/twilio_voice_example/MainActivity.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.twilio.twilio_voice_example; - -import io.flutter.embedding.android.FlutterActivity; - -public class MainActivity extends FlutterActivity { -} diff --git a/example/android/app/src/main/kotlin/com/twilio/twilio_voice_example/MainActivity.kt b/example/android/app/src/main/kotlin/com/twilio/twilio_voice_example/MainActivity.kt new file mode 100644 index 00000000..c5a01ee4 --- /dev/null +++ b/example/android/app/src/main/kotlin/com/twilio/twilio_voice_example/MainActivity.kt @@ -0,0 +1,5 @@ +package com.twilio.twilio_voice_example + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity : FlutterActivity() diff --git a/example/android/app/src/main/res/drawable/splash_icon.png b/example/android/app/src/main/res/drawable/splash_icon.png deleted file mode 100644 index db77bb4b..00000000 Binary files a/example/android/app/src/main/res/drawable/splash_icon.png and /dev/null differ diff --git a/example/android/app/src/main/res/values-night/styles.xml b/example/android/app/src/main/res/values-night/styles.xml new file mode 100644 index 00000000..06952be7 --- /dev/null +++ b/example/android/app/src/main/res/values-night/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/example/android/app/src/main/res/values/strings.xml b/example/android/app/src/main/res/values/strings.xml deleted file mode 100644 index c6677b16..00000000 --- a/example/android/app/src/main/res/values/strings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - Twilio Voice Example Connection Service - Example App - Example app voice calls calling account - \ No newline at end of file diff --git a/example/android/app/src/main/res/values/styles.xml b/example/android/app/src/main/res/values/styles.xml index 160faeb0..cb1ef880 100644 --- a/example/android/app/src/main/res/values/styles.xml +++ b/example/android/app/src/main/res/values/styles.xml @@ -1,17 +1,16 @@ - -