diff --git a/android/.gitignore b/android/.gitignore deleted file mode 100644 index c404dd7..0000000 --- a/android/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -*.iml -*.bak -.gradle -/local.properties -/.idea/workspace.xml -/.idea/libraries -.DS_Store -/build -/captures diff --git a/android/.idea/.name b/android/.idea/.name deleted file mode 100644 index 0ca2aa7..0000000 --- a/android/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -flutter_twilio_conversations \ No newline at end of file diff --git a/android/.idea/compiler.xml b/android/.idea/compiler.xml deleted file mode 100644 index fb7f4a8..0000000 --- a/android/.idea/compiler.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/android/.idea/gradle.xml b/android/.idea/gradle.xml index b220fcc..4019936 100644 --- a/android/.idea/gradle.xml +++ b/android/.idea/gradle.xml @@ -4,15 +4,9 @@ diff --git a/android/.idea/jarRepositories.xml b/android/.idea/jarRepositories.xml deleted file mode 100644 index e34606c..0000000 --- a/android/.idea/jarRepositories.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/android/.idea/migrations.xml b/android/.idea/migrations.xml new file mode 100644 index 0000000..f8051a6 --- /dev/null +++ b/android/.idea/migrations.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/android/.idea/misc.xml b/android/.idea/misc.xml index 6199cc2..8bb1dd1 100644 --- a/android/.idea/misc.xml +++ b/android/.idea/misc.xml @@ -1,6 +1,6 @@ - - + + diff --git a/android/.idea/modules.xml b/android/.idea/modules.xml deleted file mode 100644 index 94fd78d..0000000 --- a/android/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/android/src/main/kotlin/twilio/flutter/twilio_conversations/methods/MessageMethods.kt b/android/src/main/kotlin/twilio/flutter/twilio_conversations/methods/MessageMethods.kt index 7b76ce0..0904f7e 100644 --- a/android/src/main/kotlin/twilio/flutter/twilio_conversations/methods/MessageMethods.kt +++ b/android/src/main/kotlin/twilio/flutter/twilio_conversations/methods/MessageMethods.kt @@ -141,18 +141,41 @@ object MessageMethods { Log.d("TwilioInfo", "MessageMethods.getMedia => onSuccess") channel.getMessageByIndex(messageIndex, object : CallbackListener { override fun onSuccess(message: Message) { - Log.d("TwilioInfo", "MessageMethods.getMedia (Messages.getMessageByIndex) => onSuccess") - message.getTemporaryContentUrlsForAttachedMedia(object : CallbackListener> { - override fun onSuccess(fileUrls: Map) { - Log.d("TwilioInfo", "MessageMethods.getMedia (Message.Media.download) => onSuccess") - result.success(fileUrls[fileUrls.keys.first()] as String) - } + Log.d("TwilioInfo", "MessageMethods.getAllAttachedMedia (Messages.getMessageByIndex) => onSuccess") - override fun onError(errorInfo: ErrorInfo) { - Log.d("TwilioInfo", "MessageMethods.getMedia (Message.Media.download) => onError: $errorInfo") - result.error("${errorInfo.code}", errorInfo.message, errorInfo.status) - } - }) + val newmediaList = message.getAttachedMedia() + + if (newmediaList != null && newmediaList.isNotEmpty()) { + message.getTemporaryContentUrlsForMedia(newmediaList, object : CallbackListener> { + override fun onSuccess(fileUrls: Map) { + Log.d("TwilioInfo", "MessageMethods.getAllAttachedMedia => onSuccess") + val mediaSids = fileUrls.values.toList() + + Log.d("TwilioInfo", "Media SIDs: $mediaSids") + + result.success(mediaSids) + } + + override fun onError(errorInfo: ErrorInfo) { + Log.d("TwilioInfo", "MessageMethods.getAllAttachedMedia => onError: $errorInfo") + result.error("${errorInfo.code}", errorInfo.message, errorInfo.status) + } + }) + } else { + result.error("ERROR", "No attached media found for the specified message", null) + } +// Log.d("TwilioInfo", "MessageMethods.getMedia (Messages.getMessageByIndex) => onSuccess") +// message.getTemporaryContentUrlsForAttachedMedia(object : CallbackListener> { +// override fun onSuccess(fileUrls: Map) { +// Log.d("TwilioInfo", "MessageMethods.getMedia (Message.Media.download) => onSuccess") +// result.success(fileUrls[fileUrls.keys.first()] as String) +// } +// +// override fun onError(errorInfo: ErrorInfo) { +// Log.d("TwilioInfo", "MessageMethods.getMedia (Message.Media.download) => onError: $errorInfo") +// result.error("${errorInfo.code}", errorInfo.message, errorInfo.status) +// } +// }) } override fun onError(errorInfo: ErrorInfo) { @@ -168,4 +191,4 @@ object MessageMethods { } }) } -} +} \ No newline at end of file diff --git a/android/src/main/kotlin/twilio/flutter/twilio_conversations/methods/MessagesMethods.kt b/android/src/main/kotlin/twilio/flutter/twilio_conversations/methods/MessagesMethods.kt index b38ede0..ba3c9bd 100644 --- a/android/src/main/kotlin/twilio/flutter/twilio_conversations/methods/MessagesMethods.kt +++ b/android/src/main/kotlin/twilio/flutter/twilio_conversations/methods/MessagesMethods.kt @@ -25,51 +25,201 @@ object MessagesMethods { var messagePreparator = channel.prepareMessage() if (options["body"] != null) { + Log.d("TwilioInfo", "MessagesMethods.sendMessage => Inside set body") messagePreparator.setBody(options["body"] as String) } if (options["attributes"] != null) { + Log.d("TwilioInfo", "MessagesMethods.sendMessage => Inside set attribute") + messagePreparator.setAttributes(Mapper.mapToAttributes(options["attributes"] as Map?) as Attributes) } - if (options["input"] != null && (options["mimeType"] as String?) != null) { - val input = options["input"] as String - val mimeType = options["mimeType"] as String? - ?: return result.error("ERROR", "Missing 'mimeType' in MessageOptions", null) - Log.d("TwilioInfo", "MessagesMethods.sendMessage (Channels.addMedia) => hasMedia") - channel.prepareMessage().addMedia(FileInputStream(input), mimeType, "image.jpeg", object : MediaUploadListener { - override fun onCompleted(mediaSid: String) { - Log.d("TwilioInfo", "MessagesMethods.sendMessage (Message.addMedia) => onCompleted") - pluginInstance.mediaProgressSink?.success({ - "mediaProgressListenerId" to options["mediaProgressListenerId"] - "name" to "completed" - "data" to mediaSid - }) - } - - override fun onStarted() { - Log.d("TwilioInfo", "MessagesMethods.sendMessage (Message.addMedia) => onStarted") - pluginInstance.mediaProgressSink?.success({ - "mediaProgressListenerId" to options["mediaProgressListenerId"] - "name" to "started" - }) - } - - override fun onFailed(errorInfo: ErrorInfo) { - Log.d("TwilioInfo", "MessagesMethods.sendMessage (Message.addMedia) => onFailed") - result.error("${errorInfo.code}", errorInfo.message, errorInfo.status) - } - }).buildAndSend(object : CallbackListener { - override fun onSuccess(message: Message) { - Log.d("TwilioInfo", "MessagesMethods.sendMessage (Message.sendMessage) => onSuccess") - result.success(Mapper.messageToMap(message)) - } - - override fun onError(errorInfo: ErrorInfo) { - Log.d("TwilioInfo", "MessagesMethods.sendMessage (Message.sendMessage) => onError: $errorInfo") - result.error("${errorInfo.code}", errorInfo.message, errorInfo.status) - } - }) + if(options["input"] != null && options["mimeType"] != null){ + val inputList = options["input"] as List + val mimeTypeList = options["mimeType"] as List + val fileName = options["filename"] as List + if(inputList.size == mimeTypeList.size && inputList.size == 1){ + val input = inputList[0] as String + val mimeType = mimeTypeList[0] as String? + ?: return result.error("ERROR", "Missing 'mimeType' in MessageOptions", null) + Log.d("TwilioInfo", "MessagesMethods.sendMessage (Channels.addMedia) => hasMedia") + messagePreparator.addMedia(FileInputStream(input), mimeType, fileName[0] as String, object : MediaUploadListener { + override fun onCompleted(mediaSid: String) { + Log.d("TwilioInfo", "MessagesMethods.sendMessage (Message.addMedia) => onCompleted") + pluginInstance.mediaProgressSink?.success({ + "mediaProgressListenerId" to options["mediaProgressListenerId"] + "name" to "completed" + "data" to mediaSid + }) + } + + override fun onStarted() { + Log.d("TwilioInfo", "MessagesMethods.sendMessage (Message.addMedia) => onStarted") + pluginInstance.mediaProgressSink?.success({ + "mediaProgressListenerId" to options["mediaProgressListenerId"] + "name" to "started" + }) + } + + override fun onFailed(errorInfo: ErrorInfo) { + Log.d("TwilioInfo", "MessagesMethods.sendMessage (Message.addMedia) => onFailed") + result.error("${errorInfo.code}", errorInfo.message, errorInfo.status) + } + }).buildAndSend(object : CallbackListener { + override fun onSuccess(message: Message) { + Log.d("TwilioInfo", "MessagesMethods.sendMessage (Message.sendMessage) => onSuccess") + result.success(Mapper.messageToMap(message)) + } + + override fun onError(errorInfo: ErrorInfo) { + Log.d("TwilioInfo", "MessagesMethods.sendMessage (Message.sendMessage) => onError: $errorInfo") + result.error("${errorInfo.code}", errorInfo.message, errorInfo.status) + } + }) + } + + if(inputList.size == mimeTypeList.size && inputList.size == 2){ + + Log.d("TwilioInfo", "MessagesMethods.sendMessage (Channels.addMedia) => hasMedia") + messagePreparator.addMedia(FileInputStream( inputList[0] as String), mimeTypeList[0] as String, fileName[0] as String, object : MediaUploadListener { + override fun onCompleted(mediaSid: String) { + Log.d("TwilioInfo", "MessagesMethods.sendMessage (Message.addMedia) => onCompleted") + pluginInstance.mediaProgressSink?.success({ + "mediaProgressListenerId" to options["mediaProgressListenerId"] + "name" to "completed" + "data" to mediaSid + }) + } + + override fun onStarted() { + Log.d("TwilioInfo", "MessagesMethods.sendMessage (Message.addMedia) => onStarted") + pluginInstance.mediaProgressSink?.success({ + "mediaProgressListenerId" to options["mediaProgressListenerId"] + "name" to "started" + }) + } + + override fun onFailed(errorInfo: ErrorInfo) { + Log.d("TwilioInfo", "MessagesMethods.sendMessage (Message.addMedia) => onFailed") + result.error("${errorInfo.code}", errorInfo.message, errorInfo.status) + } + }).addMedia(FileInputStream( inputList[1] as String), mimeTypeList[1] as String, fileName[1] as String, object : MediaUploadListener { + override fun onCompleted(mediaSid: String) { + Log.d("TwilioInfo", "MessagesMethods.sendMessage (Message.addMedia) => onCompleted") + pluginInstance.mediaProgressSink?.success({ + "mediaProgressListenerId" to options["mediaProgressListenerId"] + "name" to "completed" + "data" to mediaSid + }) + } + + override fun onStarted() { + Log.d("TwilioInfo", "MessagesMethods.sendMessage (Message.addMedia) => onStarted") + pluginInstance.mediaProgressSink?.success({ + "mediaProgressListenerId" to options["mediaProgressListenerId"] + "name" to "started" + }) + } + + override fun onFailed(errorInfo: ErrorInfo) { + Log.d("TwilioInfo", "MessagesMethods.sendMessage (Message.addMedia) => onFailed") + result.error("${errorInfo.code}", errorInfo.message, errorInfo.status) + } + }).buildAndSend(object : CallbackListener { + override fun onSuccess(message: Message) { + Log.d("TwilioInfo", "MessagesMethods.sendMessage (Message.sendMessage) => onSuccess") + result.success(Mapper.messageToMap(message)) + } + + override fun onError(errorInfo: ErrorInfo) { + Log.d("TwilioInfo", "MessagesMethods.sendMessage (Message.sendMessage) => onError: $errorInfo") + result.error("${errorInfo.code}", errorInfo.message, errorInfo.status) + } + }) + } + + if(inputList.size == mimeTypeList.size && inputList.size == 3){ + + Log.d("TwilioInfo", "MessagesMethods.sendMessage (Channels.addMedia) => hasMedia") + messagePreparator.addMedia(FileInputStream( inputList[0] as String), mimeTypeList[0] as String, fileName[0] as String, object : MediaUploadListener { + override fun onCompleted(mediaSid: String) { + Log.d("TwilioInfo", "MessagesMethods.sendMessage (Message.addMedia) => onCompleted") + pluginInstance.mediaProgressSink?.success({ + "mediaProgressListenerId" to options["mediaProgressListenerId"] + "name" to "completed" + "data" to mediaSid + }) + } + + override fun onStarted() { + Log.d("TwilioInfo", "MessagesMethods.sendMessage (Message.addMedia) => onStarted") + pluginInstance.mediaProgressSink?.success({ + "mediaProgressListenerId" to options["mediaProgressListenerId"] + "name" to "started" + }) + } + + override fun onFailed(errorInfo: ErrorInfo) { + Log.d("TwilioInfo", "MessagesMethods.sendMessage (Message.addMedia) => onFailed") + result.error("${errorInfo.code}", errorInfo.message, errorInfo.status) + } + }).addMedia(FileInputStream( inputList[1] as String), mimeTypeList[1] as String, fileName[1] as String, object : MediaUploadListener { + override fun onCompleted(mediaSid: String) { + Log.d("TwilioInfo", "MessagesMethods.sendMessage (Message.addMedia) => onCompleted") + pluginInstance.mediaProgressSink?.success({ + "mediaProgressListenerId" to options["mediaProgressListenerId"] + "name" to "completed" + "data" to mediaSid + }) + } + + override fun onStarted() { + Log.d("TwilioInfo", "MessagesMethods.sendMessage (Message.addMedia) => onStarted") + pluginInstance.mediaProgressSink?.success({ + "mediaProgressListenerId" to options["mediaProgressListenerId"] + "name" to "started" + }) + } + + override fun onFailed(errorInfo: ErrorInfo) { + Log.d("TwilioInfo", "MessagesMethods.sendMessage (Message.addMedia) => onFailed") + result.error("${errorInfo.code}", errorInfo.message, errorInfo.status) + } + }).addMedia(FileInputStream( inputList[2] as String), mimeTypeList[2] as String, fileName[2] as String, object : MediaUploadListener { + override fun onCompleted(mediaSid: String) { + Log.d("TwilioInfo", "MessagesMethods.sendMessage (Message.addMedia) => onCompleted") + pluginInstance.mediaProgressSink?.success({ + "mediaProgressListenerId" to options["mediaProgressListenerId"] + "name" to "completed" + "data" to mediaSid + }) + } + + override fun onStarted() { + Log.d("TwilioInfo", "MessagesMethods.sendMessage (Message.addMedia) => onStarted") + pluginInstance.mediaProgressSink?.success({ + "mediaProgressListenerId" to options["mediaProgressListenerId"] + "name" to "started" + }) + } + + override fun onFailed(errorInfo: ErrorInfo) { + Log.d("TwilioInfo", "MessagesMethods.sendMessage (Message.addMedia) => onFailed") + result.error("${errorInfo.code}", errorInfo.message, errorInfo.status) + } + }).buildAndSend(object : CallbackListener { + override fun onSuccess(message: Message) { + Log.d("TwilioInfo", "MessagesMethods.sendMessage (Message.sendMessage) => onSuccess") + result.success(Mapper.messageToMap(message)) + } + + override fun onError(errorInfo: ErrorInfo) { + Log.d("TwilioInfo", "MessagesMethods.sendMessage (Message.sendMessage) => onError: $errorInfo") + result.error("${errorInfo.code}", errorInfo.message, errorInfo.status) + } + }) + } } else { messagePreparator.buildAndSend(object : CallbackListener { override fun onSuccess(message: Message) { diff --git a/example/.gitignore b/example/.gitignore deleted file mode 100644 index 686cd66..0000000 --- a/example/.gitignore +++ /dev/null @@ -1,81 +0,0 @@ -# Miscellaneous -*.class -*.log -*.pyc -*.swp -.DS_Store -.atom/ -.buildlog/ -.history -.svn/ - -# IntelliJ related -*.iml -*.ipr -*.iws -.idea/ - -# The .vscode folder contains launch configuration and tasks you configure in -# VS Code which you may wish to be included in version control, so this line -# is commented out by default. -#.vscode/ - -# Flutter/Dart/Pub related -**/doc/api/ -.dart_tool/ -.flutter-plugins -.flutter-plugins-dependencies -.packages -.pub-cache/ -.pub/ -/build/ - -# Web related -lib/generated_plugin_registrant.dart - -# Android related -**/android/**/gradle-wrapper.jar -**/android/.gradle -**/android/captures/ -**/android/gradlew -**/android/gradlew.bat -**/android/local.properties -**/android/**/GeneratedPluginRegistrant.java - -# iOS/XCode related -**/ios/**/*.mode1v3 -**/ios/**/*.mode2v3 -**/ios/**/*.moved-aside -**/ios/**/*.pbxuser -**/ios/**/*.perspectivev3 -**/ios/**/*sync/ -**/ios/**/.sconsign.dblite -**/ios/**/.tags* -**/ios/**/.vagrant/ -**/ios/**/DerivedData/ -**/ios/**/Icon? -**/ios/**/Pods/ -**/ios/**/.symlinks/ -**/ios/**/profile -**/ios/**/xcuserdata -**/ios/.generated/ -**/ios/Flutter/App.framework -**/ios/Flutter/Flutter.framework -**/ios/Flutter/Generated.xcconfig -**/ios/Flutter/app.flx -**/ios/Flutter/app.zip -**/ios/Flutter/flutter_assets/ -**/ios/Flutter/flutter_export_environment.sh -**/ios/ServiceDefinitions.json -**/ios/Runner/GeneratedPluginRegistrant.* - -# Exceptions to above rules. -!**/ios/**/default.mode1v3 -!**/ios/**/default.mode2v3 -!**/ios/**/default.pbxuser -!**/ios/**/default.perspectivev3 -!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages - -# Firebase configuration files -ios/Runner/GoogleService-Info.plist -android/app/google-services.json \ No newline at end of file diff --git a/example/.metadata b/example/.metadata deleted file mode 100644 index 5d1241e..0000000 --- a/example/.metadata +++ /dev/null @@ -1,10 +0,0 @@ -# This file tracks properties of this Flutter project. -# Used by Flutter tool to assess capabilities and perform upgrades etc. -# -# This file should be version controlled and should not be manually edited. - -version: - revision: 9f5ff2306bb3e30b2b98eee79cd231b1336f41f4 - channel: stable - -project_type: app diff --git a/example/README.md b/example/README.md deleted file mode 100644 index 47eaf3f..0000000 --- a/example/README.md +++ /dev/null @@ -1,32 +0,0 @@ -# flutter_twilio_conversations_example - -Demonstrates how to use the `flutter_twilio_conversations` plugin. Includes: authorization by JWT-token, presenting the list of dialogs, showing the list of messages, sending texts & images, using local notifiations to notify about new messages. To setup push notifications use [Twilio's Official Setup Guide](https://www.twilio.com/docs/conversations/push-notification-configuration) - -## Supported platforms -* Android -* iOS - -## Prerequisites - -This example makes use of a backend, to setup a backend and make it reachable on the internet we decided -to use Firebase in this project. Therefore you need to do some setup steps to get this example up and -running. Also we are going to be using Twilio Conversations, which also needs some setup before -getting started. - -1. [Create a Twilio account](https://www.twilio.com/referral/j7GFTv) -2. [Create a Firebase account](https://firebase.google.com/) - -## Required plans on Twilio -Please note the following about costs and required plans on these accounts. On Twilio you will get $15 -on your Trial account. This should be enough to start testing Conversations. - -## Required plans on Firebase -On Firebase you will kick off in the [Spark plan](https://firebase.google.com/pricing). But you will need -to upgrade to the Blaze plan. Don't be scared for any costs, because: - -> The Spark plan allows outbound network requests only to Google-owned services. Inbound invocation requests are -> allowed within the quota. On the Blaze plan, Cloud Functions provides a perpetual free tier. The first 2,000,000 -> invocations, 400,000 GB-sec, 200,000 CPU-sec, and 5 GB of Internet egress traffic is provided for free each month. -> You are only charged on usage past this free allotment. Pricing is based on total number of invocations, and -> compute time. Compute time is variable based on the amount of memory and CPU provisioned for a function. Usage -> limits are also enforced through daily and 100s quotas. For more information, see [Cloud Functions Pricing](https://cloud.google.com/functions/pricing). \ No newline at end of file diff --git a/example/android/.gitignore b/example/android/.gitignore deleted file mode 100644 index bc2100d..0000000 --- a/example/android/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -gradle-wrapper.jar -/.gradle -/captures/ -/gradlew -/gradlew.bat -/local.properties -GeneratedPluginRegistrant.java diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle deleted file mode 100644 index 30d11d3..0000000 --- a/example/android/app/build.gradle +++ /dev/null @@ -1,70 +0,0 @@ -def localProperties = new Properties() -def localPropertiesFile = rootProject.file('local.properties') -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader('UTF-8') { reader -> - localProperties.load(reader) - } -} - -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') -if (flutterVersionCode == null) { - flutterVersionCode = '1' -} - -def flutterVersionName = localProperties.getProperty('flutter.versionName') -if (flutterVersionName == null) { - flutterVersionName = '1.0' -} - -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - -android { - compileSdkVersion 33 - - sourceSets { - main.java.srcDirs += 'src/main/kotlin' - } - - lintOptions { - disable 'InvalidPackage' - } - - defaultConfig { - applicationId "twilio.flutter.conversations_example" - minSdkVersion 21 - targetSdkVersion 33 - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - multiDexEnabled true - } - - buildTypes { - debug { - signingConfig signingConfigs.debug - } - - release { - signingConfig signingConfigs.debug - } - } -} - -flutter { - source '../..' -} - -dependencies { - implementation("androidx.multidex:multidex:2.0.1") - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - testImplementation 'junit:junit:4.12' - androidTestImplementation 'androidx.test:runner:1.1.1' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' -} diff --git a/example/android/app/src/debug/AndroidManifest.xml b/example/android/app/src/debug/AndroidManifest.xml deleted file mode 100644 index 8a0c9a2..0000000 --- a/example/android/app/src/debug/AndroidManifest.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml deleted file mode 100644 index ba9793a..0000000 --- a/example/android/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/example/android/app/src/main/kotlin/twilio/flutter/conversations_example/Application.kt b/example/android/app/src/main/kotlin/twilio/flutter/conversations_example/Application.kt deleted file mode 100644 index 549c266..0000000 --- a/example/android/app/src/main/kotlin/twilio/flutter/conversations_example/Application.kt +++ /dev/null @@ -1,18 +0,0 @@ -package twilio.flutter.conversations_example - -import com.dexterous.flutterlocalnotifications.FlutterLocalNotificationsPlugin -import io.flutter.app.FlutterApplication -import io.flutter.plugin.common.PluginRegistry -import io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback - -class Application : FlutterApplication(), PluginRegistrantCallback { - override fun onCreate() { - super.onCreate() - } - - // These plugins are registered here to allow for background messages to be received - // and notifications to be displayed outside of the lifecycle of the MainActivity - override fun registerWith(registry: PluginRegistry) { - FlutterLocalNotificationsPlugin.registerWith(registry?.registrarFor("com.dexterous.flutterlocalnotifications.FlutterLocalNotificationsPlugin")) - } -} diff --git a/example/android/app/src/main/kotlin/twilio/flutter/conversations_example/MainActivity.kt b/example/android/app/src/main/kotlin/twilio/flutter/conversations_example/MainActivity.kt deleted file mode 100644 index 23e7fc8..0000000 --- a/example/android/app/src/main/kotlin/twilio/flutter/conversations_example/MainActivity.kt +++ /dev/null @@ -1,12 +0,0 @@ -package twilio.flutter.conversations_example - -import androidx.annotation.NonNull -import io.flutter.embedding.android.FlutterActivity -import io.flutter.embedding.engine.FlutterEngine -import io.flutter.plugins.GeneratedPluginRegistrant - -class MainActivity : FlutterActivity() { - override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) { - GeneratedPluginRegistrant.registerWith(flutterEngine) - } -} diff --git a/example/android/app/src/main/res/drawable/launch_background.xml b/example/android/app/src/main/res/drawable/launch_background.xml deleted file mode 100644 index 304732f..0000000 --- a/example/android/app/src/main/res/drawable/launch_background.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index db77bb4..0000000 Binary files a/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index 17987b7..0000000 Binary files a/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index 09d4391..0000000 Binary files a/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index d5f1c8d..0000000 Binary files a/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index 4d6372e..0000000 Binary files a/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/example/android/app/src/main/res/values/styles.xml b/example/android/app/src/main/res/values/styles.xml deleted file mode 100644 index 00fa441..0000000 --- a/example/android/app/src/main/res/values/styles.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - diff --git a/example/android/app/src/profile/AndroidManifest.xml b/example/android/app/src/profile/AndroidManifest.xml deleted file mode 100644 index 8a0c9a2..0000000 --- a/example/android/app/src/profile/AndroidManifest.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - diff --git a/example/android/build.gradle b/example/android/build.gradle deleted file mode 100644 index abfde27..0000000 --- a/example/android/build.gradle +++ /dev/null @@ -1,31 +0,0 @@ -buildscript { - ext.kotlin_version = '1.8.0' - repositories { - google() - mavenCentral() - } - - dependencies { - classpath 'com.android.tools.build:gradle:7.4.2' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - } -} - -allprojects { - repositories { - google() - mavenCentral() - } -} - -rootProject.buildDir = '../build' -subprojects { - project.buildDir = "${rootProject.buildDir}/${project.name}" -} -subprojects { - project.evaluationDependsOn(':app') -} - -task clean(type: Delete) { - delete rootProject.buildDir -} diff --git a/example/android/gradle.properties b/example/android/gradle.properties deleted file mode 100644 index 38c8d45..0000000 --- a/example/android/gradle.properties +++ /dev/null @@ -1,4 +0,0 @@ -org.gradle.jvmargs=-Xmx1536M -android.enableR8=true -android.useAndroidX=true -android.enableJetifier=true diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/example/android/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 44ada35..0000000 --- a/example/android/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,6 +0,0 @@ -#Thu Jul 23 14:52:30 EDT 2020 -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip diff --git a/example/android/settings.gradle b/example/android/settings.gradle deleted file mode 100644 index 5a2f14f..0000000 --- a/example/android/settings.gradle +++ /dev/null @@ -1,15 +0,0 @@ -include ':app' - -def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() - -def plugins = new Properties() -def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') -if (pluginsFile.exists()) { - pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } -} - -plugins.each { name, path -> - def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() - include ":$name" - project(":$name").projectDir = pluginDirectory -} diff --git a/example/android/settings_aar.gradle b/example/android/settings_aar.gradle deleted file mode 100644 index e7b4def..0000000 --- a/example/android/settings_aar.gradle +++ /dev/null @@ -1 +0,0 @@ -include ':app' diff --git a/example/ios/.gitignore b/example/ios/.gitignore deleted file mode 100644 index e96ef60..0000000 --- a/example/ios/.gitignore +++ /dev/null @@ -1,32 +0,0 @@ -*.mode1v3 -*.mode2v3 -*.moved-aside -*.pbxuser -*.perspectivev3 -**/*sync/ -.sconsign.dblite -.tags* -**/.vagrant/ -**/DerivedData/ -Icon? -**/Pods/ -**/.symlinks/ -profile -xcuserdata -**/.generated/ -Flutter/App.framework -Flutter/Flutter.framework -Flutter/Flutter.podspec -Flutter/Generated.xcconfig -Flutter/app.flx -Flutter/app.zip -Flutter/flutter_assets/ -Flutter/flutter_export_environment.sh -ServiceDefinitions.json -Runner/GeneratedPluginRegistrant.* - -# Exceptions to above rules. -!default.mode1v3 -!default.mode2v3 -!default.pbxuser -!default.perspectivev3 diff --git a/example/ios/.swiftlint.yml b/example/ios/.swiftlint.yml deleted file mode 100644 index 0176767..0000000 --- a/example/ios/.swiftlint.yml +++ /dev/null @@ -1,20 +0,0 @@ -# See https://realm.github.io/SwiftLint/rule-directory.html for more information - -line_length: 240 - -identifier_name: - min_length: 2 - -type_name: - max_length: 50 - -cyclomatic_complexity: - ignores_case_statements: true - -opt_in_rules: - - vertical_whitespace_opening_braces - - vertical_whitespace_closing_braces - - yoda_condition - -disabled_rules: - - switch_case_alignment \ No newline at end of file diff --git a/example/ios/Flutter/AppFrameworkInfo.plist b/example/ios/Flutter/AppFrameworkInfo.plist deleted file mode 100644 index c5ff5d3..0000000 --- a/example/ios/Flutter/AppFrameworkInfo.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - App - CFBundleIdentifier - io.flutter.flutter.app - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - App - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - MinimumOSVersion - 13.0 - - diff --git a/example/ios/Flutter/Debug.xcconfig b/example/ios/Flutter/Debug.xcconfig deleted file mode 100644 index e8efba1..0000000 --- a/example/ios/Flutter/Debug.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" -#include "Generated.xcconfig" diff --git a/example/ios/Flutter/Release.xcconfig b/example/ios/Flutter/Release.xcconfig deleted file mode 100644 index 399e934..0000000 --- a/example/ios/Flutter/Release.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" -#include "Generated.xcconfig" diff --git a/example/ios/Podfile b/example/ios/Podfile deleted file mode 100644 index 9dc0dcf..0000000 --- a/example/ios/Podfile +++ /dev/null @@ -1,98 +0,0 @@ -# Uncomment this line to define a global platform for your project -platform :ios, '13.0' - -# CocoaPods analytics sends network stats synchronously affecting flutter build latency. -ENV['COCOAPODS_DISABLE_STATS'] = 'true' - -project 'Runner', { - 'Debug' => :debug, - 'Profile' => :release, - 'Release' => :release, -} - -def flutter_root - generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) - unless File.exist?(generated_xcode_build_settings_path) - raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" - end - - File.foreach(generated_xcode_build_settings_path) do |line| - matches = line.match(/FLUTTER_ROOT\=(.*)/) - return matches[1].strip if matches - end - raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" -end - -require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) - -flutter_ios_podfile_setup - -target 'Runner' do - use_frameworks! - use_modular_headers! - - flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) -end - -post_install do |installer| - installer.pods_project.targets.each do |target| - flutter_additional_ios_build_settings(target) - target.build_configurations.each do |config| - # Here are some configurations automatically generated by flutter - - # You can enable the permissions needed here. For example to enable camera - # permission, just remove the `#` character in front so it looks like this: - # - # ## dart: PermissionGroup.camera - # 'PERMISSION_CAMERA=1' - # - # Preprocessor definitions can be found in: https://github.com/Baseflow/flutter-permission-handler/blob/master/permission_handler/ios/Classes/PermissionHandlerEnums.h - config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [ - '$(inherited)', - - ## dart: PermissionGroup.calendar - # 'PERMISSION_EVENTS=1', - - ## dart: PermissionGroup.reminders - # 'PERMISSION_REMINDERS=1', - - ## dart: PermissionGroup.contacts - # 'PERMISSION_CONTACTS=1', - - ## dart: PermissionGroup.camera - # 'PERMISSION_CAMERA=1', - - ## dart: PermissionGroup.microphone - # 'PERMISSION_MICROPHONE=1', - - ## dart: PermissionGroup.speech - # 'PERMISSION_SPEECH_RECOGNIZER=1', - - # dart: PermissionGroup.photos - 'PERMISSION_PHOTOS=1', - - ## dart: [PermissionGroup.location, PermissionGroup.locationAlways, PermissionGroup.locationWhenInUse] - # 'PERMISSION_LOCATION=1', - - ## dart: PermissionGroup.notification - # 'PERMISSION_NOTIFICATIONS=1', - - ## dart: PermissionGroup.mediaLibrary - # 'PERMISSION_MEDIA_LIBRARY=1', - - ## dart: PermissionGroup.sensors - # 'PERMISSION_SENSORS=1', - - ## dart: PermissionGroup.bluetooth - # 'PERMISSION_BLUETOOTH=1', - - ## dart: PermissionGroup.appTrackingTransparency - # 'PERMISSION_APP_TRACKING_TRANSPARENCY=1', - - ## dart: PermissionGroup.criticalAlerts - # 'PERMISSION_CRITICAL_ALERTS=1' - ] - - end - end -end diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock deleted file mode 100644 index 560baf2..0000000 --- a/example/ios/Podfile.lock +++ /dev/null @@ -1,93 +0,0 @@ -PODS: - - device_info_plus (0.0.1): - - Flutter - - Flutter (1.0.0) - - flutter_local_notifications (0.0.1): - - Flutter - - flutter_twilio_conversations (0.0.1): - - Flutter - - TwilioConversationsClient (~> 3.1.0) - - fluttertoast (0.0.2): - - Flutter - - Toast - - FMDB (2.7.5): - - FMDB/standard (= 2.7.5) - - FMDB/standard (2.7.5) - - image_picker_ios (0.0.1): - - Flutter - - path_provider_ios (0.0.1): - - Flutter - - "permission_handler (5.1.0+2)": - - Flutter - - sqflite (0.0.2): - - Flutter - - FMDB (>= 2.7.5) - - Toast (4.0.0) - - TwilioCommonLib (2.0.0) - - TwilioConversationsClient (3.1.0): - - TwilioTwilsockLib (= 2.0.0) - - TwilioStateMachine (2.0.0) - - TwilioTwilsockLib (2.0.0): - - TwilioCommonLib (= 2.0.0) - - TwilioStateMachine (= 2.0.0) - -DEPENDENCIES: - - device_info_plus (from `.symlinks/plugins/device_info_plus/ios`) - - Flutter (from `Flutter`) - - flutter_local_notifications (from `.symlinks/plugins/flutter_local_notifications/ios`) - - flutter_twilio_conversations (from `.symlinks/plugins/flutter_twilio_conversations/ios`) - - fluttertoast (from `.symlinks/plugins/fluttertoast/ios`) - - image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`) - - path_provider_ios (from `.symlinks/plugins/path_provider_ios/ios`) - - permission_handler (from `.symlinks/plugins/permission_handler/ios`) - - sqflite (from `.symlinks/plugins/sqflite/ios`) - -SPEC REPOS: - trunk: - - FMDB - - Toast - - TwilioCommonLib - - TwilioConversationsClient - - TwilioStateMachine - - TwilioTwilsockLib - -EXTERNAL SOURCES: - device_info_plus: - :path: ".symlinks/plugins/device_info_plus/ios" - Flutter: - :path: Flutter - flutter_local_notifications: - :path: ".symlinks/plugins/flutter_local_notifications/ios" - flutter_twilio_conversations: - :path: ".symlinks/plugins/flutter_twilio_conversations/ios" - fluttertoast: - :path: ".symlinks/plugins/fluttertoast/ios" - image_picker_ios: - :path: ".symlinks/plugins/image_picker_ios/ios" - path_provider_ios: - :path: ".symlinks/plugins/path_provider_ios/ios" - permission_handler: - :path: ".symlinks/plugins/permission_handler/ios" - sqflite: - :path: ".symlinks/plugins/sqflite/ios" - -SPEC CHECKSUMS: - device_info_plus: e5c5da33f982a436e103237c0c85f9031142abed - Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 - flutter_local_notifications: 0c0b1ae97e741e1521e4c1629a459d04b9aec743 - flutter_twilio_conversations: 89f406e50f0dfa3bb6848926b724045bc5eae097 - fluttertoast: 16fbe6039d06a763f3533670197d01fc73459037 - FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a - image_picker_ios: b786a5dcf033a8336a657191401bfdf12017dabb - path_provider_ios: 14f3d2fd28c4fdb42f44e0f751d12861c43cee02 - permission_handler: ccb20a9fad0ee9b1314a52b70b76b473c5f8dab0 - sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904 - Toast: 91b396c56ee72a5790816f40d3a94dd357abc196 - TwilioCommonLib: 2e02cbe30a66ab1da37be9550ea144ec3589cebd - TwilioConversationsClient: 8bf5deae1856a3eb7eb300357054fe1552e5494b - TwilioStateMachine: d94358d9ceec243aa12fd4160048c40ce4afc172 - TwilioTwilsockLib: 06086e8e9fb45fb41a2311b83f9e059c6a70b09b - -PODFILE CHECKSUM: 1b645128cb8540ffbdbe1df107e873dd4abfccbd - -COCOAPODS: 1.12.1 diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj deleted file mode 100644 index 2da892d..0000000 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ /dev/null @@ -1,626 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 50; - objects = { - -/* Begin PBXBuildFile section */ - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 68FCF8DE491B31258EA7B6D7 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2B012B3D00986278F75678B7 /* Pods_Runner.framework */; }; - 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 9705A1C41CF9048500538489 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 2B012B3D00986278F75678B7 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 5C8F5680D946D7DC5160EF2A /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; - 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; - 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 885BAC8B24F69BD3008515FB /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = ""; }; - 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; - 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; - 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - D511500447B626AB7AADD243 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; - D977B1A6C4EB7698AF5A0DF8 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 97C146EB1CF9000F007C117D /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 68FCF8DE491B31258EA7B6D7 /* Pods_Runner.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 74AEA4BEBBA7265306F0288F /* Frameworks */ = { - isa = PBXGroup; - children = ( - 2B012B3D00986278F75678B7 /* Pods_Runner.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - 788528B8F8E11198716F1430 /* Pods */ = { - isa = PBXGroup; - children = ( - D511500447B626AB7AADD243 /* Pods-Runner.debug.xcconfig */, - D977B1A6C4EB7698AF5A0DF8 /* Pods-Runner.release.xcconfig */, - 5C8F5680D946D7DC5160EF2A /* Pods-Runner.profile.xcconfig */, - ); - path = Pods; - sourceTree = ""; - }; - 9740EEB11CF90186004384FC /* Flutter */ = { - isa = PBXGroup; - children = ( - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, - 9740EEB21CF90195004384FC /* Debug.xcconfig */, - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, - 9740EEB31CF90195004384FC /* Generated.xcconfig */, - ); - name = Flutter; - sourceTree = ""; - }; - 97C146E51CF9000F007C117D = { - isa = PBXGroup; - children = ( - 9740EEB11CF90186004384FC /* Flutter */, - 97C146F01CF9000F007C117D /* Runner */, - 97C146EF1CF9000F007C117D /* Products */, - 788528B8F8E11198716F1430 /* Pods */, - 74AEA4BEBBA7265306F0288F /* Frameworks */, - ); - sourceTree = ""; - }; - 97C146EF1CF9000F007C117D /* Products */ = { - isa = PBXGroup; - children = ( - 97C146EE1CF9000F007C117D /* Runner.app */, - ); - name = Products; - sourceTree = ""; - }; - 97C146F01CF9000F007C117D /* Runner */ = { - isa = PBXGroup; - children = ( - 885BAC8B24F69BD3008515FB /* Runner.entitlements */, - 97C146FA1CF9000F007C117D /* Main.storyboard */, - 97C146FD1CF9000F007C117D /* Assets.xcassets */, - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, - 97C147021CF9000F007C117D /* Info.plist */, - 97C146F11CF9000F007C117D /* Supporting Files */, - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, - 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, - 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, - ); - path = Runner; - sourceTree = ""; - }; - 97C146F11CF9000F007C117D /* Supporting Files */ = { - isa = PBXGroup; - children = ( - ); - name = "Supporting Files"; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 97C146ED1CF9000F007C117D /* Runner */ = { - isa = PBXNativeTarget; - buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; - buildPhases = ( - 04E59317418BE94D37059CBC /* [CP] Check Pods Manifest.lock */, - 9740EEB61CF901F6004384FC /* Run Script */, - 97C146EA1CF9000F007C117D /* Sources */, - 97C146EB1CF9000F007C117D /* Frameworks */, - 97C146EC1CF9000F007C117D /* Resources */, - 9705A1C41CF9048500538489 /* Embed Frameworks */, - 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - 7E6C82222A42B85B0A026A71 /* [CP] Embed Pods Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Runner; - productName = Runner; - productReference = 97C146EE1CF9000F007C117D /* Runner.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 97C146E61CF9000F007C117D /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 1300; - ORGANIZATIONNAME = "The Chromium Authors"; - TargetAttributes = { - 97C146ED1CF9000F007C117D = { - CreatedOnToolsVersion = 7.3.1; - DevelopmentTeam = 5WQXUJ2H76; - LastSwiftMigration = 1100; - ProvisioningStyle = Manual; - }; - }; - }; - buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 97C146E51CF9000F007C117D; - productRefGroup = 97C146EF1CF9000F007C117D /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 97C146ED1CF9000F007C117D /* Runner */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 97C146EC1CF9000F007C117D /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 04E59317418BE94D37059CBC /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Thin Binary"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; - }; - 7E6C82222A42B85B0A026A71 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", - "${BUILT_PRODUCTS_DIR}/FMDB/FMDB.framework", - "${BUILT_PRODUCTS_DIR}/Toast/Toast.framework", - "${BUILT_PRODUCTS_DIR}/device_info_plus/device_info_plus.framework", - "${BUILT_PRODUCTS_DIR}/flutter_local_notifications/flutter_local_notifications.framework", - "${BUILT_PRODUCTS_DIR}/flutter_twilio_conversations/flutter_twilio_conversations.framework", - "${BUILT_PRODUCTS_DIR}/fluttertoast/fluttertoast.framework", - "${BUILT_PRODUCTS_DIR}/image_picker_ios/image_picker_ios.framework", - "${BUILT_PRODUCTS_DIR}/path_provider_ios/path_provider_ios.framework", - "${BUILT_PRODUCTS_DIR}/sqflite/sqflite.framework", - "${PODS_XCFRAMEWORKS_BUILD_DIR}/TwilioCommonLib/TwilioCommonLib.framework/TwilioCommonLib", - "${PODS_XCFRAMEWORKS_BUILD_DIR}/TwilioConversationsClient/TwilioConversationsClient.framework/TwilioConversationsClient", - "${PODS_XCFRAMEWORKS_BUILD_DIR}/TwilioStateMachine/TwilioStateMachine.framework/TwilioStateMachine", - "${PODS_XCFRAMEWORKS_BUILD_DIR}/TwilioTwilsockLib/TwilioTwilsockLib.framework/TwilioTwilsockLib", - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FMDB.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Toast.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/device_info_plus.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_local_notifications.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_twilio_conversations.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/fluttertoast.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/image_picker_ios.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider_ios.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/sqflite.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/TwilioCommonLib.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/TwilioConversationsClient.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/TwilioStateMachine.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/TwilioTwilsockLib.framework", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 9740EEB61CF901F6004384FC /* Run Script */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Run Script"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 97C146EA1CF9000F007C117D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 97C146FA1CF9000F007C117D /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C146FB1CF9000F007C117D /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C147001CF9000F007C117D /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 249021D3217E4FDB00AE95B9 /* Profile */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Profile; - }; - 249021D4217E4FDB00AE95B9 /* Profile */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CODE_SIGN_IDENTITY = "iPhone Developer"; - CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = 5WQXUJ2H76; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = twilio.flutter.twilioConversationsExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = "Twilio Programmable Chat Example Profile 0.0.1"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Profile; - }; - 97C147031CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 97C147041CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 97C147061CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CODE_SIGN_IDENTITY = "iPhone Developer"; - CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = 5WQXUJ2H76; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = twilio.flutter.twilioConversationsExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = "Twilio Programmable Chat Example Profile 0.0.1"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Debug; - }; - 97C147071CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CODE_SIGN_IDENTITY = "iPhone Developer"; - CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = 5WQXUJ2H76; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = twilio.flutter.twilioConversationsExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = "Twilio Programmable Chat Example Profile 0.0.1"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147031CF9000F007C117D /* Debug */, - 97C147041CF9000F007C117D /* Release */, - 249021D3217E4FDB00AE95B9 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147061CF9000F007C117D /* Debug */, - 97C147071CF9000F007C117D /* Release */, - 249021D4217E4FDB00AE95B9 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 97C146E61CF9000F007C117D /* Project object */; -} diff --git a/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a..0000000 --- a/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d9810..0000000 --- a/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme deleted file mode 100644 index 3db53b6..0000000 --- a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/example/ios/Runner.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 21a3cc1..0000000 --- a/example/ios/Runner.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d9810..0000000 --- a/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/example/ios/Runner/AppDelegate.swift b/example/ios/Runner/AppDelegate.swift deleted file mode 100644 index 70693e4..0000000 --- a/example/ios/Runner/AppDelegate.swift +++ /dev/null @@ -1,13 +0,0 @@ -import UIKit -import Flutter - -@UIApplicationMain -@objc class AppDelegate: FlutterAppDelegate { - override func application( - _ application: UIApplication, - didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? - ) -> Bool { - GeneratedPluginRegistrant.register(with: self) - return super.application(application, didFinishLaunchingWithOptions: launchOptions) - } -} diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index d36b1fa..0000000 --- a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "images" : [ - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@3x.png", - "scale" : "3x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@3x.png", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@3x.png", - "scale" : "3x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@3x.png", - "scale" : "3x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@1x.png", - "scale" : "1x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@1x.png", - "scale" : "1x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@1x.png", - "scale" : "1x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@2x.png", - "scale" : "2x" - }, - { - "size" : "83.5x83.5", - "idiom" : "ipad", - "filename" : "Icon-App-83.5x83.5@2x.png", - "scale" : "2x" - }, - { - "size" : "1024x1024", - "idiom" : "ios-marketing", - "filename" : "Icon-App-1024x1024@1x.png", - "scale" : "1x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png deleted file mode 100644 index dc9ada4..0000000 Binary files a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png and /dev/null differ diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png deleted file mode 100644 index 28c6bf0..0000000 Binary files a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and /dev/null differ diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png deleted file mode 100644 index 2ccbfd9..0000000 Binary files a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and /dev/null differ diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png deleted file mode 100644 index f091b6b..0000000 Binary files a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and /dev/null differ diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png deleted file mode 100644 index 4cde121..0000000 Binary files a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and /dev/null differ diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png deleted file mode 100644 index d0ef06e..0000000 Binary files a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and /dev/null differ diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png deleted file mode 100644 index dcdc230..0000000 Binary files a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and /dev/null differ diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png deleted file mode 100644 index 2ccbfd9..0000000 Binary files a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and /dev/null differ diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png deleted file mode 100644 index c8f9ed8..0000000 Binary files a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and /dev/null differ diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png deleted file mode 100644 index a6d6b86..0000000 Binary files a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and /dev/null differ diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png deleted file mode 100644 index a6d6b86..0000000 Binary files a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and /dev/null differ diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png deleted file mode 100644 index 75b2d16..0000000 Binary files a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and /dev/null differ diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png deleted file mode 100644 index c4df70d..0000000 Binary files a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and /dev/null differ diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png deleted file mode 100644 index 6a84f41..0000000 Binary files a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and /dev/null differ diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png deleted file mode 100644 index d0e1f58..0000000 Binary files a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and /dev/null differ diff --git a/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json deleted file mode 100644 index 0bedcf2..0000000 --- a/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "LaunchImage.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "LaunchImage@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "LaunchImage@3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png deleted file mode 100644 index 9da19ea..0000000 Binary files a/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png and /dev/null differ diff --git a/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png deleted file mode 100644 index 9da19ea..0000000 Binary files a/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png and /dev/null differ diff --git a/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png deleted file mode 100644 index 9da19ea..0000000 Binary files a/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png and /dev/null differ diff --git a/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md deleted file mode 100644 index 89c2725..0000000 --- a/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Launch Screen Assets - -You can customize the launch screen with your own desired assets by replacing the image files in this directory. - -You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/example/ios/Runner/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index f2e259c..0000000 --- a/example/ios/Runner/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/example/ios/Runner/Base.lproj/Main.storyboard b/example/ios/Runner/Base.lproj/Main.storyboard deleted file mode 100644 index f3c2851..0000000 --- a/example/ios/Runner/Base.lproj/Main.storyboard +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/example/ios/Runner/Info.plist b/example/ios/Runner/Info.plist deleted file mode 100644 index 2d01705..0000000 --- a/example/ios/Runner/Info.plist +++ /dev/null @@ -1,56 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleDisplayName - TwilioConversations - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - twilio.flutter.twilioConversationsExample - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - twilio_conversations_example - CFBundlePackageType - APPL - CFBundleShortVersionString - $(FLUTTER_BUILD_NAME) - CFBundleSignature - ???? - CFBundleVersion - $(FLUTTER_BUILD_NUMBER) - LSRequiresIPhoneOS - - NSPhotoLibraryUsageDescription - Access your gallery so you can send pictures - UIBackgroundModes - - fetch - remote-notification - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UIViewControllerBasedStatusBarAppearance - - CADisableMinimumFrameDurationOnPhone - - - diff --git a/example/ios/Runner/Runner-Bridging-Header.h b/example/ios/Runner/Runner-Bridging-Header.h deleted file mode 100644 index 7335fdf..0000000 --- a/example/ios/Runner/Runner-Bridging-Header.h +++ /dev/null @@ -1 +0,0 @@ -#import "GeneratedPluginRegistrant.h" \ No newline at end of file diff --git a/example/ios/Runner/Runner.entitlements b/example/ios/Runner/Runner.entitlements deleted file mode 100644 index 903def2..0000000 --- a/example/ios/Runner/Runner.entitlements +++ /dev/null @@ -1,8 +0,0 @@ - - - - - aps-environment - development - - diff --git a/example/lib/app.dart b/example/lib/app.dart deleted file mode 100644 index e9b0aa8..0000000 --- a/example/lib/app.dart +++ /dev/null @@ -1,41 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_redux/flutter_redux.dart'; -import 'package:redux/redux.dart'; -import 'package:flutter_twilio_conversations_example/pages/home_page.dart'; -import 'package:flutter_twilio_conversations_example/redux/states/app_state.dart'; - -class App extends StatefulWidget { - final Store store; - - const App({Key? key, required this.store}) : super(key: key); - - @override - State createState() => _State(); -} - -class _State extends State { - @override - Widget build(BuildContext context) => StoreProvider( - store: widget.store, - child: MaterialApp( - title: 'Twilio Conversations', - theme: ThemeData( - primarySwatch: Colors.blue, - appBarTheme: AppBarTheme( - color: Colors.blue, - toolbarTextStyle: TextStyle( - fontSize: 20, - fontWeight: FontWeight.w500, - color: Colors.white, - ), - titleTextStyle: TextStyle( - fontSize: 20, - fontWeight: FontWeight.w500, - color: Colors.white, - ), - ), - ), - home: HomePage(), - ), - ); -} diff --git a/example/lib/main.dart b/example/lib/main.dart deleted file mode 100644 index bd6c327..0000000 --- a/example/lib/main.dart +++ /dev/null @@ -1,33 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; -import 'package:redux/redux.dart'; -import 'package:flutter_twilio_conversations_example/app.dart'; -import 'package:flutter_twilio_conversations_example/redux/effects/subscriptions_middleware.dart'; -import 'package:flutter_twilio_conversations_example/redux/effects/twilio_middleware.dart'; -import 'package:flutter_twilio_conversations_example/redux/effects/ui_middleware.dart'; -import 'package:flutter_twilio_conversations_example/redux/reducers/app_reducer.dart'; -import 'package:flutter_twilio_conversations_example/redux/states/app_state.dart'; - -void main() { - WidgetsFlutterBinding.ensureInitialized(); - SystemChrome.setPreferredOrientations( - [ - DeviceOrientation.portraitUp, - ], - ); - final store = Store( - AppReducer(), - initialState: AppState.initial(), - middleware: [ - UiMiddleware(), - TwilioMiddleware(), - MessengerSubscriptionsMiddleware(), - ], - ); - - runApp( - App( - store: store, - ), - ); -} diff --git a/example/lib/pages/dialog_page.dart b/example/lib/pages/dialog_page.dart deleted file mode 100644 index dab49fb..0000000 --- a/example/lib/pages/dialog_page.dart +++ /dev/null @@ -1,93 +0,0 @@ -import 'package:equatable/equatable.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_redux/flutter_redux.dart'; -import 'package:redux/redux.dart'; -import 'package:flutter_twilio_conversations/flutter_twilio_conversations.dart'; -import 'package:flutter_twilio_conversations_example/redux/actions/ui_actions.dart'; -import 'package:flutter_twilio_conversations_example/redux/states/app_state.dart'; -import 'package:flutter_twilio_conversations_example/widgets/conversation_dialog.dart'; -import 'package:flutter_twilio_conversations_example/widgets/message_item.dart'; -import 'package:flutter_twilio_conversations_example/widgets/send_bar.dart'; - -class DialogPage extends StatefulWidget { - const DialogPage({Key? key}) : super(key: key); - - @override - _DialogPageState createState() => _DialogPageState(); -} - -class _DialogPageState extends State { - @override - Widget build(BuildContext context) { - return StoreConnector( - distinct: true, - converter: (store) => _ViewModel(store), - builder: (context, viewModel) => Scaffold( - backgroundColor: Colors.white, - appBar: AppBar( - title: Text( - viewModel.dialog?.typingMessage() ?? 'Dialog', - ), - leading: InkWell( - child: Icon(Icons.arrow_back), - onTap: () => viewModel.closeDialog(), - ), - automaticallyImplyLeading: false, - ), - body: viewModel.messages.isEmpty - ? viewModel.dialog != null - ? Center( - child: Text('Empty dialog'), - ) - : Container() - : GestureDetector( - child: ListView.separated( - itemBuilder: (context, index) => MessageItem( - viewModel.messages[index], - key: ValueKey( - viewModel.messages[index].sid, - ), - ), - separatorBuilder: (context, index) => Container( - height: 26, - ), - itemCount: viewModel.messages.length, - padding: const EdgeInsets.symmetric( - vertical: 16, - horizontal: 10, - ), - reverse: true, - shrinkWrap: true, - ), - onTap: () => FocusScope.of(context).unfocus(), - ), - bottomNavigationBar: const SendBar(), - ), - ); - } -} - -class _ViewModel with EquatableMixin { - final Store _store; - final ConversationDialog? dialog; - final List messages; - - _ViewModel(this._store) - : dialog = _store.state.selectedDialog, - messages = - _store.state.selectedDialog?.messages.reversed.toList() ?? []; - - void markDialogRead() { - if (dialog != null) { - // TODO mark dialog read when opening? - } - } - - void closeDialog() => _store.dispatch(CloseConversationAction()); - - @override - List get props => [ - dialog, - messages, - ]; -} diff --git a/example/lib/pages/home_page.dart b/example/lib/pages/home_page.dart deleted file mode 100644 index 825126f..0000000 --- a/example/lib/pages/home_page.dart +++ /dev/null @@ -1,54 +0,0 @@ -import 'package:equatable/equatable.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_redux/flutter_redux.dart'; -import 'package:redux/redux.dart'; -import 'package:flutter_twilio_conversations_example/pages/router_delegate.dart'; -import 'package:flutter_twilio_conversations_example/redux/states/app_state.dart'; -import 'package:flutter_twilio_conversations/flutter_twilio_conversations.dart'; -import 'package:flutter_twilio_conversations_example/widgets/conversation_dialog.dart'; - -class HomePage extends StatefulWidget { - @override - State createState() => _HomePageState(); -} - -class _HomePageState extends State { - @override - Widget build(BuildContext context) { - return StoreConnector( - distinct: true, - converter: (store) => _ViewModel(store), - builder: (context, viewModel) => Scaffold( - backgroundColor: Colors.white, - body: SafeArea( - top: false, - child: Router( - routerDelegate: AppRouterDelegate( - StoreProvider.of(context), - ), - ), - ), - ), - ); - } -} - -class _ViewModel with EquatableMixin { - final String? twilioToken; - final ChatClient? chatClient; - final List dialogs; - - final bool showAuthScreen; - - _ViewModel(Store _store) - : twilioToken = _store.state.twilioToken, - chatClient = _store.state.chatClient, - dialogs = _store.state.dialogs, - showAuthScreen = _store.state.chatClient == null && - !_store.state.isTwilioInitializing; - - @override - List get props => [ - dialogs, - ]; -} diff --git a/example/lib/pages/router_delegate.dart b/example/lib/pages/router_delegate.dart deleted file mode 100644 index 3f6dbde..0000000 --- a/example/lib/pages/router_delegate.dart +++ /dev/null @@ -1,48 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_redux/flutter_redux.dart'; -import 'package:redux/redux.dart'; -import 'package:flutter_twilio_conversations_example/pages/dialog_page.dart'; -import 'package:flutter_twilio_conversations_example/redux/states/app_state.dart'; -import 'package:flutter_twilio_conversations_example/redux/states/navigation_state.dart'; -import 'package:flutter_twilio_conversations_example/widgets/auth_widget.dart'; -import 'package:flutter_twilio_conversations_example/widgets/dialogs_list.dart'; - -class AppRouterDelegate extends RouterDelegate - with ChangeNotifier, PopNavigatorRouterDelegateMixin { - @override - final GlobalKey navigatorKey; - final Store _store; - - AppRouterDelegate(this._store) : navigatorKey = GlobalKey(); - - @override - Widget build(BuildContext context) { - return StoreConnector( - distinct: true, - converter: (store) => _store.state.navigationState, - onDidChange: (viewModel, oldViewModel) => notifyListeners(), - builder: (context, viewModel) => Navigator( - onPopPage: (route, dynamic result) { - return true; - }, - pages: [ - if (!viewModel.isAuthorized) - MaterialPage( - child: AuthWidget(), - ), - if (viewModel.isAuthorized) - MaterialPage( - child: DialogsList(), - ), - if (viewModel.isDialogOpened) - const MaterialPage( - child: DialogPage(), - ), - ], - ), - ); - } - - @override - Future setNewRoutePath(NavigationState navigationState) async {} -} diff --git a/example/lib/redux/actions/channel_actions.dart b/example/lib/redux/actions/channel_actions.dart deleted file mode 100644 index 027d62b..0000000 --- a/example/lib/redux/actions/channel_actions.dart +++ /dev/null @@ -1,13 +0,0 @@ -import 'package:flutter_twilio_conversations/flutter_twilio_conversations.dart'; - -class TypingStarted { - final TypingEvent event; - - TypingStarted(this.event); -} - -class TypingEnded { - final TypingEvent event; - - TypingEnded(this.event); -} diff --git a/example/lib/redux/actions/init_actions.dart b/example/lib/redux/actions/init_actions.dart deleted file mode 100644 index 99fecbd..0000000 --- a/example/lib/redux/actions/init_actions.dart +++ /dev/null @@ -1,43 +0,0 @@ -import 'package:flutter_twilio_conversations/flutter_twilio_conversations.dart'; -import 'package:flutter_twilio_conversations_example/widgets/conversation_dialog.dart'; - -class UpdateTokenAction { - final String token; - - UpdateTokenAction(this.token); -} - -class InitializeAction { - final String token; - - InitializeAction(this.token); -} - -class UpdateChatClient { - final ChatClient chatClient; - - UpdateChatClient(this.chatClient); -} - -class SubscribeToChatClientSyncAction {} - -class SubscribeToConversationsUpdatesAction {} - -class SubscribeToMembersTypingStatus { - final Channel channel; - - SubscribeToMembersTypingStatus(this.channel); -} - -class UpdateIndicatorsAction { - final bool? isTwilioInitializing; - final bool? isClientSyncing; - - UpdateIndicatorsAction({this.isTwilioInitializing, this.isClientSyncing}); -} - -class UpdateDialogsAction { - final List dialogs; - - UpdateDialogsAction(this.dialogs); -} diff --git a/example/lib/redux/actions/messages_actions.dart b/example/lib/redux/actions/messages_actions.dart deleted file mode 100644 index e589cbf..0000000 --- a/example/lib/redux/actions/messages_actions.dart +++ /dev/null @@ -1,29 +0,0 @@ -import 'dart:io'; - -import 'package:flutter_twilio_conversations/flutter_twilio_conversations.dart'; - -class GetConversationMessagesAction { - final Channel channel; - - GetConversationMessagesAction(this.channel); -} - -class UpdateChatMessagesAction { - final List messages; - - UpdateChatMessagesAction(this.messages); -} - -class SendTextMessageAction { - final Channel channel; - final String text; - - SendTextMessageAction(this.channel, this.text); -} - -class SendImageAction { - final Channel channel; - final File image; - - SendImageAction(this.channel, this.image); -} diff --git a/example/lib/redux/actions/ui_actions.dart b/example/lib/redux/actions/ui_actions.dart deleted file mode 100644 index ad91927..0000000 --- a/example/lib/redux/actions/ui_actions.dart +++ /dev/null @@ -1,22 +0,0 @@ -import 'package:flutter_twilio_conversations_example/widgets/conversation_dialog.dart'; - -class ShowToastAction { - final String text; - - ShowToastAction(this.text); -} - -class OpenConversationAction { - final ConversationDialog dialog; - - OpenConversationAction(this.dialog); -} - -class CloseConversationAction {} - -class ShowLocalNotification { - final String title; - final String text; - - ShowLocalNotification(this.title, this.text); -} diff --git a/example/lib/redux/effects/subscriptions_middleware.dart b/example/lib/redux/effects/subscriptions_middleware.dart deleted file mode 100644 index 76e2263..0000000 --- a/example/lib/redux/effects/subscriptions_middleware.dart +++ /dev/null @@ -1,143 +0,0 @@ -import 'dart:io'; - -import 'package:redux/redux.dart'; -import 'package:flutter_twilio_conversations_example/redux/actions/channel_actions.dart'; -import 'package:flutter_twilio_conversations_example/redux/actions/init_actions.dart'; -import 'package:flutter_twilio_conversations_example/redux/actions/messages_actions.dart'; -import 'package:flutter_twilio_conversations_example/redux/actions/ui_actions.dart'; -import 'package:flutter_twilio_conversations_example/redux/states/app_state.dart'; -import 'package:flutter_twilio_conversations/flutter_twilio_conversations.dart'; -import 'package:flutter_twilio_conversations_example/widgets/conversation_dialog.dart'; - -class MessengerSubscriptionsMiddleware extends MiddlewareClass { - @override - void call(Store store, action, NextDispatcher next) { - if (action is SubscribeToChatClientSyncAction) { - handleChatSyncSubscription(store, action); - } else if (action is GetConversationMessagesAction) { - getConversationMessages(store, action); - } else if (action is SubscribeToConversationsUpdatesAction) { - handleNewMessagesSubscription(store, action); - } else if (action is SubscribeToMembersTypingStatus) { - handleTypingStatusSubscription(store, action); - } - - next(action); - } - - void handleChatSyncSubscription( - Store store, - SubscribeToChatClientSyncAction action, - ) { - if (store.state.chatClient != null) { - store.state.chatClient?.onClientSynchronization?.listen((event) async { - print('Client synchronized'); - // in Android there is a separate event to identify when fully initialized - // in iOS we do check manually - if (event == ChatClientSynchronizationStatus.CONVERSATIONS_COMPLETED || - (event == ChatClientSynchronizationStatus.COMPLETED && - store.state.chatClient?.channels != null && - Platform.isIOS)) { - final dialogs = store.state.chatClient!.channels!.subscribedChannels - .map( - (channel) => - ConversationDialog(channel: channel, name: channel.sid), - ) - .toList(); - - store.dispatch( - UpdateDialogsAction( - dialogs, - ), - ); - - for (var conversation - in store.state.chatClient!.channels!.subscribedChannels) { - store.dispatch(GetConversationMessagesAction(conversation)); - store.dispatch(SubscribeToMembersTypingStatus(conversation)); - } - - store.dispatch( - UpdateIndicatorsAction( - isClientSyncing: false, - ), - ); - - store.dispatch(SubscribeToConversationsUpdatesAction()); - } - }); - } - } - - void handleTypingStatusSubscription( - Store store, - SubscribeToMembersTypingStatus action, - ) { - try { - action.channel.onTypingStarted?.listen((event) { - print('Typing started: $event'); - store.dispatch(TypingStarted(event)); - }); - - action.channel.onTypingEnded?.listen((event) { - print('Typing ended: $event'); - store.dispatch(TypingEnded(event)); - }); - } catch (e) { - print('Failed to handleTypingStatusSubscription: $e'); - } - } - - void handleNewMessagesSubscription( - Store store, - SubscribeToConversationsUpdatesAction action, - ) { - if (store.state.chatClient != null) { - store.state.chatClient?.onChannelUpdated?.listen((event) async { - print('New conversation event: $event'); - - if (event.reason != ChannelUpdateReason.LAST_CONSUMED_MESSAGE_INDEX) { - store.dispatch(GetConversationMessagesAction(event.channel)); - } - - store.dispatch(ShowLocalNotification('Test', 'Test')); - }); - } - } - - void getConversationMessages( - Store store, - GetConversationMessagesAction action, - ) async { - if (action.channel.synchronizationStatus == - ChannelSynchronizationStatus.ALL) { - try { - final messages = await action.channel.messages?.getLastMessages(50); - - print('Got messages: $messages'); - if (messages != null) { - store.dispatch(UpdateChatMessagesAction(messages)); - } - } catch (e) { - print('Failed to get messages: $e'); - } - } else { - print('Started listening to an unsynced channel'); - action.channel.onSynchronizationChanged?.listen((channel) async { - print('Channel sync event: ${channel.synchronizationStatus}'); - if (channel.synchronizationStatus == ChannelSynchronizationStatus.ALL) { - try { - final messages = await action.channel.messages?.getLastMessages(50); - - print('Got messages: $messages'); - if (messages != null) { - store.dispatch(UpdateChatMessagesAction(messages)); - } - } catch (e) { - print('Failed to get messages: $e'); - } - } - }); - } - } -} diff --git a/example/lib/redux/effects/twilio_middleware.dart b/example/lib/redux/effects/twilio_middleware.dart deleted file mode 100644 index 3a7bff8..0000000 --- a/example/lib/redux/effects/twilio_middleware.dart +++ /dev/null @@ -1,91 +0,0 @@ -import 'package:redux_epics/redux_epics.dart'; -import 'package:flutter_twilio_conversations_example/redux/actions/init_actions.dart'; -import 'package:flutter_twilio_conversations_example/redux/actions/messages_actions.dart'; -import 'package:flutter_twilio_conversations_example/redux/actions/ui_actions.dart'; -import 'package:flutter_twilio_conversations_example/redux/states/app_state.dart'; -import 'package:flutter_twilio_conversations/flutter_twilio_conversations.dart'; - -class TwilioMiddleware extends EpicMiddleware { - TwilioMiddleware() - : super(combineEpics([ - _initTwilio(), - _sendTextMessage(), - _sendImage(), - ])); - - static Epic _initTwilio() => TypedEpic(( - Stream stream, - EpicStore store, - ) => - stream.asyncExpand((action) async* { - try { - yield UpdateIndicatorsAction(isTwilioInitializing: true); - - final chatClient = await TwilioConversationsClient.create( - action.token, Properties()); - - if (chatClient != null) { - yield UpdateChatClient(chatClient); - yield UpdateTokenAction(action.token); - print('Successfully initialized Twilio ChatClient'); - yield UpdateIndicatorsAction(isClientSyncing: true); - yield UpdateIndicatorsAction(isTwilioInitializing: false); - yield SubscribeToChatClientSyncAction(); - } else { - print('ChatClient is null, parsing error'); - yield UpdateIndicatorsAction(isTwilioInitializing: false); - } - } catch (e) { - print('Failed to load chatClient: $e'); - yield UpdateIndicatorsAction(isTwilioInitializing: false); - } - })); - - static Epic _sendTextMessage() => TypedEpic(( - Stream stream, - EpicStore store, - ) => - stream.asyncExpand((action) async* { - try { - final request = - await action.channel.messages?.sendMessage(MessageOptions() - ..withBody(action.text) - ..withAttributes({'customKey': 'customValue'})); - - if (request != null) { - print( - 'TwilioLog --- message sent to ${action.channel}: ${request.messageBody}'); - } else { - yield ShowToastAction('Failed to send message'); - } - } catch (e) { - print('Error while sending message: $e'); - } - })); - - static Epic _sendImage() => TypedEpic(( - Stream stream, - EpicStore store, - ) => - stream.asyncExpand((action) async* { - try { - final request = await action.channel.messages?.sendMessage( - MessageOptions() - ..withMedia( - action.image, - action.image.path.toLowerCase().endsWith('heic') - ? 'image/heic' - : 'image/jpeg', - ), - ); - - if (request != null) { - print('TwilioLog --- image sent to ${action.channel}'); - } else { - yield ShowToastAction('Failed to send image'); - } - } catch (e) { - print('Error while sending image: $e'); - } - })); -} diff --git a/example/lib/redux/effects/ui_middleware.dart b/example/lib/redux/effects/ui_middleware.dart deleted file mode 100644 index da6f9dd..0000000 --- a/example/lib/redux/effects/ui_middleware.dart +++ /dev/null @@ -1,59 +0,0 @@ -import 'package:flutter_local_notifications/flutter_local_notifications.dart'; -import 'package:fluttertoast/fluttertoast.dart'; -import 'package:redux_epics/redux_epics.dart'; -import 'package:flutter_twilio_conversations_example/redux/actions/ui_actions.dart'; -import 'package:flutter_twilio_conversations_example/redux/states/app_state.dart'; - -class UiMiddleware extends EpicMiddleware { - UiMiddleware() - : super(combineEpics([ - _showToast(), - _showLocalNotification(), - ])); - - static Epic _showToast() => TypedEpic(( - Stream stream, - EpicStore store, - ) => - stream.asyncExpand((action) async* { - await Fluttertoast.showToast(msg: action.text); - })); - - static Epic _showLocalNotification() => TypedEpic(( - Stream stream, - EpicStore store, - ) => - stream.asyncExpand((action) async* { - try { - await FlutterLocalNotificationsPlugin().initialize( - InitializationSettings( - android: AndroidInitializationSettings('ic_launcher'), - iOS: IOSInitializationSettings(), - ), - ); - - await FlutterLocalNotificationsPlugin().show( - 1, - action.title, - action.text, - NotificationDetails( - android: AndroidNotificationDetails( - 'flutter_twilio_conversations', - 'Local Notifications', - channelDescription: 'Notifies about channel updates', - importance: Importance.max, - priority: Priority.high, - onlyAlertOnce: true, - showWhen: false, - styleInformation: BigTextStyleInformation(''), - ), - iOS: IOSNotificationDetails( - threadIdentifier: 'flutter_twilio_conversations', - ), - ), - ); - } catch (e) { - print('Failed to present local notification: $e'); - } - })); -} diff --git a/example/lib/redux/reducers/app_reducer.dart b/example/lib/redux/reducers/app_reducer.dart deleted file mode 100644 index 7e6b681..0000000 --- a/example/lib/redux/reducers/app_reducer.dart +++ /dev/null @@ -1,129 +0,0 @@ -import 'package:flutter_twilio_conversations_example/redux/actions/channel_actions.dart'; -import 'package:redux/redux.dart'; -import 'package:flutter_twilio_conversations_example/redux/actions/init_actions.dart'; -import 'package:flutter_twilio_conversations_example/redux/actions/messages_actions.dart'; -import 'package:flutter_twilio_conversations_example/redux/actions/ui_actions.dart'; -import 'package:flutter_twilio_conversations_example/redux/states/app_state.dart'; -import 'package:flutter_twilio_conversations_example/utils/nullable.dart'; - -class AppReducer extends ReducerClass { - @override - AppState call(AppState state, action) => combineReducers( - [ - TypedReducer(_updateTwilioToken), - TypedReducer(_updateChatClient), - TypedReducer(_updateIndicators), - TypedReducer(_updateConversation), - TypedReducer(_updateChatMessages), - TypedReducer(_openConversation), - TypedReducer(_closeConversation), - TypedReducer(_typingStarted), - TypedReducer(_typingEnded), - ], - )(state, action); - - AppState _updateTwilioToken( - AppState state, - UpdateTokenAction action, - ) => - state.copyWith( - twilioToken: action.token, - navigationState: state.navigationState.copyWith( - isAuthorized: true, - )); - - AppState _updateChatClient( - AppState state, - UpdateChatClient action, - ) => - state.copyWith(chatClient: Nullable(action.chatClient)); - - AppState _updateIndicators( - AppState state, - UpdateIndicatorsAction action, - ) => - state.copyWith( - isTwilioInitializing: action.isTwilioInitializing, - isClientSyncing: action.isClientSyncing, - ); - - AppState _updateConversation( - AppState state, - UpdateDialogsAction action, - ) => - state.copyWith(dialogs: action.dialogs); - - AppState _updateChatMessages( - AppState state, - UpdateChatMessagesAction action, - ) => - action.messages.isNotEmpty - ? state.copyWith( - dialogs: state.dialogs - .map((dialog) => - dialog.channel.sid == action.messages.first.channelSid - ? dialog.copyWith(messages: action.messages) - : dialog) - .toList(), - selectedDialog: state.selectedDialog?.channel.sid == - action.messages.first.channelSid - ? Nullable( - state.selectedDialog?.copyWith(messages: action.messages)) - : Nullable(state.selectedDialog), - ) - : state; - - AppState _openConversation( - AppState state, - OpenConversationAction action, - ) => - state.copyWith( - selectedDialog: Nullable(action.dialog), - navigationState: state.navigationState.copyWith(isDialogOpened: true), - ); - - AppState _typingStarted( - AppState state, - TypingStarted action, - ) => - state.copyWith( - dialogs: state.dialogs - .map((dialog) => dialog.channel.sid == action.event.channel.sid - ? dialog.addTypingMember(action.event.member) - : dialog) - .toList(), - selectedDialog: - state.selectedDialog?.channel.sid == action.event.channel.sid - ? Nullable( - state.selectedDialog?.addTypingMember(action.event.member), - ) - : Nullable(state.selectedDialog), - ); - - AppState _typingEnded( - AppState state, - TypingEnded action, - ) => - state.copyWith( - dialogs: state.dialogs - .map((dialog) => dialog.channel.sid == action.event.channel.sid - ? dialog.removeTypingMember(action.event.member) - : dialog) - .toList(), - selectedDialog: state.selectedDialog?.channel.sid == - action.event.channel.sid - ? Nullable( - state.selectedDialog?.removeTypingMember(action.event.member), - ) - : Nullable(state.selectedDialog), - ); - - AppState _closeConversation( - AppState state, - CloseConversationAction action, - ) => - state.copyWith( - selectedDialog: Nullable(null), - navigationState: state.navigationState.copyWith(isDialogOpened: false), - ); -} diff --git a/example/lib/redux/states/app_state.dart b/example/lib/redux/states/app_state.dart deleted file mode 100644 index 404c6fb..0000000 --- a/example/lib/redux/states/app_state.dart +++ /dev/null @@ -1,54 +0,0 @@ -import 'package:flutter_twilio_conversations/flutter_twilio_conversations.dart'; -import 'package:flutter_twilio_conversations_example/redux/states/navigation_state.dart'; -import 'package:flutter_twilio_conversations_example/utils/nullable.dart'; -import 'package:flutter_twilio_conversations_example/widgets/conversation_dialog.dart'; - -class AppState { - NavigationState navigationState; - final String? twilioToken; - final ChatClient? chatClient; - - final bool isTwilioInitializing; - final bool isClientSyncing; - final List dialogs; - final ConversationDialog? selectedDialog; - - AppState({ - required this.navigationState, - this.twilioToken, - this.chatClient, - this.isTwilioInitializing = false, - this.isClientSyncing = false, - this.dialogs = const [], - this.selectedDialog, - }); - - AppState.initial() - : navigationState = NavigationState.initial(), - twilioToken = null, - chatClient = null, - isTwilioInitializing = false, - isClientSyncing = false, - dialogs = const [], - selectedDialog = null; - - AppState copyWith({ - NavigationState? navigationState, - String? twilioToken, - Nullable? chatClient, - bool? isTwilioInitializing, - bool? isClientSyncing, - List? dialogs, - Nullable? selectedDialog, - }) => - AppState( - navigationState: navigationState ?? this.navigationState, - twilioToken: twilioToken ?? this.twilioToken, - chatClient: chatClient == null ? this.chatClient : chatClient.value, - isTwilioInitializing: isTwilioInitializing ?? this.isTwilioInitializing, - isClientSyncing: isClientSyncing ?? this.isClientSyncing, - dialogs: dialogs ?? this.dialogs, - selectedDialog: - selectedDialog == null ? this.selectedDialog : selectedDialog.value, - ); -} diff --git a/example/lib/redux/states/navigation_state.dart b/example/lib/redux/states/navigation_state.dart deleted file mode 100644 index 0ed39b3..0000000 --- a/example/lib/redux/states/navigation_state.dart +++ /dev/null @@ -1,22 +0,0 @@ -class NavigationState { - final bool isAuthorized; - final bool isDialogOpened; - - NavigationState({ - required this.isAuthorized, - required this.isDialogOpened, - }); - - NavigationState.initial() - : isAuthorized = false, - isDialogOpened = false; - - NavigationState copyWith({ - bool? isAuthorized, - bool? isDialogOpened, - }) => - NavigationState( - isAuthorized: isAuthorized ?? this.isAuthorized, - isDialogOpened: isDialogOpened ?? this.isDialogOpened, - ); -} diff --git a/example/lib/utils/nullable.dart b/example/lib/utils/nullable.dart deleted file mode 100644 index c0dae86..0000000 --- a/example/lib/utils/nullable.dart +++ /dev/null @@ -1,5 +0,0 @@ -class Nullable { - final T? value; - - Nullable(this.value); -} diff --git a/example/lib/widgets/auth_widget.dart b/example/lib/widgets/auth_widget.dart deleted file mode 100644 index 011c4f4..0000000 --- a/example/lib/widgets/auth_widget.dart +++ /dev/null @@ -1,71 +0,0 @@ -import 'package:equatable/equatable.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_redux/flutter_redux.dart'; -import 'package:redux/redux.dart'; -import 'package:flutter_twilio_conversations_example/redux/actions/init_actions.dart'; -import 'package:flutter_twilio_conversations_example/redux/actions/ui_actions.dart'; -import 'package:flutter_twilio_conversations_example/redux/states/app_state.dart'; - -class AuthWidget extends StatelessWidget { - final TextEditingController _textEditingController = TextEditingController(); - - @override - Widget build(BuildContext context) { - return StoreConnector( - distinct: true, - converter: (store) => _ViewModel(store), - onInitialBuild: (viewModel) { - // enter test token here to use it without typing - // _textEditingController.text = ''; - }, - builder: (context, viewModel) => Scaffold( - backgroundColor: Colors.white, - appBar: AppBar( - title: Text( - 'Twilio Conversations Flutter', - ), - ), - body: Column( - children: [ - Padding( - padding: const EdgeInsets.all(16), - child: SizedBox( - width: double.infinity, - child: TextField( - controller: _textEditingController, - autocorrect: false, - decoration: InputDecoration( - hintText: 'Twilio chatJWT Token', - ), - ), - ), - ), - TextButton( - onPressed: () => _textEditingController.text.trim().isNotEmpty - ? viewModel.initialize( - _textEditingController.text.trim(), - ) - : viewModel.showEmptyFieldsToast(), - child: Text('Initialize'), - ), - ], - ), - ), - ); - } -} - -class _ViewModel with EquatableMixin { - final Store _store; - - _ViewModel(this._store); - - void initialize(String token) => _store.dispatch(InitializeAction(token)); - - void showEmptyFieldsToast() => _store.dispatch( - ShowToastAction('Enter token into the field above'), - ); - - @override - List get props => []; -} diff --git a/example/lib/widgets/conversation_dialog.dart b/example/lib/widgets/conversation_dialog.dart deleted file mode 100644 index 3b5fa0b..0000000 --- a/example/lib/widgets/conversation_dialog.dart +++ /dev/null @@ -1,67 +0,0 @@ -import 'package:flutter_twilio_conversations/flutter_twilio_conversations.dart'; - -class ConversationDialog { - final Channel channel; - final String? name; - final List messages; - final bool isConversationSyncing; - final List typingMembers; - - ConversationDialog({ - required this.channel, - this.name, - this.messages = const [], - this.isConversationSyncing = false, - this.typingMembers = const [], - }); - - String get title => name != null && name!.isNotEmpty ? name! : channel.sid; - - String? get lastMessageText => typingMembers.isNotEmpty - ? typingMessage() - : messages.isNotEmpty - ? messages.last.messageBody - : null; - - String typingMessage() { - if (typingMembers.isEmpty) { - return ''; - } - - if (typingMembers.length == 1) { - return '${typingMembers.first} is typing...'; - } - - return '${typingMembers.first} and ${typingMembers.length - 1} others are typing...'; - } - - ConversationDialog copyWith({ - Channel? channel, - List? messages, - bool? isConversationSyncing, - List? typingMembers, - }) => - ConversationDialog( - channel: channel ?? this.channel, - messages: messages ?? this.messages, - isConversationSyncing: - isConversationSyncing ?? this.isConversationSyncing, - typingMembers: typingMembers ?? this.typingMembers, - ); - - ConversationDialog addTypingMember(Member member) { - if (typingMembers.contains(member.identity)) { - return this; - } - return copyWith(typingMembers: [...typingMembers, member.identity ?? '']); - } - - ConversationDialog removeTypingMember(Member member) { - if (!typingMembers.contains(member.identity)) { - return this; - } - return copyWith( - typingMembers: - typingMembers.where((m) => m != member.identity).toList()); - } -} diff --git a/example/lib/widgets/dialogs_list.dart b/example/lib/widgets/dialogs_list.dart deleted file mode 100644 index 1476d68..0000000 --- a/example/lib/widgets/dialogs_list.dart +++ /dev/null @@ -1,89 +0,0 @@ -import 'package:equatable/equatable.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_redux/flutter_redux.dart'; -import 'package:redux/redux.dart'; -import 'package:flutter_twilio_conversations_example/redux/actions/ui_actions.dart'; -import 'package:flutter_twilio_conversations_example/redux/states/app_state.dart'; -import 'package:flutter_twilio_conversations/flutter_twilio_conversations.dart'; -import 'package:flutter_twilio_conversations_example/widgets/conversation_dialog.dart'; - -class DialogsList extends StatelessWidget { - @override - Widget build(BuildContext context) { - return StoreConnector( - distinct: true, - converter: (store) => _ViewModel(store), - builder: (context, viewModel) => Scaffold( - backgroundColor: Colors.white, - appBar: AppBar( - title: Text( - 'Dialogs', - ), - ), - body: viewModel.dialogs.isNotEmpty - ? ListView.builder( - itemCount: viewModel.dialogs.length, - itemBuilder: (context, index) => InkWell( - onTap: () => - viewModel.openConversation(viewModel.dialogs[index]), - child: Container( - decoration: BoxDecoration( - border: Border.symmetric( - horizontal: BorderSide(color: Colors.grey[300]!), - ), - ), - child: Padding( - padding: EdgeInsets.all(8), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - viewModel.dialogs[index].title, - style: TextStyle( - fontWeight: FontWeight.bold, - ), - ), - SizedBox(height: 10), - Text( - viewModel.dialogs[index].lastMessageText ?? - 'No messages loaded', - style: TextStyle( - color: Colors.grey, - ), - ), - ], - ), - ), - ), - ), - ) - : Center(child: CircularProgressIndicator()), - ), - ); - } -} - -class _ViewModel with EquatableMixin { - final Store _store; - final ChatClient? chatClient; - final List dialogs; - - final bool isTwilioInitializing; - final bool isClientSyncing; - - _ViewModel(this._store) - : chatClient = _store.state.chatClient, - dialogs = _store.state.dialogs, - isTwilioInitializing = _store.state.isTwilioInitializing, - isClientSyncing = _store.state.isClientSyncing; - - void openConversation(ConversationDialog dialog) => - _store.dispatch(OpenConversationAction(dialog)); - - @override - List get props => [ - dialogs, - isTwilioInitializing, - isClientSyncing, - ]; -} diff --git a/example/lib/widgets/message_item.dart b/example/lib/widgets/message_item.dart deleted file mode 100644 index c9c0784..0000000 --- a/example/lib/widgets/message_item.dart +++ /dev/null @@ -1,95 +0,0 @@ -import 'package:cached_network_image/cached_network_image.dart'; -import 'package:equatable/equatable.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_redux/flutter_redux.dart'; -import 'package:redux/redux.dart'; -import 'package:flutter_twilio_conversations/flutter_twilio_conversations.dart'; -import 'package:flutter_twilio_conversations_example/redux/states/app_state.dart'; -import 'package:flutter_twilio_conversations_example/widgets/conversation_dialog.dart'; - -class MessageItem extends StatelessWidget { - final Message message; - - const MessageItem( - this.message, { - Key? key, - }) : super(key: key); - - @override - Widget build(BuildContext context) { - return StoreConnector( - distinct: true, - converter: (store) => _ViewModel(store, message), - builder: (context, viewModel) => SizedBox( - width: double.infinity, - child: Column( - crossAxisAlignment: viewModel.isMyMessage() - ? CrossAxisAlignment.end - : CrossAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.only( - bottom: 6, - ), - child: Text( - '${message.author} @ ${message.dateCreated} with ${message.attributes?.getJSONObject()}}'), - ), - Container( - decoration: BoxDecoration( - borderRadius: const BorderRadius.all( - Radius.circular(8), - ), - color: viewModel.isMyMessage() ? Colors.blue : Colors.grey, - ), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: message.hasMedia - ? FutureBuilder( - future: message.media?.getDownloadURL(), - builder: (context, snapshot) { - if (snapshot.hasData) { - return CachedNetworkImage( - imageUrl: snapshot.data as String, - placeholder: (context, url) => - CircularProgressIndicator(), - errorWidget: (context, url, error) => - Icon(Icons.error), - ); - } - - return CircularProgressIndicator(); - }, - ) - : Text( - message.messageBody, - style: TextStyle( - color: Colors.white, - ), - ), - ), - ), - ], - ), - ), - ); - } -} - -class _ViewModel with EquatableMixin { - final ConversationDialog? dialog; - final String? myIdentity; - final Message message; - - _ViewModel( - Store _store, - this.message, - ) : dialog = _store.state.selectedDialog, - myIdentity = _store.state.chatClient?.myIdentity; - - bool isMyMessage() => (message.author ?? '') == myIdentity; - - @override - List get props => [ - dialog, - ]; -} diff --git a/example/lib/widgets/send_bar.dart b/example/lib/widgets/send_bar.dart deleted file mode 100644 index a8930f2..0000000 --- a/example/lib/widgets/send_bar.dart +++ /dev/null @@ -1,176 +0,0 @@ -import 'dart:io'; - -import 'package:device_info_plus/device_info_plus.dart'; -import 'package:equatable/equatable.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_redux/flutter_redux.dart'; -import 'package:image_picker/image_picker.dart'; -import 'package:permission_handler/permission_handler.dart'; -import 'package:redux/redux.dart'; -import 'package:flutter_twilio_conversations_example/redux/actions/messages_actions.dart'; -import 'package:flutter_twilio_conversations_example/redux/actions/ui_actions.dart'; -import 'package:flutter_twilio_conversations_example/redux/states/app_state.dart'; -import 'package:flutter_twilio_conversations_example/widgets/conversation_dialog.dart'; - -class SendBar extends StatefulWidget { - const SendBar({Key? key}) : super(key: key); - - @override - State createState() => _SendBarState(); -} - -class _SendBarState extends State { - late TextEditingController messageTextController; - - @override - void initState() { - super.initState(); - messageTextController = TextEditingController(); - } - - @override - Widget build(BuildContext context) { - return StoreConnector( - distinct: true, - converter: (store) => _ViewModel(store), - builder: (context, viewModel) => Container( - color: Colors.white, - child: Column( - mainAxisAlignment: MainAxisAlignment.end, - mainAxisSize: MainAxisSize.min, - children: [ - Container( - height: 56, - width: double.infinity, - decoration: const BoxDecoration( - border: Border( - top: BorderSide( - color: Colors.grey, - width: 1, - ), - ), - ), - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 26), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - InkWell( - child: const Icon( - Icons.image_sharp, - size: 24, - ), - onTap: () async { - if (await viewModel.hasGalleryAccess()) { - try { - final pickedImage = await ImagePicker().pickImage( - source: ImageSource.gallery, - imageQuality: 60, - maxHeight: 1000, - maxWidth: 1000, - ); - - if (pickedImage != null) { - final image = File(pickedImage.path); - - // send picked file - viewModel.sendImage(image); - } - } catch (e) { - print('Image picker error: $e'); - } - } else { - // no access to photos - viewModel.showNoPhotoAccessToast(); - } - }, - ), - SizedBox( - height: 50, - width: MediaQuery.of(context).size.width - 140, - child: TextField( - maxLength: 300, - controller: messageTextController, - textCapitalization: TextCapitalization.sentences, - decoration: const InputDecoration( - counterText: '', - hintText: 'Type messageā€¦', - contentPadding: EdgeInsets.symmetric(horizontal: 8), - ), - ), - ), - InkWell( - child: const Icon( - Icons.send_rounded, - size: 24, - ), - onTap: () { - if (messageTextController.text.trim().isNotEmpty && - viewModel.dialog!.channel.hasSynchronized) { - viewModel.sendTextMessage( - messageTextController.text.trim()); - messageTextController.clear(); - } else if (messageTextController.text - .trim() - .isNotEmpty && - !viewModel.dialog!.channel.hasSynchronized) { - print( - 'TwilioLog --- Conversation is not synced, trying to send the message carefully'); - viewModel.sendTextMessage( - messageTextController.text.trim(), - ); - messageTextController.clear(); - } - }, - ), - ], - ), - ), - ), - ], - ), - ), - ); - } -} - -class _ViewModel with EquatableMixin { - final Store _store; - final ConversationDialog? dialog; - - _ViewModel(this._store) : dialog = _store.state.selectedDialog; - - Future hasGalleryAccess() async { - if (Platform.isIOS) { - final permission = await Permission.photos.request(); - print('Permission: $permission'); - return permission.isGranted; - } else if (Platform.isAndroid) { - final androidInfo = await DeviceInfoPlugin().androidInfo; - final sdkInt = androidInfo.version.sdkInt ?? 1; - final response = - sdkInt > 28 ? await Permission.photos.request().isGranted : true; - return response; - } - return false; - } - - void sendImage(File image) => - _store.dispatch(SendImageAction(dialog!.channel, image)); - - void sendTextMessage(String text) { - _store.dispatch( - SendTextMessageAction(dialog!.channel, text), - ); - } - - void showNoPhotoAccessToast() => _store.dispatch( - ShowToastAction('No Access to Photos'), - ); - - @override - List get props => [ - dialog, - ]; -} diff --git a/example/pubspec.lock b/example/pubspec.lock deleted file mode 100644 index 098a556..0000000 --- a/example/pubspec.lock +++ /dev/null @@ -1,923 +0,0 @@ -# Generated by pub -# See https://dart.dev/tools/pub/glossary#lockfile -packages: - _fe_analyzer_shared: - dependency: transitive - description: - name: _fe_analyzer_shared - sha256: "3b2fe435eec193a3c31dd4fb2b28b11cf7036cc12287a20745157debd2d2c433" - url: "https://pub.dev" - source: hosted - version: "40.0.0" - analyzer: - dependency: transitive - description: - name: analyzer - sha256: f64b626238d464c38540c6798ffbf3d1abaafd8b9195b6c3eefa2cb544041843 - url: "https://pub.dev" - source: hosted - version: "4.1.0" - args: - dependency: transitive - description: - name: args - sha256: b003c3098049a51720352d219b0bb5f219b60fbfb68e7a4748139a06a5676515 - url: "https://pub.dev" - source: hosted - version: "2.3.1" - async: - dependency: transitive - description: - name: async - sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" - url: "https://pub.dev" - source: hosted - version: "2.11.0" - boolean_selector: - dependency: transitive - description: - name: boolean_selector - sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" - url: "https://pub.dev" - source: hosted - version: "2.1.1" - cached_network_image: - dependency: "direct main" - description: - name: cached_network_image - sha256: e764e48ef036cabdf84319ba7b8b5871b6b43266e14de787cb43f77639089ae5 - url: "https://pub.dev" - source: hosted - version: "3.2.1" - cached_network_image_platform_interface: - dependency: transitive - description: - name: cached_network_image_platform_interface - sha256: "8e2b5befefec5063bee8f209fda21751f6328d405d4237c70f21104568b2fee7" - url: "https://pub.dev" - source: hosted - version: "1.0.0" - cached_network_image_web: - dependency: transitive - description: - name: cached_network_image_web - sha256: d4351c7eb16767df129b0474a5ebc4e028870379c063e8ba265a56aa00831e70 - url: "https://pub.dev" - source: hosted - version: "1.0.1" - characters: - dependency: transitive - description: - name: characters - sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" - url: "https://pub.dev" - source: hosted - version: "1.3.0" - clock: - dependency: transitive - description: - name: clock - sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf - url: "https://pub.dev" - source: hosted - version: "1.1.1" - collection: - dependency: transitive - description: - name: collection - sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 - url: "https://pub.dev" - source: hosted - version: "1.17.2" - convert: - dependency: transitive - description: - name: convert - sha256: "196284f26f69444b7f5c50692b55ec25da86d9e500451dc09333bf2e3ad69259" - url: "https://pub.dev" - source: hosted - version: "3.0.2" - coverage: - dependency: transitive - description: - name: coverage - sha256: "2fb815080e44a09b85e0f2ca8a820b15053982b2e714b59267719e8a9ff17097" - url: "https://pub.dev" - source: hosted - version: "1.6.3" - cross_file: - dependency: transitive - description: - name: cross_file - sha256: "7632a2bcddc8cef4afde3c6f80e69b29a7060e176f01119c229fe4eb3a2a3d4f" - url: "https://pub.dev" - source: hosted - version: "0.3.3+1" - crypto: - dependency: transitive - description: - name: crypto - sha256: aa274aa7774f8964e4f4f38cc994db7b6158dd36e9187aaceaddc994b35c6c67 - url: "https://pub.dev" - source: hosted - version: "3.0.2" - cupertino_icons: - dependency: "direct main" - description: - name: cupertino_icons - sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be - url: "https://pub.dev" - source: hosted - version: "1.0.5" - dbus: - dependency: transitive - description: - name: dbus - sha256: "253bfaa3d340778d8bc755e89c3af38e85ef95e65fd5d5670aa3167f8d4f6577" - url: "https://pub.dev" - source: hosted - version: "0.7.4" - device_info_plus: - dependency: "direct main" - description: - name: device_info_plus - sha256: c2386729379f04cd39ee0d5d4c48d8c8a0e70f7622dac626cbf5e396392602fd - url: "https://pub.dev" - source: hosted - version: "3.2.4" - device_info_plus_linux: - dependency: transitive - description: - name: device_info_plus_linux - sha256: e4eb5db4704f5534e872148a21cfcd39581022b63df556da6720d88f7c9f91a9 - url: "https://pub.dev" - source: hosted - version: "2.1.1" - device_info_plus_macos: - dependency: transitive - description: - name: device_info_plus_macos - sha256: "38871fd2ad31871399d8307630c9f4eb5941dd2c643ee221c44d58de95d367a1" - url: "https://pub.dev" - source: hosted - version: "2.2.3" - device_info_plus_platform_interface: - dependency: transitive - description: - name: device_info_plus_platform_interface - sha256: "7b2519986b1d805c0d123fcfb42a1be73f9ec2f04f45b15e693b2cb355305b86" - url: "https://pub.dev" - source: hosted - version: "2.3.0+1" - device_info_plus_web: - dependency: transitive - description: - name: device_info_plus_web - sha256: "38715ad1ef3bee8915dd7bee08a9ac9ab54472a8df425c887062a3046209f663" - url: "https://pub.dev" - source: hosted - version: "2.1.0" - device_info_plus_windows: - dependency: transitive - description: - name: device_info_plus_windows - sha256: "8fb1403fc94636d6ab48aeebb5f9379f2ca51cde3b337167ec6f39db09234492" - url: "https://pub.dev" - source: hosted - version: "2.1.1" - enum_to_string: - dependency: transitive - description: - name: enum_to_string - sha256: bd9e83a33b754cb43a75b36a9af2a0b92a757bfd9847d2621ca0b1bed45f8e7a - url: "https://pub.dev" - source: hosted - version: "2.0.1" - equatable: - dependency: "direct main" - description: - name: equatable - sha256: c6094fd1efad3046334a9c40bee022147e55c25401ccd89b94e373e3edadd375 - url: "https://pub.dev" - source: hosted - version: "2.0.3" - fake_async: - dependency: transitive - description: - name: fake_async - sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" - url: "https://pub.dev" - source: hosted - version: "1.3.1" - ffi: - dependency: transitive - description: - name: ffi - sha256: "13a6ccf6a459a125b3fcdb6ec73bd5ff90822e071207c663bfd1f70062d51d18" - url: "https://pub.dev" - source: hosted - version: "1.2.1" - file: - dependency: transitive - description: - name: file - sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" - url: "https://pub.dev" - source: hosted - version: "6.1.4" - flutter: - dependency: "direct main" - description: flutter - source: sdk - version: "0.0.0" - flutter_blurhash: - dependency: transitive - description: - name: flutter_blurhash - sha256: "05001537bd3fac7644fa6558b09ec8c0a3f2eba78c0765f88912882b1331a5c6" - url: "https://pub.dev" - source: hosted - version: "0.7.0" - flutter_cache_manager: - dependency: transitive - description: - name: flutter_cache_manager - sha256: "32cd900555219333326a2d0653aaaf8671264c29befa65bbd9856d204a4c9fb3" - url: "https://pub.dev" - source: hosted - version: "3.3.0" - flutter_driver: - dependency: "direct dev" - description: flutter - source: sdk - version: "0.0.0" - flutter_lints: - dependency: "direct dev" - description: - name: flutter_lints - sha256: b543301ad291598523947dc534aaddc5aaad597b709d2426d3a0e0d44c5cb493 - url: "https://pub.dev" - source: hosted - version: "1.0.4" - flutter_local_notifications: - dependency: "direct main" - description: - name: flutter_local_notifications - sha256: bbe8916a627e3928ebcf25a13fae861c6126f885f11f69bdbe4cf7223136b494 - url: "https://pub.dev" - source: hosted - version: "9.6.0" - flutter_local_notifications_linux: - dependency: transitive - description: - name: flutter_local_notifications_linux - sha256: "30cbdbf3fa57e72a64c00e0420a3bd5354a7087d9d3adf9f3b156b7b065ce80c" - url: "https://pub.dev" - source: hosted - version: "0.5.0+1" - flutter_local_notifications_platform_interface: - dependency: transitive - description: - name: flutter_local_notifications_platform_interface - sha256: "21bceee103a66a53b30ea9daf677f990e5b9e89b62f222e60dd241cd08d63d3a" - url: "https://pub.dev" - source: hosted - version: "5.0.0" - flutter_plugin_android_lifecycle: - dependency: transitive - description: - name: flutter_plugin_android_lifecycle - sha256: "6ffe524cd6a7d49d99b2bf979a4f6ad82304c639cea4c8d3d0f8cf1aff24e74a" - url: "https://pub.dev" - source: hosted - version: "2.0.6" - flutter_redux: - dependency: "direct main" - description: - name: flutter_redux - sha256: "8985fd9a4f4016be6acc058818b7bc4cd43f65d134e6507a6e017ac5b499cd82" - url: "https://pub.dev" - source: hosted - version: "0.8.2" - flutter_test: - dependency: transitive - description: flutter - source: sdk - version: "0.0.0" - flutter_twilio_conversations: - dependency: "direct dev" - description: - path: ".." - relative: true - source: path - version: "1.1.2+4" - flutter_web_plugins: - dependency: transitive - description: flutter - source: sdk - version: "0.0.0" - fluttertoast: - dependency: "direct main" - description: - name: fluttertoast - sha256: b528e78a4e69957bb8a33d9e8ceaa728801bb7c6ce599e811e49cf6d94d17fef - url: "https://pub.dev" - source: hosted - version: "8.0.9" - frontend_server_client: - dependency: transitive - description: - name: frontend_server_client - sha256: "408e3ca148b31c20282ad6f37ebfa6f4bdc8fede5b74bc2f08d9d92b55db3612" - url: "https://pub.dev" - source: hosted - version: "3.2.0" - fuchsia_remote_debug_protocol: - dependency: transitive - description: flutter - source: sdk - version: "0.0.0" - glob: - dependency: transitive - description: - name: glob - sha256: "8321dd2c0ab0683a91a51307fa844c6db4aa8e3981219b78961672aaab434658" - url: "https://pub.dev" - source: hosted - version: "2.0.2" - http: - dependency: transitive - description: - name: http - sha256: "2ed163531e071c2c6b7c659635112f24cb64ecbebf6af46b550d536c0b1aa112" - url: "https://pub.dev" - source: hosted - version: "0.13.4" - http_multi_server: - dependency: transitive - description: - name: http_multi_server - sha256: ab298ef2b2acd283bd36837df7801dcf6e6b925f8da6e09efb81111230aa9037 - url: "https://pub.dev" - source: hosted - version: "3.2.0" - http_parser: - dependency: transitive - description: - name: http_parser - sha256: db3060f22889f3d9d55f6a217565486737037eec3609f7f3eca4d0c67ee0d8a0 - url: "https://pub.dev" - source: hosted - version: "4.0.1" - image_picker: - dependency: "direct main" - description: - name: image_picker - sha256: f3712cd190227fb92e0960cb0ce22928ba042c7183b16864ade83b259adf8ea6 - url: "https://pub.dev" - source: hosted - version: "0.8.5+3" - image_picker_android: - dependency: transitive - description: - name: image_picker_android - sha256: "08cfcbf6eeab76948fb45064bf080044531e068b4814946137e75cb42487d651" - url: "https://pub.dev" - source: hosted - version: "0.8.5" - image_picker_for_web: - dependency: transitive - description: - name: image_picker_for_web - sha256: "60f306ffbdcada4bc8b2691acc420258a1b758e102c87c4f94fb568d640f0e0e" - url: "https://pub.dev" - source: hosted - version: "2.1.8" - image_picker_ios: - dependency: transitive - description: - name: image_picker_ios - sha256: c1af1bd2223362771e161a72c5361c762a7719f822583762b3ddd1971bcea081 - url: "https://pub.dev" - source: hosted - version: "0.8.5+5" - image_picker_platform_interface: - dependency: transitive - description: - name: image_picker_platform_interface - sha256: b5cfa6b0364979411dfbd3a68bd874452eff22344f184f92af79bddc4acf4742 - url: "https://pub.dev" - source: hosted - version: "2.5.0" - io: - dependency: transitive - description: - name: io - sha256: "0d4c73c3653ab85bf696d51a9657604c900a370549196a91f33e4c39af760852" - url: "https://pub.dev" - source: hosted - version: "1.0.3" - js: - dependency: transitive - description: - name: js - sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 - url: "https://pub.dev" - source: hosted - version: "0.6.7" - lints: - dependency: transitive - description: - name: lints - sha256: a2c3d198cb5ea2e179926622d433331d8b58374ab8f29cdda6e863bd62fd369c - url: "https://pub.dev" - source: hosted - version: "1.0.1" - logging: - dependency: transitive - description: - name: logging - sha256: "293ae2d49fd79d4c04944c3a26dfd313382d5f52e821ec57119230ae16031ad4" - url: "https://pub.dev" - source: hosted - version: "1.0.2" - matcher: - dependency: transitive - description: - name: matcher - sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" - url: "https://pub.dev" - source: hosted - version: "0.12.16" - material_color_utilities: - dependency: transitive - description: - name: material_color_utilities - sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" - url: "https://pub.dev" - source: hosted - version: "0.5.0" - meta: - dependency: transitive - description: - name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" - url: "https://pub.dev" - source: hosted - version: "1.9.1" - mime: - dependency: transitive - description: - name: mime - sha256: dab22e92b41aa1255ea90ddc4bc2feaf35544fd0728e209638cad041a6e3928a - url: "https://pub.dev" - source: hosted - version: "1.0.2" - node_preamble: - dependency: transitive - description: - name: node_preamble - sha256: "8ebdbaa3b96d5285d068f80772390d27c21e1fa10fb2df6627b1b9415043608d" - url: "https://pub.dev" - source: hosted - version: "2.0.1" - octo_image: - dependency: transitive - description: - name: octo_image - sha256: "107f3ed1330006a3bea63615e81cf637433f5135a52466c7caa0e7152bca9143" - url: "https://pub.dev" - source: hosted - version: "1.0.2" - package_config: - dependency: transitive - description: - name: package_config - sha256: a4d5ede5ca9c3d88a2fef1147a078570c861714c806485c596b109819135bc12 - url: "https://pub.dev" - source: hosted - version: "2.0.2" - path: - dependency: transitive - description: - name: path - sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" - url: "https://pub.dev" - source: hosted - version: "1.8.3" - path_provider: - dependency: transitive - description: - name: path_provider - sha256: "050e8e85e4b7fecdf2bb3682c1c64c4887a183720c802d323de8a5fd76d372dd" - url: "https://pub.dev" - source: hosted - version: "2.0.11" - path_provider_android: - dependency: transitive - description: - name: path_provider_android - sha256: dfaa152e93c3a6fec632482928c770b2156dfb873582e99fbd6ac3b3de651d4c - url: "https://pub.dev" - source: hosted - version: "2.0.14" - path_provider_ios: - dependency: transitive - description: - name: path_provider_ios - sha256: "060ca9249d85bda6ee4ea2ecb3f4698a32f73183e0dee4f469bee8e146eadc1f" - url: "https://pub.dev" - source: hosted - version: "2.0.9" - path_provider_linux: - dependency: transitive - description: - name: path_provider_linux - sha256: ab0987bf95bc591da42dffb38c77398fc43309f0b9b894dcc5d6f40c4b26c379 - url: "https://pub.dev" - source: hosted - version: "2.1.7" - path_provider_macos: - dependency: transitive - description: - name: path_provider_macos - sha256: "2a97e7fbb7ae9dcd0dfc1220a78e9ec3e71da691912e617e8715ff2a13086ae8" - url: "https://pub.dev" - source: hosted - version: "2.0.6" - path_provider_platform_interface: - dependency: transitive - description: - name: path_provider_platform_interface - sha256: "27dc7a224fcd07444cb5e0e60423ccacea3e13cf00fc5282ac2c918132da931d" - url: "https://pub.dev" - source: hosted - version: "2.0.4" - path_provider_windows: - dependency: transitive - description: - name: path_provider_windows - sha256: a34ecd7fb548f8e57321fd8e50d865d266941b54e6c3b7758cf8f37c24116905 - url: "https://pub.dev" - source: hosted - version: "2.0.7" - pedantic: - dependency: transitive - description: - name: pedantic - sha256: "67fc27ed9639506c856c840ccce7594d0bdcd91bc8d53d6e52359449a1d50602" - url: "https://pub.dev" - source: hosted - version: "1.11.1" - permission_handler: - dependency: "direct main" - description: - name: permission_handler - sha256: "4356882e9abf51aa0d56e8fb886e0d6162719f2310dd71f0b8fa7f34908b128d" - url: "https://pub.dev" - source: hosted - version: "8.3.0" - permission_handler_platform_interface: - dependency: transitive - description: - name: permission_handler_platform_interface - sha256: ca16451bfdc6d26693d10b37b2d81370bdf3f0318422f3eecfd6004f5bd7d21f - url: "https://pub.dev" - source: hosted - version: "3.7.0" - petitparser: - dependency: transitive - description: - name: petitparser - sha256: "2ebb289dc4764ec397f5cd3ca9881c6d17196130a7d646ed022a0dd9c2e25a71" - url: "https://pub.dev" - source: hosted - version: "5.0.0" - platform: - dependency: transitive - description: - name: platform - sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76" - url: "https://pub.dev" - source: hosted - version: "3.1.0" - plugin_platform_interface: - dependency: transitive - description: - name: plugin_platform_interface - sha256: "075f927ebbab4262ace8d0b283929ac5410c0ac4e7fc123c76429564facfb757" - url: "https://pub.dev" - source: hosted - version: "2.1.2" - pool: - dependency: transitive - description: - name: pool - sha256: "05955e3de2683e1746222efd14b775df7131139e07695dc8e24650f6b4204504" - url: "https://pub.dev" - source: hosted - version: "1.5.0" - process: - dependency: transitive - description: - name: process - sha256: "53fd8db9cec1d37b0574e12f07520d582019cb6c44abf5479a01505099a34a09" - url: "https://pub.dev" - source: hosted - version: "4.2.4" - pub_semver: - dependency: transitive - description: - name: pub_semver - sha256: "816c1a640e952d213ddd223b3e7aafae08cd9f8e1f6864eed304cc13b0272b07" - url: "https://pub.dev" - source: hosted - version: "2.1.1" - redux: - dependency: "direct main" - description: - name: redux - sha256: "1e86ed5b1a9a717922d0a0ca41f9bf49c1a587d50050e9426fc65b14e85ec4d7" - url: "https://pub.dev" - source: hosted - version: "5.0.0" - redux_epics: - dependency: "direct main" - description: - name: redux_epics - sha256: b2340bc52df7039416fda9c2eeaf85634d18f8e4784761af3a4e13dfb20f2602 - url: "https://pub.dev" - source: hosted - version: "0.15.1" - rxdart: - dependency: transitive - description: - name: rxdart - sha256: "933db29250b286ecfe08a552f991f0e9f245f3f8ba1e5fb37f2f55d1f82888cb" - url: "https://pub.dev" - source: hosted - version: "0.27.4" - shelf: - dependency: transitive - description: - name: shelf - sha256: "4592f6cb6c417632ebdfb63e4db42a7e3ad49d1bd52d9f93b6eb883035ddc0c3" - url: "https://pub.dev" - source: hosted - version: "1.3.0" - shelf_packages_handler: - dependency: transitive - description: - name: shelf_packages_handler - sha256: e0b44ebddec91e70a713e13adf93c1b2100821303b86a18e1ef1d082bd8bd9b8 - url: "https://pub.dev" - source: hosted - version: "3.0.0" - shelf_static: - dependency: transitive - description: - name: shelf_static - sha256: "4a0d12cd512aa4fc55fed5f6280f02ef183f47ba29b4b0dfd621b1c99b7e6361" - url: "https://pub.dev" - source: hosted - version: "1.1.0" - shelf_web_socket: - dependency: transitive - description: - name: shelf_web_socket - sha256: fd84910bf7d58db109082edf7326b75322b8f186162028482f53dc892f00332d - url: "https://pub.dev" - source: hosted - version: "1.0.1" - sky_engine: - dependency: transitive - description: flutter - source: sdk - version: "0.0.99" - source_map_stack_trace: - dependency: transitive - description: - name: source_map_stack_trace - sha256: "8c463326277f68a628abab20580047b419c2ff66756fd0affd451f73f9508c11" - url: "https://pub.dev" - source: hosted - version: "2.1.0" - source_maps: - dependency: transitive - description: - name: source_maps - sha256: "52de2200bb098de739794c82d09c41ac27b2e42fd7e23cce7b9c74bf653c7296" - url: "https://pub.dev" - source: hosted - version: "0.10.10" - source_span: - dependency: transitive - description: - name: source_span - sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" - url: "https://pub.dev" - source: hosted - version: "1.10.0" - sqflite: - dependency: transitive - description: - name: sqflite - sha256: "51c09d414ca74b1cd4a5880d63763ebd2033a4fc6d921708c7c1e98c603735d4" - url: "https://pub.dev" - source: hosted - version: "2.0.2+1" - sqflite_common: - dependency: transitive - description: - name: sqflite_common - sha256: b504fc5b4576a05586a0bb99d9bcc0d37a78d9d5ed68b96c361d5d3a8e538275 - url: "https://pub.dev" - source: hosted - version: "2.2.1+1" - stack_trace: - dependency: transitive - description: - name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 - url: "https://pub.dev" - source: hosted - version: "1.11.0" - stream_channel: - dependency: transitive - description: - name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" - url: "https://pub.dev" - source: hosted - version: "2.1.1" - string_scanner: - dependency: transitive - description: - name: string_scanner - sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" - url: "https://pub.dev" - source: hosted - version: "1.2.0" - sync_http: - dependency: transitive - description: - name: sync_http - sha256: "7f0cd72eca000d2e026bcd6f990b81d0ca06022ef4e32fb257b30d3d1014a961" - url: "https://pub.dev" - source: hosted - version: "0.3.1" - synchronized: - dependency: transitive - description: - name: synchronized - sha256: a7f0790927c0806ae0d5eb061c713748fa6070ef0037e391a2d53c3844c09dc2 - url: "https://pub.dev" - source: hosted - version: "3.0.0+2" - term_glyph: - dependency: transitive - description: - name: term_glyph - sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 - url: "https://pub.dev" - source: hosted - version: "1.2.1" - test: - dependency: "direct dev" - description: - name: test - sha256: "13b41f318e2a5751c3169137103b60c584297353d4b1761b66029bae6411fe46" - url: "https://pub.dev" - source: hosted - version: "1.24.3" - test_api: - dependency: transitive - description: - name: test_api - sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" - url: "https://pub.dev" - source: hosted - version: "0.6.0" - test_core: - dependency: transitive - description: - name: test_core - sha256: "99806e9e6d95c7b059b7a0fc08f07fc53fabe54a829497f0d9676299f1e8637e" - url: "https://pub.dev" - source: hosted - version: "0.5.3" - timezone: - dependency: transitive - description: - name: timezone - sha256: "57b35f6e8ef731f18529695bffc62f92c6189fac2e52c12d478dec1931afb66e" - url: "https://pub.dev" - source: hosted - version: "0.8.0" - typed_data: - dependency: transitive - description: - name: typed_data - sha256: "26f87ade979c47a150c9eaab93ccd2bebe70a27dc0b4b29517f2904f04eb11a5" - url: "https://pub.dev" - source: hosted - version: "1.3.1" - uuid: - dependency: transitive - description: - name: uuid - sha256: "2469694ad079893e3b434a627970c33f2fa5adc46dfe03c9617546969a9a8afc" - url: "https://pub.dev" - source: hosted - version: "3.0.6" - vector_math: - dependency: transitive - description: - name: vector_math - sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" - url: "https://pub.dev" - source: hosted - version: "2.1.4" - vm_service: - dependency: transitive - description: - name: vm_service - sha256: c620a6f783fa22436da68e42db7ebbf18b8c44b9a46ab911f666ff09ffd9153f - url: "https://pub.dev" - source: hosted - version: "11.7.1" - watcher: - dependency: transitive - description: - name: watcher - sha256: e42dfcc48f67618344da967b10f62de57e04bae01d9d3af4c2596f3712a88c99 - url: "https://pub.dev" - source: hosted - version: "1.0.1" - web: - dependency: transitive - description: - name: web - sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 - url: "https://pub.dev" - source: hosted - version: "0.1.4-beta" - web_socket_channel: - dependency: transitive - description: - name: web_socket_channel - sha256: "3a969ddcc204a3e34e863d204b29c0752716f78b6f9cc8235083208d268a4ccd" - url: "https://pub.dev" - source: hosted - version: "2.2.0" - webdriver: - dependency: transitive - description: - name: webdriver - sha256: "3c923e918918feeb90c4c9fdf1fe39220fa4c0e8e2c0fffaded174498ef86c49" - url: "https://pub.dev" - source: hosted - version: "3.0.2" - webkit_inspection_protocol: - dependency: transitive - description: - name: webkit_inspection_protocol - sha256: f66577ed748712574b076e48a300aa3d8bc7aba93e83490c679707187e135ee4 - url: "https://pub.dev" - source: hosted - version: "1.1.0" - win32: - dependency: transitive - description: - name: win32 - sha256: c0e3a4f7be7dae51d8f152230b86627e3397c1ba8c3fa58e63d44a9f3edc9cef - url: "https://pub.dev" - source: hosted - version: "2.6.1" - xdg_directories: - dependency: transitive - description: - name: xdg_directories - sha256: "060b6e1c891d956f72b5ac9463466c37cce3fa962a921532fc001e86fe93438e" - url: "https://pub.dev" - source: hosted - version: "0.2.0+1" - xml: - dependency: transitive - description: - name: xml - sha256: ac0e3f4bf00ba2708c33fbabbbe766300e509f8c82dbd4ab6525039813f7e2fb - url: "https://pub.dev" - source: hosted - version: "6.1.0" - yaml: - dependency: transitive - description: - name: yaml - sha256: "23812a9b125b48d4007117254bca50abb6c712352927eece9e155207b1db2370" - url: "https://pub.dev" - source: hosted - version: "3.1.1" -sdks: - dart: ">=3.1.0-185.0.dev <4.0.0" - flutter: ">=3.0.0" diff --git a/example/pubspec.yaml b/example/pubspec.yaml deleted file mode 100644 index 5ff9304..0000000 --- a/example/pubspec.yaml +++ /dev/null @@ -1,36 +0,0 @@ -name: flutter_twilio_conversations_example -description: Demonstrates how to use the flutter_twilio_conversations plugin. -publish_to: 'none' -version: 0.0.1+1 - -environment: - sdk: ">=2.14.0 <3.0.0" - -dependencies: - flutter: - sdk: flutter - - redux: ^5.0.0 - flutter_redux: ^0.8.2 - redux_epics: ^0.15.0 - equatable: ^2.0.3 - flutter_local_notifications: ^9.1.5 - fluttertoast: ^8.0.8 - cached_network_image: ^3.2.0 - permission_handler: ^8.3.0 - device_info_plus: ^3.2.1 - image_picker: ^0.8.4+4 - - cupertino_icons: ^1.0.4 - -dev_dependencies: - flutter_driver: - sdk: flutter - test: any - flutter_lints: ^1.0.4 - flutter_twilio_conversations: - path: ../ - -flutter: - uses-material-design: true - diff --git a/example/test/widget_test.dart b/example/test/widget_test.dart deleted file mode 100644 index b0e4828..0000000 --- a/example/test/widget_test.dart +++ /dev/null @@ -1,12 +0,0 @@ -// This is a basic Flutter widget test. -// -// To perform an interaction with a widget in your test, use the WidgetTester -// utility that Flutter provides. For example, you can send tap and scroll -// gestures. You can also use WidgetTester to find child widgets in the widget -// tree, read text, and verify that the values of widget properties are correct. - -import 'package:flutter_test/flutter_test.dart'; - -void main() { - testWidgets('Creates Example', (WidgetTester tester) async {}); -} diff --git a/ios/.gitignore b/ios/.gitignore deleted file mode 100644 index aa479fd..0000000 --- a/ios/.gitignore +++ /dev/null @@ -1,37 +0,0 @@ -.idea/ -.vagrant/ -.sconsign.dblite -.svn/ - -.DS_Store -*.swp -profile - -DerivedData/ -build/ -GeneratedPluginRegistrant.h -GeneratedPluginRegistrant.m - -.generated/ - -*.pbxuser -*.mode1v3 -*.mode2v3 -*.perspectivev3 - -!default.pbxuser -!default.mode1v3 -!default.mode2v3 -!default.perspectivev3 - -xcuserdata - -*.moved-aside - -*.pyc -*sync/ -Icon? -.tags* - -/Flutter/Generated.xcconfig -/Flutter/flutter_export_environment.sh \ No newline at end of file diff --git a/ios/.swiftlint.yml b/ios/.swiftlint.yml deleted file mode 100644 index abc6edb..0000000 --- a/ios/.swiftlint.yml +++ /dev/null @@ -1,21 +0,0 @@ -# See https://realm.github.io/SwiftLint/rule-directory.html for more information - -line_length: 240 - -identifier_name: - min_length: 2 - -type_name: - max_length: 50 - -cyclomatic_complexity: - ignores_case_statements: true - -opt_in_rules: - - vertical_whitespace_opening_braces - - vertical_whitespace_closing_braces - - yoda_condition - -disabled_rules: - - switch_case_alignment - - todo \ No newline at end of file diff --git a/ios/Assets/.gitkeep b/ios/Assets/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/ios/Classes/Methods/MessageMethods.swift b/ios/Classes/Methods/MessageMethods.swift index f9f7186..7527bf8 100644 --- a/ios/Classes/Methods/MessageMethods.swift +++ b/ios/Classes/Methods/MessageMethods.swift @@ -106,10 +106,16 @@ public class MessageMethods { if result.isSuccessful, let channel = channel { channel.message(withIndex: messageIndex, completion: { (result: TCHResult, message: TCHMessage?) in if result.isSuccessful, let message = message { - message.getTemporaryContentUrlsForAttachedMedia(completion: { (result: TCHResult, urls: Optional>) in + let newmediaList = message.attachedMedia + + message.getTemporaryContentUrlsFor(media: Set(newmediaList),completion: { (result: TCHResult, urls: Optional>) in if result.isSuccessful, let urls = urls { + var allUrls: [String] = [] SwiftTwilioConversationsPlugin.debug("getMedia => success: \(String(describing: urls[urls.keys.first!]))") - flutterResult(urls[urls.keys.first!]?.absoluteString) + for (key, value) in urls { + allUrls.append(value.absoluteString) + } + flutterResult(allUrls) } else { flutterResult(FlutterError(code: "ERROR", message: "Error getting media content url: \(String(describing: result.error))", details: nil)) } diff --git a/ios/Classes/Methods/MessagesMethods.swift b/ios/Classes/Methods/MessagesMethods.swift index 9354fca..8754f67 100644 --- a/ios/Classes/Methods/MessagesMethods.swift +++ b/ios/Classes/Methods/MessagesMethods.swift @@ -6,92 +6,99 @@ import UIKit public class MessagesMethods { // swiftlint:disable:next cyclomatic_complexity public static func sendMessage(_ call: FlutterMethodCall, result flutterResult: @escaping FlutterResult) { - guard let arguments = call.arguments as? [String: Any?], - let options = arguments["options"] as? [String: Any], - let channelSid = arguments["channelSid"] as? String else { - return flutterResult(FlutterError(code: "MISSING_PARAMS", message: "Missing parameters", details: nil)) + guard let arguments = call.arguments as? [String: Any?], + let options = arguments["options"] as? [String: Any], + let channelSid = arguments["channelSid"] as? String else { + return flutterResult(FlutterError(code: "MISSING_PARAMS", message: "Missing parameters", details: nil)) + } + + SwiftTwilioConversationsPlugin.debug("MessagesMethods.sendMessage => started") + + let mediaProgressListenerId = options["mediaProgressListenerId"] + + SwiftTwilioConversationsPlugin.chatListener?.chatClient?.conversation(withSidOrUniqueName: channelSid, completion: { (result: TCHResult, channel: TCHConversation?) in + guard result.isSuccessful, let channel = channel else { + return flutterResult(FlutterError(code: "ERROR", message: "Error retrieving conversation with sid '\(channelSid)'", details: nil)) } - - SwiftTwilioConversationsPlugin.debug("MessagesMethods.sendMessage => started") - let mediaProgressListenerId = options["mediaProgressListenerId"] + SwiftTwilioConversationsPlugin.debug("MessagesMethods.sendMessage => got conversation") + let messagePreparator = channel.prepareMessage() + + if let body = options["body"] as? String { + messagePreparator.setBody(body) + } - SwiftTwilioConversationsPlugin.chatListener?.chatClient?.conversation(withSidOrUniqueName: channelSid, completion: { (result: TCHResult, channel: TCHConversation?) in - if result.isSuccessful, let channel = channel { - SwiftTwilioConversationsPlugin.debug("MessagesMethods.sendMessage => got conversation") - let messagePreparator = channel.prepareMessage() - - if (options["body"] != nil) { - messagePreparator.setBody(options["body"] as? String) + if let attributesDict = options["attributes"] as? [String: Any?], !attributesDict.isEmpty { + let attributes = TCHJsonAttributes(dictionary: attributesDict as [AnyHashable: Any]) + messagePreparator.setAttributes(attributes, error: nil) + } + + if let inputList = options["input"] as? [String], + let mimeTypeList = options["mimeType"] as? [String], + let fileNameList = options["filename"] as? [String], + let mimeType = options["mimeType"] as? [String], !mimeType.isEmpty, + inputList.count == mimeTypeList.count && inputList.count == fileNameList.count { + + for i in 0.. onStarted") - if let id = mediaProgressListenerId, let sink = SwiftTwilioConversationsPlugin.mediaProgressSink { - sink(["mediaProgressListenerId": id, "name": "started"]) - } - }, - onProgress: {(bytes: UInt) in - if let id = mediaProgressListenerId, let sink = SwiftTwilioConversationsPlugin.mediaProgressSink { - sink(["mediaProgressListenerId": id, "name": "progress", "data": bytes]) - } - }, - onCompleted: {(mediaSid: String) in - SwiftTwilioConversationsPlugin.debug("MessagesMethods.sendMessage (Message.addMedia) => onCompleted") - if let id = mediaProgressListenerId, let sink = SwiftTwilioConversationsPlugin.mediaProgressSink { - sink(["mediaProgressListenerId": id, "name": "completed", "data": mediaSid]) - } - }, - onFailed: {(error : Error) in - SwiftTwilioConversationsPlugin.debug("MessagesMethods.sendMessage (Message.addMedia) => onFailed") - if let id = mediaProgressListenerId, let sink = SwiftTwilioConversationsPlugin.mediaProgressSink { - sink(["mediaProgressListenerId": id, "name": "failed"]) - } - } - ) - ).buildAndSend(completion: { - (result: TCHResult, message: TCHMessage?) in - if result.isSuccessful, let message = message { - SwiftTwilioConversationsPlugin.debug("MessagesMethods.sendMessage (Message.sendMessage) => onSuccess") - flutterResult(Mapper.messageToDict(message, channelSid: channelSid)) - } else { - SwiftTwilioConversationsPlugin.debug("MessagesMethods.sendMessage (Message.sendMessage) => onError: \(String(describing: result.error))") - flutterResult(FlutterError(code: "ERROR", message: "Error sending message with options `\(String(describing: messagePreparator))`", details: nil)) - } - }) + messagePreparator.addMedia(inputStream: inputStream, contentType: mimeType[i], filename: fileNameList[i], listener: .init( + onStarted: { + SwiftTwilioConversationsPlugin.debug("MessagesMethods.sendMessage (Message.addMedia) => onStarted") + if let id = mediaProgressListenerId, let sink = SwiftTwilioConversationsPlugin.mediaProgressSink { + sink(["mediaProgressListenerId": id, "name": "started"]) + } + }, + onProgress: {(bytes: UInt) in + if let id = mediaProgressListenerId, let sink = SwiftTwilioConversationsPlugin.mediaProgressSink { + sink(["mediaProgressListenerId": id, "name": "progress", "data": bytes]) + } + }, + onCompleted: {(mediaSid: String) in + SwiftTwilioConversationsPlugin.debug("MessagesMethods.sendMessage (Message.addMedia) => onCompleted") + if let id = mediaProgressListenerId, let sink = SwiftTwilioConversationsPlugin.mediaProgressSink { + sink(["mediaProgressListenerId": id, "name": "completed", "data": mediaSid]) + } + }, + onFailed: {(error: Error) in + SwiftTwilioConversationsPlugin.debug("MessagesMethods.sendMessage (Message.addMedia) => onFailed") + if let id = mediaProgressListenerId, let sink = SwiftTwilioConversationsPlugin.mediaProgressSink { + sink(["mediaProgressListenerId": id, "name": "failed"]) + } } + ) + ) + } + + messagePreparator.buildAndSend(completion: { (result: TCHResult, message: TCHMessage?) in + if result.isSuccessful, let message = message { + SwiftTwilioConversationsPlugin.debug("MessagesMethods.sendMessage (Message.sendMessage) => onSuccess") + flutterResult(Mapper.messageToDict(message, channelSid: channelSid)) } else { - messagePreparator.buildAndSend(completion: { - (result: TCHResult, message: TCHMessage?) in - if result.isSuccessful, let message = message { - SwiftTwilioConversationsPlugin.debug("MessagesMethods.sendMessage (Message.sendMessage) => onSuccess") - flutterResult(Mapper.messageToDict(message, channelSid: channelSid)) - } else { - SwiftTwilioConversationsPlugin.debug("MessagesMethods.sendMessage (Message.sendMessage) => onError: \(String(describing: result.error))") - flutterResult(FlutterError(code: "ERROR", message: "Error sending message with options `\(String(describing: messagePreparator))`", details: nil)) - } - }) + SwiftTwilioConversationsPlugin.debug("MessagesMethods.sendMessage (Message.sendMessage) => onError: \(String(describing: result.error))") + flutterResult(FlutterError(code: "ERROR", message: "Error sending message with options `\(String(describing: messagePreparator))`", details: nil)) } - } - }) - } + }) + + } else { + messagePreparator.buildAndSend(completion: { (result: TCHResult, message: TCHMessage?) in + if result.isSuccessful, let message = message { + SwiftTwilioConversationsPlugin.debug("MessagesMethods.sendMessage (Message.sendMessage) => onSuccess") + flutterResult(Mapper.messageToDict(message, channelSid: channelSid)) + } else { + SwiftTwilioConversationsPlugin.debug("MessagesMethods.sendMessage (Message.sendMessage) => onError: \(String(describing: result.error))") + flutterResult(FlutterError(code: "ERROR", message: "Error sending message with options `\(String(describing: messagePreparator))`", details: nil)) + } + }) + } + }) +} + + public static func removeMessage(_ call: FlutterMethodCall, result flutterResult: @escaping FlutterResult) { guard let arguments = call.arguments as? [String: Any?], diff --git a/lib/src/message_media.dart b/lib/src/message_media.dart index 3e0bac4..140254c 100644 --- a/lib/src/message_media.dart +++ b/lib/src/message_media.dart @@ -67,12 +67,22 @@ class MessageMedia { /// Save media content stream that could be streamed or downloaded by client. /// /// Provided file could be an existing file and a none existing file. - Future getDownloadURL() async { - return await TwilioConversationsClient._methodChannel + Future> getDownloadURL() async { + final data = await TwilioConversationsClient._methodChannel .invokeMethod('Message#getMedia', { 'channelSid': _channelSid, 'messageIndex': _messageIndex, }); + List images = []; + for (var element in data) { + images.add(element.toString()); + } + (data as List).map((element) { + log(element.toString()); + }); + log("twilio media message bata aako sakiyo"); + + return images; } //#endregion } diff --git a/lib/src/message_options.dart b/lib/src/message_options.dart index 5756709..27a346a 100644 --- a/lib/src/message_options.dart +++ b/lib/src/message_options.dart @@ -6,11 +6,11 @@ class MessageOptions { Map? _attributes; - File? _input; + List? _input; - String? _mimeType; + List? _mimeType; - String? _filename; + List? _filename; int? _mediaProgressListenerId; //#endregion @@ -35,18 +35,19 @@ class MessageOptions { /// Create message with given media stream. /// /// If you specify [MessageOptions.withMedia] then you will not be able to specify [MessageOptions.withBody] because they are mutually exclusive message types. Created message type will be [MessageType.MEDIA]. - void withMedia(File input, String mimeType) { + void withMedia(List input, List mimeType,List filename) { if (_body != null) { throw Exception('MessageOptions.withBody has already been specified'); } _input = input; _mimeType = mimeType; + _filename=filename; } /// Provide optional filename for media. - void withMediaFileName(String filename) { - _filename = filename; - } + // void withMediaFileName(String filename) { + // _filename = filename; + // } void withMediaProgressListener({ void Function()? onStarted, @@ -86,7 +87,7 @@ class MessageOptions { return { 'body': _body, 'attributes': _attributes, - 'input': _input?.path, + 'input': _input?.map((e) => e.path).toList(), 'mimeType': _mimeType, 'filename': _filename, 'mediaProgressListenerId': _mediaProgressListenerId, diff --git a/lib/src/parts.dart b/lib/src/parts.dart index 47311cc..ce3f42d 100644 --- a/lib/src/parts.dart +++ b/lib/src/parts.dart @@ -3,7 +3,7 @@ library flutter_twilio_conversations; import 'dart:async'; import 'dart:convert'; import 'dart:io'; - +import 'dart:developer'; import 'package:enum_to_string/enum_to_string.dart'; import 'package:flutter/services.dart'; diff --git a/pubspec.lock b/pubspec.lock deleted file mode 100644 index 57d5b4c..0000000 --- a/pubspec.lock +++ /dev/null @@ -1,189 +0,0 @@ -# Generated by pub -# See https://dart.dev/tools/pub/glossary#lockfile -packages: - async: - dependency: transitive - description: - name: async - sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" - url: "https://pub.dev" - source: hosted - version: "2.11.0" - boolean_selector: - dependency: transitive - description: - name: boolean_selector - sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" - url: "https://pub.dev" - source: hosted - version: "2.1.1" - characters: - dependency: transitive - description: - name: characters - sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" - url: "https://pub.dev" - source: hosted - version: "1.3.0" - clock: - dependency: transitive - description: - name: clock - sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf - url: "https://pub.dev" - source: hosted - version: "1.1.1" - collection: - dependency: transitive - description: - name: collection - sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 - url: "https://pub.dev" - source: hosted - version: "1.17.2" - enum_to_string: - dependency: "direct main" - description: - name: enum_to_string - sha256: bd9e83a33b754cb43a75b36a9af2a0b92a757bfd9847d2621ca0b1bed45f8e7a - url: "https://pub.dev" - source: hosted - version: "2.0.1" - fake_async: - dependency: transitive - description: - name: fake_async - sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" - url: "https://pub.dev" - source: hosted - version: "1.3.1" - flutter: - dependency: "direct main" - description: flutter - source: sdk - version: "0.0.0" - flutter_lints: - dependency: "direct dev" - description: - name: flutter_lints - sha256: b543301ad291598523947dc534aaddc5aaad597b709d2426d3a0e0d44c5cb493 - url: "https://pub.dev" - source: hosted - version: "1.0.4" - flutter_test: - dependency: "direct dev" - description: flutter - source: sdk - version: "0.0.0" - lints: - dependency: transitive - description: - name: lints - sha256: a2c3d198cb5ea2e179926622d433331d8b58374ab8f29cdda6e863bd62fd369c - url: "https://pub.dev" - source: hosted - version: "1.0.1" - matcher: - dependency: transitive - description: - name: matcher - sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" - url: "https://pub.dev" - source: hosted - version: "0.12.16" - material_color_utilities: - dependency: transitive - description: - name: material_color_utilities - sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" - url: "https://pub.dev" - source: hosted - version: "0.5.0" - meta: - dependency: transitive - description: - name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" - url: "https://pub.dev" - source: hosted - version: "1.9.1" - path: - dependency: transitive - description: - name: path - sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" - url: "https://pub.dev" - source: hosted - version: "1.8.3" - sky_engine: - dependency: transitive - description: flutter - source: sdk - version: "0.0.99" - source_span: - dependency: transitive - description: - name: source_span - sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" - url: "https://pub.dev" - source: hosted - version: "1.10.0" - stack_trace: - dependency: transitive - description: - name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 - url: "https://pub.dev" - source: hosted - version: "1.11.0" - stream_channel: - dependency: transitive - description: - name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" - url: "https://pub.dev" - source: hosted - version: "2.1.1" - string_scanner: - dependency: transitive - description: - name: string_scanner - sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" - url: "https://pub.dev" - source: hosted - version: "1.2.0" - term_glyph: - dependency: transitive - description: - name: term_glyph - sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 - url: "https://pub.dev" - source: hosted - version: "1.2.1" - test_api: - dependency: transitive - description: - name: test_api - sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" - url: "https://pub.dev" - source: hosted - version: "0.6.0" - vector_math: - dependency: transitive - description: - name: vector_math - sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" - url: "https://pub.dev" - source: hosted - version: "2.1.4" - web: - dependency: transitive - description: - name: web - sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 - url: "https://pub.dev" - source: hosted - version: "0.1.4-beta" -sdks: - dart: ">=3.1.0-185.0.dev <4.0.0" - flutter: ">=1.17.0"