├── .gitignore ├── .metadata ├── CHANGELOG.md ├── LICENSE ├── README.md ├── android ├── .gitignore ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties ├── settings.gradle └── src │ └── main │ ├── AndroidManifest.xml │ └── kotlin │ └── com │ └── scientifichackers │ └── aws_iot │ └── AwsIotPlugin.kt ├── example ├── .gitignore ├── .metadata ├── README.md ├── android │ ├── app │ │ ├── build.gradle │ │ └── src │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── kotlin │ │ │ │ └── com │ │ │ │ │ └── scientifichackers │ │ │ │ │ └── aws_iot_example │ │ │ │ │ └── MainActivity.kt │ │ │ └── res │ │ │ │ ├── drawable │ │ │ │ └── launch_background.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ └── values │ │ │ │ └── styles.xml │ │ │ └── profile │ │ │ └── AndroidManifest.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ └── settings.gradle ├── assets │ └── .env.example ├── ios │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ └── Release.xcconfig │ ├── Podfile │ ├── Podfile.lock │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── Runner │ │ ├── AppDelegate.swift │ │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ └── LaunchImage.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ └── README.md │ │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ │ ├── Info.plist │ │ └── Runner-Bridging-Header.h ├── lib │ └── main.dart ├── pubspec.lock └── pubspec.yaml ├── ios ├── .gitignore ├── Assets │ └── .gitkeep ├── Classes │ ├── AwsIotPlugin.h │ ├── AwsIotPlugin.m │ └── SwiftAwsIotPlugin.swift └── aws_iot.podspec ├── lib ├── aws_iot.dart └── src │ ├── client.dart │ └── consts.dart ├── pubspec.lock └── pubspec.yaml /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .dart_tool/ 3 | 4 | .packages 5 | .pub/ 6 | 7 | build/ 8 | 9 | *.iml 10 | .idea 11 | **/awsconfiguration.json 12 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 68587a0916366e9512a78df22c44163d041dd5f3 8 | channel: stable 9 | 10 | project_type: plugin 11 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.0.1 2 | 3 | * TODO: Describe initial release. 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | TODO: Add your license here. 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Flutter AWS IoT 2 | 3 | [![Pub](https://img.shields.io/pub/v/aws_iot.svg?style=for-the-badge)](https://pub.dartlang.org/packages/aws_iot) 4 | 5 | AWS IoT plugin for flutter, intended to fit nicely with [flutter_cognito_plugin](https://github.com/scientifichackers/flutter_cognito_plugin) and [mqtt_client](https://pub.dev/packages/mqtt_client). 6 | 7 | - Basic pub/sub functionality. 8 | - Supports [AttachPolicy](https://docs.aws.amazon.com/iot/latest/apireference/API_AttachPolicy.html), which is needed to make cognito identity auth work with aws iot. 9 | - Automatically handles cognito identity auth in the background. 10 | 11 | # Install 12 | 13 | - Use flutter plugin installation instructions on [Dart Pub](https://pub.dev/packages/aws_iot#-installing-tab-). 14 | - Ensure `platform :ios, '9.0'` at `ios/Podfile`. 15 | - Add `awsconfiguration.json` by following instructions at [flutter_cognito_plugin](https://github.com/scientifichackers/flutter_cognito_plugin) for Android/iOS. 16 | 17 | ## Example app 18 | 19 | - Clone 20 | 21 | ``` 22 | git clone https://github.com/IoTReady/flutter-aws-iot.git 23 | cd example 24 | cp assets/.env.example assets/.env 25 | ``` 26 | 27 | - Edit `example/assets/.env` file, and fill in the proper credentials. 28 | 29 | - Add `awsconfiguration.json` to the `example` app, by following instructions at [flutter_cognito_plugin](https://github.com/scientifichackers/flutter_cognito_plugin) for both Android/iOS. 30 | 31 | - Run 32 | 33 | ``` 34 | flutter run 35 | ``` 36 | 37 | ## Prior art 38 | 39 | - [aws_iot_device](https://pub.dev/packages/aws_iot_device) 40 | 41 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | group 'com.scientifichackers.aws_iot' 2 | version '1.0-SNAPSHOT' 3 | 4 | buildscript { 5 | ext.kotlin_version = '1.3.50' 6 | repositories { 7 | google() 8 | jcenter() 9 | } 10 | 11 | dependencies { 12 | classpath 'com.android.tools.build:gradle:3.4.2' 13 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 14 | } 15 | } 16 | 17 | rootProject.allprojects { 18 | repositories { 19 | google() 20 | jcenter() 21 | } 22 | } 23 | 24 | apply plugin: 'com.android.library' 25 | apply plugin: 'kotlin-android' 26 | 27 | android { 28 | compileSdkVersion 28 29 | 30 | sourceSets { 31 | main.java.srcDirs += 'src/main/kotlin' 32 | } 33 | defaultConfig { 34 | minSdkVersion 16 35 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 36 | } 37 | lintOptions { 38 | disable 'InvalidPackage' 39 | } 40 | } 41 | 42 | dependencies { 43 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 44 | implementation ('com.amazonaws:aws-android-sdk-iot:2.16.4') { transitive = true } 45 | implementation ('com.amazonaws:aws-android-sdk-mobile-client:2.16.4') { transitive = true } 46 | implementation project(path: ':plugin_scaffold') 47 | } 48 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | 3 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip 6 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'aws_iot' 2 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | -------------------------------------------------------------------------------- /android/src/main/kotlin/com/scientifichackers/aws_iot/AwsIotPlugin.kt: -------------------------------------------------------------------------------- 1 | package com.scientifichackers.aws_iot 2 | 3 | import android.content.Context 4 | import com.amazonaws.mobile.client.AWSMobileClient 5 | import com.amazonaws.regions.Region 6 | import com.amazonaws.services.iot.AWSIotClient 7 | import com.amazonaws.services.iot.model.AttachPolicyRequest 8 | import com.pycampers.plugin_scaffold.createPluginScaffold 9 | import io.flutter.plugin.common.MethodCall 10 | import io.flutter.plugin.common.MethodChannel.Result 11 | import io.flutter.plugin.common.PluginRegistry.Registrar 12 | 13 | class AwsIotPlugin { 14 | companion object { 15 | @JvmStatic 16 | fun registerWith(registrar: Registrar) { 17 | createPluginScaffold( 18 | registrar.messenger(), 19 | "com.scientifichackers.aws_iot", 20 | AwsIotMethods(registrar.context()) 21 | ) 22 | } 23 | } 24 | } 25 | 26 | class AwsIotMethods(val context: Context) { 27 | val mobileClient = AWSMobileClient.getInstance() 28 | 29 | fun attachPolicy(call: MethodCall, result: Result) { 30 | val identityId = call.argument("identityId")!! 31 | val policyName = call.argument("policyName")!! 32 | val region = call.argument("region")!! 33 | 34 | val attachPolicyReq = AttachPolicyRequest() 35 | attachPolicyReq.policyName = policyName 36 | attachPolicyReq.target = identityId 37 | 38 | val iotClient = AWSIotClient(mobileClient) 39 | iotClient.setRegion(Region.getRegion(region)) 40 | iotClient.attachPolicy(attachPolicyReq) 41 | 42 | result.success(null) 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | assets/.env 2 | 3 | # Miscellaneous 4 | *.class 5 | *.log 6 | *.pyc 7 | *.swp 8 | .DS_Store 9 | .atom/ 10 | .buildlog/ 11 | .history 12 | .svn/ 13 | 14 | # IntelliJ related 15 | *.iml 16 | *.ipr 17 | *.iws 18 | .idea/ 19 | 20 | # The .vscode folder contains launch configuration and tasks you configure in 21 | # VS Code which you may wish to be included in version control, so this line 22 | # is commented out by default. 23 | #.vscode/ 24 | 25 | # Flutter/Dart/Pub related 26 | **/doc/api/ 27 | .dart_tool/ 28 | .flutter-plugins 29 | .packages 30 | .pub-cache/ 31 | .pub/ 32 | /build/ 33 | 34 | # Android related 35 | **/android/**/gradle-wrapper.jar 36 | **/android/.gradle 37 | **/android/captures/ 38 | **/android/gradlew 39 | **/android/gradlew.bat 40 | **/android/local.properties 41 | **/android/**/GeneratedPluginRegistrant.java 42 | 43 | # iOS/XCode related 44 | **/ios/**/*.mode1v3 45 | **/ios/**/*.mode2v3 46 | **/ios/**/*.moved-aside 47 | **/ios/**/*.pbxuser 48 | **/ios/**/*.perspectivev3 49 | **/ios/**/*sync/ 50 | **/ios/**/.sconsign.dblite 51 | **/ios/**/.tags* 52 | **/ios/**/.vagrant/ 53 | **/ios/**/DerivedData/ 54 | **/ios/**/Icon? 55 | **/ios/**/Pods/ 56 | **/ios/**/.symlinks/ 57 | **/ios/**/profile 58 | **/ios/**/xcuserdata 59 | **/ios/.generated/ 60 | **/ios/Flutter/App.framework 61 | **/ios/Flutter/Flutter.framework 62 | **/ios/Flutter/Generated.xcconfig 63 | **/ios/Flutter/app.flx 64 | **/ios/Flutter/app.zip 65 | **/ios/Flutter/flutter_assets/ 66 | **/ios/Flutter/flutter_export_environment.sh 67 | **/ios/ServiceDefinitions.json 68 | **/ios/Runner/GeneratedPluginRegistrant.* 69 | 70 | # Exceptions to above rules. 71 | !**/ios/**/default.mode1v3 72 | !**/ios/**/default.mode2v3 73 | !**/ios/**/default.pbxuser 74 | !**/ios/**/default.perspectivev3 75 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 76 | -------------------------------------------------------------------------------- /example/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 68587a0916366e9512a78df22c44163d041dd5f3 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # aws_iot_example 2 | 3 | Demonstrates how to use the aws_iot plugin. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started if this is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) 13 | 14 | For help getting started with Flutter, view our 15 | [online documentation](https://flutter.dev/docs), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion 28 30 | 31 | sourceSets { 32 | main.java.srcDirs += 'src/main/kotlin' 33 | } 34 | 35 | lintOptions { 36 | disable 'InvalidPackage' 37 | } 38 | 39 | defaultConfig { 40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 41 | applicationId "com.scientifichackers.aws_iot_example" 42 | minSdkVersion 16 43 | targetSdkVersion 28 44 | versionCode flutterVersionCode.toInteger() 45 | versionName flutterVersionName 46 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 47 | } 48 | 49 | buildTypes { 50 | release { 51 | // TODO: Add your own signing config for the release build. 52 | // Signing with the debug keys for now, so `flutter run --release` works. 53 | signingConfig signingConfigs.debug 54 | } 55 | } 56 | } 57 | 58 | flutter { 59 | source '../..' 60 | } 61 | 62 | dependencies { 63 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 64 | testImplementation 'junit:junit:4.12' 65 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 66 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 67 | } 68 | -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 9 | 13 | 20 | 24 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /example/android/app/src/main/kotlin/com/scientifichackers/aws_iot_example/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.scientifichackers.aws_iot_example 2 | 3 | import android.os.Bundle 4 | 5 | import io.flutter.app.FlutterActivity 6 | import io.flutter.plugins.GeneratedPluginRegistrant 7 | 8 | class MainActivity: FlutterActivity() { 9 | override fun onCreate(savedInstanceState: Bundle?) { 10 | super.onCreate(savedInstanceState) 11 | GeneratedPluginRegistrant.registerWith(this) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IoTReady/flutter-aws-iot/885a76fd6214bde78962d7bb4bdef8f6bc8e1dd4/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IoTReady/flutter-aws-iot/885a76fd6214bde78962d7bb4bdef8f6bc8e1dd4/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IoTReady/flutter-aws-iot/885a76fd6214bde78962d7bb4bdef8f6bc8e1dd4/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IoTReady/flutter-aws-iot/885a76fd6214bde78962d7bb4bdef8f6bc8e1dd4/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IoTReady/flutter-aws-iot/885a76fd6214bde78962d7bb4bdef8f6bc8e1dd4/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.2.71' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.2.1' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | jcenter() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | 3 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip 7 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() 4 | 5 | def plugins = new Properties() 6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') 7 | if (pluginsFile.exists()) { 8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } 9 | } 10 | 11 | plugins.each { name, path -> 12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() 13 | include ":$name" 14 | project(":$name").projectDir = pluginDirectory 15 | } 16 | -------------------------------------------------------------------------------- /example/assets/.env.example: -------------------------------------------------------------------------------- 1 | USERNAME=awesome_soul 2 | PASSWORD=password 3 | POLICY_NAME=MyIotPolicy 4 | REGION=ap-south-1 5 | ENDPOINT=xxx-ats.iot.xxx.amazonaws.com 6 | CLIENT_ID=myThingClient 7 | -------------------------------------------------------------------------------- /example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | platform :ios, '9.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def parse_KV_file(file, separator='=') 14 | file_abs_path = File.expand_path(file) 15 | if !File.exists? file_abs_path 16 | return []; 17 | end 18 | pods_ary = [] 19 | skip_line_start_symbols = ["#", "/"] 20 | File.foreach(file_abs_path) { |line| 21 | next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ } 22 | plugin = line.split(pattern=separator) 23 | if plugin.length == 2 24 | podname = plugin[0].strip() 25 | path = plugin[1].strip() 26 | podpath = File.expand_path("#{path}", file_abs_path) 27 | pods_ary.push({:name => podname, :path => podpath}); 28 | else 29 | puts "Invalid plugin specification: #{line}" 30 | end 31 | } 32 | return pods_ary 33 | end 34 | 35 | target 'Runner' do 36 | use_frameworks! 37 | 38 | # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock 39 | # referring to absolute paths on developers' machines. 40 | system('rm -rf .symlinks') 41 | system('mkdir -p .symlinks/plugins') 42 | 43 | # Flutter Pods 44 | generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig') 45 | if generated_xcode_build_settings.empty? 46 | puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first." 47 | end 48 | generated_xcode_build_settings.map { |p| 49 | if p[:name] == 'FLUTTER_FRAMEWORK_DIR' 50 | symlink = File.join('.symlinks', 'flutter') 51 | File.symlink(File.dirname(p[:path]), symlink) 52 | pod 'Flutter', :path => File.join(symlink, File.basename(p[:path])) 53 | end 54 | } 55 | 56 | # Plugin Pods 57 | plugin_pods = parse_KV_file('../.flutter-plugins') 58 | plugin_pods.map { |p| 59 | symlink = File.join('.symlinks', 'plugins', p[:name]) 60 | File.symlink(p[:path], symlink) 61 | pod p[:name], :path => File.join(symlink, 'ios') 62 | } 63 | end 64 | 65 | # Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system. 66 | install! 'cocoapods', :disable_input_output_paths => true 67 | 68 | post_install do |installer| 69 | installer.pods_project.targets.each do |target| 70 | target.build_configurations.each do |config| 71 | config.build_settings['ENABLE_BITCODE'] = 'NO' 72 | end 73 | end 74 | end 75 | -------------------------------------------------------------------------------- /example/ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - aws_iot (0.0.1): 3 | - AWSIoT (~> 2.11.0) 4 | - AWSMobileClient (~> 2.11.0) 5 | - Flutter 6 | - plugin_scaffold 7 | - AWSAuthCore (2.11.1): 8 | - AWSCore (= 2.11.1) 9 | - AWSCognitoIdentityProvider (2.11.1): 10 | - AWSCognitoIdentityProviderASF (= 1.0.1) 11 | - AWSCore (= 2.11.1) 12 | - AWSCognitoIdentityProviderASF (1.0.1) 13 | - AWSCore (2.11.1) 14 | - AWSIoT (2.11.1): 15 | - AWSCore (= 2.11.1) 16 | - AWSMobileClient (2.11.1): 17 | - AWSAuthCore (= 2.11.1) 18 | - AWSCognitoIdentityProvider (= 2.11.1) 19 | - Flutter (1.0.0) 20 | - flutter_cognito_plugin (0.0.1): 21 | - AWSMobileClient (~> 2.11.0) 22 | - Flutter 23 | - plugin_scaffold 24 | - plugin_scaffold (0.0.1): 25 | - Flutter 26 | 27 | DEPENDENCIES: 28 | - aws_iot (from `.symlinks/plugins/aws_iot/ios`) 29 | - Flutter (from `.symlinks/flutter/ios`) 30 | - flutter_cognito_plugin (from `.symlinks/plugins/flutter_cognito_plugin/ios`) 31 | - plugin_scaffold (from `.symlinks/plugins/plugin_scaffold/ios`) 32 | 33 | SPEC REPOS: 34 | trunk: 35 | - AWSAuthCore 36 | - AWSCognitoIdentityProvider 37 | - AWSCognitoIdentityProviderASF 38 | - AWSCore 39 | - AWSIoT 40 | - AWSMobileClient 41 | 42 | EXTERNAL SOURCES: 43 | aws_iot: 44 | :path: ".symlinks/plugins/aws_iot/ios" 45 | Flutter: 46 | :path: ".symlinks/flutter/ios" 47 | flutter_cognito_plugin: 48 | :path: ".symlinks/plugins/flutter_cognito_plugin/ios" 49 | plugin_scaffold: 50 | :path: ".symlinks/plugins/plugin_scaffold/ios" 51 | 52 | SPEC CHECKSUMS: 53 | aws_iot: 97d575d0fe12786ec93a11fe2be4e59336727c63 54 | AWSAuthCore: 23545c33485f2e92acde3e7458e6ee07410e7f28 55 | AWSCognitoIdentityProvider: 81fe83bd5b05151250346eedbabdb055b509d439 56 | AWSCognitoIdentityProviderASF: f94f1a502e72ef3d0a1de93e10bf7a79c8698118 57 | AWSCore: 00093a1ff49b5d6ce5f1e4d83fe301486fc5034d 58 | AWSIoT: 3db9287c5722b84bec60d147063795d8ba62ed77 59 | AWSMobileClient: 1acbe6ae32ebe5899425ac33d89491e4608da393 60 | Flutter: 0e3d915762c693b495b44d77113d4970485de6ec 61 | flutter_cognito_plugin: 12b6627514b887914305da26e17ca87aae67bbac 62 | plugin_scaffold: e7c52bc1cfb6e672959f798dfc9dea8dff55daeb 63 | 64 | PODFILE CHECKSUM: 2c26e2bafa90f053205a9e99ab1fdce88251e293 65 | 66 | COCOAPODS: 1.8.4 67 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 12 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; 13 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 14 | 73DE37B1EBEAA1C1A2C27B66 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F03D2E50C1B30B98A02D18F1 /* Pods_Runner.framework */; }; 15 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 16 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; 17 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 18 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; 19 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 20 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 21 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 22 | D7340A82239127F70022ADD4 /* awsconfiguration.json in Resources */ = {isa = PBXBuildFile; fileRef = D7340A81239127F70022ADD4 /* awsconfiguration.json */; }; 23 | /* End PBXBuildFile section */ 24 | 25 | /* Begin PBXCopyFilesBuildPhase section */ 26 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 27 | isa = PBXCopyFilesBuildPhase; 28 | buildActionMask = 2147483647; 29 | dstPath = ""; 30 | dstSubfolderSpec = 10; 31 | files = ( 32 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, 33 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, 34 | ); 35 | name = "Embed Frameworks"; 36 | runOnlyForDeploymentPostprocessing = 0; 37 | }; 38 | /* End PBXCopyFilesBuildPhase section */ 39 | 40 | /* Begin PBXFileReference section */ 41 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 42 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 43 | 2704FAC325C195F49CD7E1C5 /* 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 = ""; }; 44 | 328CE96B0EA00ED28A493E30 /* 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 = ""; }; 45 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 46 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; 47 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 48 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 49 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 50 | 8CB5076119F25C5BA37CCE09 /* 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 = ""; }; 51 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 52 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 53 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; 54 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 55 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 56 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 57 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 58 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 59 | D7340A81239127F70022ADD4 /* awsconfiguration.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = awsconfiguration.json; path = ../../android/app/src/main/res/raw/awsconfiguration.json; sourceTree = ""; }; 60 | F03D2E50C1B30B98A02D18F1 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 61 | /* End PBXFileReference section */ 62 | 63 | /* Begin PBXFrameworksBuildPhase section */ 64 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 65 | isa = PBXFrameworksBuildPhase; 66 | buildActionMask = 2147483647; 67 | files = ( 68 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, 69 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, 70 | 73DE37B1EBEAA1C1A2C27B66 /* Pods_Runner.framework in Frameworks */, 71 | ); 72 | runOnlyForDeploymentPostprocessing = 0; 73 | }; 74 | /* End PBXFrameworksBuildPhase section */ 75 | 76 | /* Begin PBXGroup section */ 77 | 5B54B06593C8A6BD87479282 /* Frameworks */ = { 78 | isa = PBXGroup; 79 | children = ( 80 | F03D2E50C1B30B98A02D18F1 /* Pods_Runner.framework */, 81 | ); 82 | name = Frameworks; 83 | sourceTree = ""; 84 | }; 85 | 9740EEB11CF90186004384FC /* Flutter */ = { 86 | isa = PBXGroup; 87 | children = ( 88 | 3B80C3931E831B6300D905FE /* App.framework */, 89 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 90 | 9740EEBA1CF902C7004384FC /* Flutter.framework */, 91 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 92 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 93 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 94 | ); 95 | name = Flutter; 96 | sourceTree = ""; 97 | }; 98 | 97C146E51CF9000F007C117D = { 99 | isa = PBXGroup; 100 | children = ( 101 | 9740EEB11CF90186004384FC /* Flutter */, 102 | 97C146F01CF9000F007C117D /* Runner */, 103 | 97C146EF1CF9000F007C117D /* Products */, 104 | C9DF587F6A303806F49442CC /* Pods */, 105 | 5B54B06593C8A6BD87479282 /* Frameworks */, 106 | ); 107 | sourceTree = ""; 108 | }; 109 | 97C146EF1CF9000F007C117D /* Products */ = { 110 | isa = PBXGroup; 111 | children = ( 112 | 97C146EE1CF9000F007C117D /* Runner.app */, 113 | ); 114 | name = Products; 115 | sourceTree = ""; 116 | }; 117 | 97C146F01CF9000F007C117D /* Runner */ = { 118 | isa = PBXGroup; 119 | children = ( 120 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 121 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 122 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 123 | 97C147021CF9000F007C117D /* Info.plist */, 124 | 97C146F11CF9000F007C117D /* Supporting Files */, 125 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 126 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 127 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 128 | D7340A81239127F70022ADD4 /* awsconfiguration.json */, 129 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 130 | ); 131 | path = Runner; 132 | sourceTree = ""; 133 | }; 134 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 135 | isa = PBXGroup; 136 | children = ( 137 | ); 138 | name = "Supporting Files"; 139 | sourceTree = ""; 140 | }; 141 | C9DF587F6A303806F49442CC /* Pods */ = { 142 | isa = PBXGroup; 143 | children = ( 144 | 8CB5076119F25C5BA37CCE09 /* Pods-Runner.debug.xcconfig */, 145 | 2704FAC325C195F49CD7E1C5 /* Pods-Runner.release.xcconfig */, 146 | 328CE96B0EA00ED28A493E30 /* Pods-Runner.profile.xcconfig */, 147 | ); 148 | path = Pods; 149 | sourceTree = ""; 150 | }; 151 | /* End PBXGroup section */ 152 | 153 | /* Begin PBXNativeTarget section */ 154 | 97C146ED1CF9000F007C117D /* Runner */ = { 155 | isa = PBXNativeTarget; 156 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 157 | buildPhases = ( 158 | CF59057961712050C2F02FC4 /* [CP] Check Pods Manifest.lock */, 159 | 9740EEB61CF901F6004384FC /* Run Script */, 160 | 97C146EA1CF9000F007C117D /* Sources */, 161 | 97C146EB1CF9000F007C117D /* Frameworks */, 162 | 97C146EC1CF9000F007C117D /* Resources */, 163 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 164 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 165 | 078AE625D41D024BC5EEFAFC /* [CP] Embed Pods Frameworks */, 166 | ); 167 | buildRules = ( 168 | ); 169 | dependencies = ( 170 | ); 171 | name = Runner; 172 | productName = Runner; 173 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 174 | productType = "com.apple.product-type.application"; 175 | }; 176 | /* End PBXNativeTarget section */ 177 | 178 | /* Begin PBXProject section */ 179 | 97C146E61CF9000F007C117D /* Project object */ = { 180 | isa = PBXProject; 181 | attributes = { 182 | LastUpgradeCheck = 1020; 183 | ORGANIZATIONNAME = "The Chromium Authors"; 184 | TargetAttributes = { 185 | 97C146ED1CF9000F007C117D = { 186 | CreatedOnToolsVersion = 7.3.1; 187 | LastSwiftMigration = 0910; 188 | }; 189 | }; 190 | }; 191 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 192 | compatibilityVersion = "Xcode 3.2"; 193 | developmentRegion = en; 194 | hasScannedForEncodings = 0; 195 | knownRegions = ( 196 | en, 197 | Base, 198 | ); 199 | mainGroup = 97C146E51CF9000F007C117D; 200 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 201 | projectDirPath = ""; 202 | projectRoot = ""; 203 | targets = ( 204 | 97C146ED1CF9000F007C117D /* Runner */, 205 | ); 206 | }; 207 | /* End PBXProject section */ 208 | 209 | /* Begin PBXResourcesBuildPhase section */ 210 | 97C146EC1CF9000F007C117D /* Resources */ = { 211 | isa = PBXResourcesBuildPhase; 212 | buildActionMask = 2147483647; 213 | files = ( 214 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 215 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 216 | D7340A82239127F70022ADD4 /* awsconfiguration.json in Resources */, 217 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, 218 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 219 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 220 | ); 221 | runOnlyForDeploymentPostprocessing = 0; 222 | }; 223 | /* End PBXResourcesBuildPhase section */ 224 | 225 | /* Begin PBXShellScriptBuildPhase section */ 226 | 078AE625D41D024BC5EEFAFC /* [CP] Embed Pods Frameworks */ = { 227 | isa = PBXShellScriptBuildPhase; 228 | buildActionMask = 2147483647; 229 | files = ( 230 | ); 231 | inputPaths = ( 232 | ); 233 | name = "[CP] Embed Pods Frameworks"; 234 | outputPaths = ( 235 | ); 236 | runOnlyForDeploymentPostprocessing = 0; 237 | shellPath = /bin/sh; 238 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; 239 | showEnvVarsInLog = 0; 240 | }; 241 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 242 | isa = PBXShellScriptBuildPhase; 243 | buildActionMask = 2147483647; 244 | files = ( 245 | ); 246 | inputPaths = ( 247 | ); 248 | name = "Thin Binary"; 249 | outputPaths = ( 250 | ); 251 | runOnlyForDeploymentPostprocessing = 0; 252 | shellPath = /bin/sh; 253 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; 254 | }; 255 | 9740EEB61CF901F6004384FC /* Run Script */ = { 256 | isa = PBXShellScriptBuildPhase; 257 | buildActionMask = 2147483647; 258 | files = ( 259 | ); 260 | inputPaths = ( 261 | ); 262 | name = "Run Script"; 263 | outputPaths = ( 264 | ); 265 | runOnlyForDeploymentPostprocessing = 0; 266 | shellPath = /bin/sh; 267 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 268 | }; 269 | CF59057961712050C2F02FC4 /* [CP] Check Pods Manifest.lock */ = { 270 | isa = PBXShellScriptBuildPhase; 271 | buildActionMask = 2147483647; 272 | files = ( 273 | ); 274 | inputFileListPaths = ( 275 | ); 276 | inputPaths = ( 277 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 278 | "${PODS_ROOT}/Manifest.lock", 279 | ); 280 | name = "[CP] Check Pods Manifest.lock"; 281 | outputFileListPaths = ( 282 | ); 283 | outputPaths = ( 284 | "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", 285 | ); 286 | runOnlyForDeploymentPostprocessing = 0; 287 | shellPath = /bin/sh; 288 | 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"; 289 | showEnvVarsInLog = 0; 290 | }; 291 | /* End PBXShellScriptBuildPhase section */ 292 | 293 | /* Begin PBXSourcesBuildPhase section */ 294 | 97C146EA1CF9000F007C117D /* Sources */ = { 295 | isa = PBXSourcesBuildPhase; 296 | buildActionMask = 2147483647; 297 | files = ( 298 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 299 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 300 | ); 301 | runOnlyForDeploymentPostprocessing = 0; 302 | }; 303 | /* End PBXSourcesBuildPhase section */ 304 | 305 | /* Begin PBXVariantGroup section */ 306 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 307 | isa = PBXVariantGroup; 308 | children = ( 309 | 97C146FB1CF9000F007C117D /* Base */, 310 | ); 311 | name = Main.storyboard; 312 | sourceTree = ""; 313 | }; 314 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 315 | isa = PBXVariantGroup; 316 | children = ( 317 | 97C147001CF9000F007C117D /* Base */, 318 | ); 319 | name = LaunchScreen.storyboard; 320 | sourceTree = ""; 321 | }; 322 | /* End PBXVariantGroup section */ 323 | 324 | /* Begin XCBuildConfiguration section */ 325 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 326 | isa = XCBuildConfiguration; 327 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 328 | buildSettings = { 329 | ALWAYS_SEARCH_USER_PATHS = NO; 330 | CLANG_ANALYZER_NONNULL = YES; 331 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 332 | CLANG_CXX_LIBRARY = "libc++"; 333 | CLANG_ENABLE_MODULES = YES; 334 | CLANG_ENABLE_OBJC_ARC = YES; 335 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 336 | CLANG_WARN_BOOL_CONVERSION = YES; 337 | CLANG_WARN_COMMA = YES; 338 | CLANG_WARN_CONSTANT_CONVERSION = YES; 339 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 340 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 341 | CLANG_WARN_EMPTY_BODY = YES; 342 | CLANG_WARN_ENUM_CONVERSION = YES; 343 | CLANG_WARN_INFINITE_RECURSION = YES; 344 | CLANG_WARN_INT_CONVERSION = YES; 345 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 346 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 347 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 348 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 349 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 350 | CLANG_WARN_STRICT_PROTOTYPES = YES; 351 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 352 | CLANG_WARN_UNREACHABLE_CODE = YES; 353 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 354 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 355 | COPY_PHASE_STRIP = NO; 356 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 357 | ENABLE_NS_ASSERTIONS = NO; 358 | ENABLE_STRICT_OBJC_MSGSEND = YES; 359 | GCC_C_LANGUAGE_STANDARD = gnu99; 360 | GCC_NO_COMMON_BLOCKS = YES; 361 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 362 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 363 | GCC_WARN_UNDECLARED_SELECTOR = YES; 364 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 365 | GCC_WARN_UNUSED_FUNCTION = YES; 366 | GCC_WARN_UNUSED_VARIABLE = YES; 367 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 368 | MTL_ENABLE_DEBUG_INFO = NO; 369 | SDKROOT = iphoneos; 370 | TARGETED_DEVICE_FAMILY = "1,2"; 371 | VALIDATE_PRODUCT = YES; 372 | }; 373 | name = Profile; 374 | }; 375 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 376 | isa = XCBuildConfiguration; 377 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 378 | buildSettings = { 379 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 380 | CLANG_ENABLE_MODULES = YES; 381 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 382 | ENABLE_BITCODE = NO; 383 | FRAMEWORK_SEARCH_PATHS = ( 384 | "$(inherited)", 385 | "$(PROJECT_DIR)/Flutter", 386 | ); 387 | INFOPLIST_FILE = Runner/Info.plist; 388 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 389 | LIBRARY_SEARCH_PATHS = ( 390 | "$(inherited)", 391 | "$(PROJECT_DIR)/Flutter", 392 | ); 393 | MARKETING_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 394 | PRODUCT_BUNDLE_IDENTIFIER = com.scientifichackers.awsIotExample; 395 | PRODUCT_NAME = "$(TARGET_NAME)"; 396 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 397 | SWIFT_VERSION = 4.0; 398 | VERSIONING_SYSTEM = "apple-generic"; 399 | }; 400 | name = Profile; 401 | }; 402 | 97C147031CF9000F007C117D /* Debug */ = { 403 | isa = XCBuildConfiguration; 404 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 405 | buildSettings = { 406 | ALWAYS_SEARCH_USER_PATHS = NO; 407 | CLANG_ANALYZER_NONNULL = YES; 408 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 409 | CLANG_CXX_LIBRARY = "libc++"; 410 | CLANG_ENABLE_MODULES = YES; 411 | CLANG_ENABLE_OBJC_ARC = YES; 412 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 413 | CLANG_WARN_BOOL_CONVERSION = YES; 414 | CLANG_WARN_COMMA = YES; 415 | CLANG_WARN_CONSTANT_CONVERSION = YES; 416 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 417 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 418 | CLANG_WARN_EMPTY_BODY = YES; 419 | CLANG_WARN_ENUM_CONVERSION = YES; 420 | CLANG_WARN_INFINITE_RECURSION = YES; 421 | CLANG_WARN_INT_CONVERSION = YES; 422 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 423 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 424 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 425 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 426 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 427 | CLANG_WARN_STRICT_PROTOTYPES = YES; 428 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 429 | CLANG_WARN_UNREACHABLE_CODE = YES; 430 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 431 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 432 | COPY_PHASE_STRIP = NO; 433 | DEBUG_INFORMATION_FORMAT = dwarf; 434 | ENABLE_STRICT_OBJC_MSGSEND = YES; 435 | ENABLE_TESTABILITY = YES; 436 | GCC_C_LANGUAGE_STANDARD = gnu99; 437 | GCC_DYNAMIC_NO_PIC = NO; 438 | GCC_NO_COMMON_BLOCKS = YES; 439 | GCC_OPTIMIZATION_LEVEL = 0; 440 | GCC_PREPROCESSOR_DEFINITIONS = ( 441 | "DEBUG=1", 442 | "$(inherited)", 443 | ); 444 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 445 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 446 | GCC_WARN_UNDECLARED_SELECTOR = YES; 447 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 448 | GCC_WARN_UNUSED_FUNCTION = YES; 449 | GCC_WARN_UNUSED_VARIABLE = YES; 450 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 451 | MTL_ENABLE_DEBUG_INFO = YES; 452 | ONLY_ACTIVE_ARCH = YES; 453 | SDKROOT = iphoneos; 454 | TARGETED_DEVICE_FAMILY = "1,2"; 455 | }; 456 | name = Debug; 457 | }; 458 | 97C147041CF9000F007C117D /* Release */ = { 459 | isa = XCBuildConfiguration; 460 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 461 | buildSettings = { 462 | ALWAYS_SEARCH_USER_PATHS = NO; 463 | CLANG_ANALYZER_NONNULL = YES; 464 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 465 | CLANG_CXX_LIBRARY = "libc++"; 466 | CLANG_ENABLE_MODULES = YES; 467 | CLANG_ENABLE_OBJC_ARC = YES; 468 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 469 | CLANG_WARN_BOOL_CONVERSION = YES; 470 | CLANG_WARN_COMMA = YES; 471 | CLANG_WARN_CONSTANT_CONVERSION = YES; 472 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 473 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 474 | CLANG_WARN_EMPTY_BODY = YES; 475 | CLANG_WARN_ENUM_CONVERSION = YES; 476 | CLANG_WARN_INFINITE_RECURSION = YES; 477 | CLANG_WARN_INT_CONVERSION = YES; 478 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 479 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 480 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 481 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 482 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 483 | CLANG_WARN_STRICT_PROTOTYPES = YES; 484 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 485 | CLANG_WARN_UNREACHABLE_CODE = YES; 486 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 487 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 488 | COPY_PHASE_STRIP = NO; 489 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 490 | ENABLE_NS_ASSERTIONS = NO; 491 | ENABLE_STRICT_OBJC_MSGSEND = YES; 492 | GCC_C_LANGUAGE_STANDARD = gnu99; 493 | GCC_NO_COMMON_BLOCKS = YES; 494 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 495 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 496 | GCC_WARN_UNDECLARED_SELECTOR = YES; 497 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 498 | GCC_WARN_UNUSED_FUNCTION = YES; 499 | GCC_WARN_UNUSED_VARIABLE = YES; 500 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 501 | MTL_ENABLE_DEBUG_INFO = NO; 502 | SDKROOT = iphoneos; 503 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 504 | TARGETED_DEVICE_FAMILY = "1,2"; 505 | VALIDATE_PRODUCT = YES; 506 | }; 507 | name = Release; 508 | }; 509 | 97C147061CF9000F007C117D /* Debug */ = { 510 | isa = XCBuildConfiguration; 511 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 512 | buildSettings = { 513 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 514 | CLANG_ENABLE_MODULES = YES; 515 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 516 | ENABLE_BITCODE = NO; 517 | FRAMEWORK_SEARCH_PATHS = ( 518 | "$(inherited)", 519 | "$(PROJECT_DIR)/Flutter", 520 | ); 521 | INFOPLIST_FILE = Runner/Info.plist; 522 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 523 | LIBRARY_SEARCH_PATHS = ( 524 | "$(inherited)", 525 | "$(PROJECT_DIR)/Flutter", 526 | ); 527 | MARKETING_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 528 | PRODUCT_BUNDLE_IDENTIFIER = com.scientifichackers.awsIotExample; 529 | PRODUCT_NAME = "$(TARGET_NAME)"; 530 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 531 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 532 | SWIFT_VERSION = 4.0; 533 | VERSIONING_SYSTEM = "apple-generic"; 534 | }; 535 | name = Debug; 536 | }; 537 | 97C147071CF9000F007C117D /* Release */ = { 538 | isa = XCBuildConfiguration; 539 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 540 | buildSettings = { 541 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 542 | CLANG_ENABLE_MODULES = YES; 543 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 544 | ENABLE_BITCODE = NO; 545 | FRAMEWORK_SEARCH_PATHS = ( 546 | "$(inherited)", 547 | "$(PROJECT_DIR)/Flutter", 548 | ); 549 | INFOPLIST_FILE = Runner/Info.plist; 550 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 551 | LIBRARY_SEARCH_PATHS = ( 552 | "$(inherited)", 553 | "$(PROJECT_DIR)/Flutter", 554 | ); 555 | MARKETING_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 556 | PRODUCT_BUNDLE_IDENTIFIER = com.scientifichackers.awsIotExample; 557 | PRODUCT_NAME = "$(TARGET_NAME)"; 558 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 559 | SWIFT_VERSION = 4.0; 560 | VERSIONING_SYSTEM = "apple-generic"; 561 | }; 562 | name = Release; 563 | }; 564 | /* End XCBuildConfiguration section */ 565 | 566 | /* Begin XCConfigurationList section */ 567 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 568 | isa = XCConfigurationList; 569 | buildConfigurations = ( 570 | 97C147031CF9000F007C117D /* Debug */, 571 | 97C147041CF9000F007C117D /* Release */, 572 | 249021D3217E4FDB00AE95B9 /* Profile */, 573 | ); 574 | defaultConfigurationIsVisible = 0; 575 | defaultConfigurationName = Release; 576 | }; 577 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 578 | isa = XCConfigurationList; 579 | buildConfigurations = ( 580 | 97C147061CF9000F007C117D /* Debug */, 581 | 97C147071CF9000F007C117D /* Release */, 582 | 249021D4217E4FDB00AE95B9 /* Profile */, 583 | ); 584 | defaultConfigurationIsVisible = 0; 585 | defaultConfigurationName = Release; 586 | }; 587 | /* End XCConfigurationList section */ 588 | }; 589 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 590 | } 591 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IoTReady/flutter-aws-iot/885a76fd6214bde78962d7bb4bdef8f6bc8e1dd4/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IoTReady/flutter-aws-iot/885a76fd6214bde78962d7bb4bdef8f6bc8e1dd4/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IoTReady/flutter-aws-iot/885a76fd6214bde78962d7bb4bdef8f6bc8e1dd4/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IoTReady/flutter-aws-iot/885a76fd6214bde78962d7bb4bdef8f6bc8e1dd4/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IoTReady/flutter-aws-iot/885a76fd6214bde78962d7bb4bdef8f6bc8e1dd4/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IoTReady/flutter-aws-iot/885a76fd6214bde78962d7bb4bdef8f6bc8e1dd4/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IoTReady/flutter-aws-iot/885a76fd6214bde78962d7bb4bdef8f6bc8e1dd4/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IoTReady/flutter-aws-iot/885a76fd6214bde78962d7bb4bdef8f6bc8e1dd4/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IoTReady/flutter-aws-iot/885a76fd6214bde78962d7bb4bdef8f6bc8e1dd4/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IoTReady/flutter-aws-iot/885a76fd6214bde78962d7bb4bdef8f6bc8e1dd4/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IoTReady/flutter-aws-iot/885a76fd6214bde78962d7bb4bdef8f6bc8e1dd4/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IoTReady/flutter-aws-iot/885a76fd6214bde78962d7bb4bdef8f6bc8e1dd4/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IoTReady/flutter-aws-iot/885a76fd6214bde78962d7bb4bdef8f6bc8e1dd4/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IoTReady/flutter-aws-iot/885a76fd6214bde78962d7bb4bdef8f6bc8e1dd4/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IoTReady/flutter-aws-iot/885a76fd6214bde78962d7bb4bdef8f6bc8e1dd4/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IoTReady/flutter-aws-iot/885a76fd6214bde78962d7bb4bdef8f6bc8e1dd4/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IoTReady/flutter-aws-iot/885a76fd6214bde78962d7bb4bdef8f6bc8e1dd4/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IoTReady/flutter-aws-iot/885a76fd6214bde78962d7bb4bdef8f6bc8e1dd4/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | 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. -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | aws_iot_example 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(MARKETING_VERSION) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /example/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" -------------------------------------------------------------------------------- /example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:aws_iot/aws_iot.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:flutter_cognito_plugin/flutter_cognito_plugin.dart'; 6 | import 'package:flutter_dotenv/flutter_dotenv.dart'; 7 | 8 | void main() async { 9 | var dotenv = DotEnv(); 10 | await dotenv.load('assets/.env'); 11 | print(dotenv.env); 12 | 13 | print(await Cognito.initialize()); 14 | if (!await Cognito.isSignedIn()) { 15 | print(await Cognito.signIn(dotenv.env['USERNAME'], dotenv.env['PASSWORD'])); 16 | } 17 | print(await Cognito.getIdentityId()); 18 | 19 | var device = AWSIotDevice( 20 | endpoint: dotenv.env['ENDPOINT'], 21 | clientId: dotenv.env['CLIENT_ID'], 22 | ); 23 | 24 | await device.attachPolicy( 25 | identityId: await Cognito.getIdentityId(), 26 | policyName: dotenv.env['POLICY_NAME'], 27 | ); 28 | 29 | await device.connect(); 30 | 31 | runApp(MyApp(device: device)); 32 | } 33 | 34 | class MyApp extends StatefulWidget { 35 | final AWSIotDevice device; 36 | 37 | const MyApp({Key key, @required this.device}) : super(key: key); 38 | 39 | @override 40 | _MyAppState createState() => _MyAppState(); 41 | } 42 | 43 | class _MyAppState extends State { 44 | @override 45 | Widget build(BuildContext context) { 46 | return MaterialApp( 47 | home: Scaffold( 48 | body: Padding( 49 | padding: const EdgeInsets.all(10), 50 | child: ListView( 51 | children: [ 52 | TextField( 53 | controller: topicControl, 54 | decoration: InputDecoration(labelText: "Topic"), 55 | ), 56 | TextField( 57 | controller: msgControl, 58 | decoration: InputDecoration(labelText: "Message"), 59 | ), 60 | RaisedButton( 61 | child: Text("PUBLISH"), 62 | onPressed: () { 63 | device.publishStr(msgControl.text, topic: topicControl.text); 64 | }, 65 | ), 66 | RaisedButton( 67 | child: Text("SUSCRIBE"), 68 | onPressed: onSubscribe, 69 | ), 70 | for (var msg in history) 71 | Text( 72 | "<${msg.runtimeType} topic='${msg.topic}' asStr='${msg.asStr}'>", 73 | ), 74 | ], 75 | ), 76 | ), 77 | ), 78 | ); 79 | } 80 | 81 | var phoneControl = TextEditingController(); 82 | var passwordControl = TextEditingController(); 83 | var topicControl = TextEditingController(text: 'demoTopic'); 84 | var msgControl = TextEditingController(text: 'Hello World!'); 85 | var history = []; 86 | 87 | AWSIotDevice get device => widget.device; 88 | 89 | @override 90 | void initState() { 91 | super.initState(); 92 | initAsyncState(); 93 | } 94 | 95 | Future initAsyncState() async { 96 | await for (var msg in device.messages) { 97 | setState(() { 98 | history.add(msg); 99 | }); 100 | } 101 | } 102 | 103 | Future onSubscribe() async { 104 | device.subscribe(topicControl.text); 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /example/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | async: 5 | dependency: transitive 6 | description: 7 | name: async 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "2.3.0" 11 | aws_iot: 12 | dependency: "direct dev" 13 | description: 14 | path: ".." 15 | relative: true 16 | source: path 17 | version: "0.1.0" 18 | boolean_selector: 19 | dependency: transitive 20 | description: 21 | name: boolean_selector 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "1.0.5" 25 | charcode: 26 | dependency: transitive 27 | description: 28 | name: charcode 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "1.1.2" 32 | collection: 33 | dependency: transitive 34 | description: 35 | name: collection 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "1.14.11" 39 | convert: 40 | dependency: transitive 41 | description: 42 | name: convert 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "2.1.1" 46 | crypto: 47 | dependency: transitive 48 | description: 49 | name: crypto 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "2.1.3" 53 | cupertino_icons: 54 | dependency: "direct main" 55 | description: 56 | name: cupertino_icons 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "0.1.2" 60 | event_bus: 61 | dependency: transitive 62 | description: 63 | name: event_bus 64 | url: "https://pub.dartlang.org" 65 | source: hosted 66 | version: "1.1.0" 67 | flutter: 68 | dependency: "direct main" 69 | description: flutter 70 | source: sdk 71 | version: "0.0.0" 72 | flutter_cognito_plugin: 73 | dependency: "direct main" 74 | description: 75 | name: flutter_cognito_plugin 76 | url: "https://pub.dartlang.org" 77 | source: hosted 78 | version: "1.0.2" 79 | flutter_dotenv: 80 | dependency: "direct main" 81 | description: 82 | name: flutter_dotenv 83 | url: "https://pub.dartlang.org" 84 | source: hosted 85 | version: "2.1.0" 86 | flutter_test: 87 | dependency: "direct dev" 88 | description: flutter 89 | source: sdk 90 | version: "0.0.0" 91 | logging: 92 | dependency: transitive 93 | description: 94 | name: logging 95 | url: "https://pub.dartlang.org" 96 | source: hosted 97 | version: "0.11.3+2" 98 | matcher: 99 | dependency: transitive 100 | description: 101 | name: matcher 102 | url: "https://pub.dartlang.org" 103 | source: hosted 104 | version: "0.12.5" 105 | meta: 106 | dependency: transitive 107 | description: 108 | name: meta 109 | url: "https://pub.dartlang.org" 110 | source: hosted 111 | version: "1.1.7" 112 | mqtt_client: 113 | dependency: transitive 114 | description: 115 | name: mqtt_client 116 | url: "https://pub.dartlang.org" 117 | source: hosted 118 | version: "5.6.1" 119 | path: 120 | dependency: transitive 121 | description: 122 | name: path 123 | url: "https://pub.dartlang.org" 124 | source: hosted 125 | version: "1.6.4" 126 | pedantic: 127 | dependency: transitive 128 | description: 129 | name: pedantic 130 | url: "https://pub.dartlang.org" 131 | source: hosted 132 | version: "1.8.0+1" 133 | plugin_scaffold: 134 | dependency: transitive 135 | description: 136 | name: plugin_scaffold 137 | url: "https://pub.dartlang.org" 138 | source: hosted 139 | version: "2.0.0" 140 | quiver: 141 | dependency: transitive 142 | description: 143 | name: quiver 144 | url: "https://pub.dartlang.org" 145 | source: hosted 146 | version: "2.0.5" 147 | sigv4: 148 | dependency: transitive 149 | description: 150 | name: sigv4 151 | url: "https://pub.dartlang.org" 152 | source: hosted 153 | version: "1.0.0" 154 | sky_engine: 155 | dependency: transitive 156 | description: flutter 157 | source: sdk 158 | version: "0.0.99" 159 | source_span: 160 | dependency: transitive 161 | description: 162 | name: source_span 163 | url: "https://pub.dartlang.org" 164 | source: hosted 165 | version: "1.5.5" 166 | stack_trace: 167 | dependency: transitive 168 | description: 169 | name: stack_trace 170 | url: "https://pub.dartlang.org" 171 | source: hosted 172 | version: "1.9.3" 173 | stream_channel: 174 | dependency: transitive 175 | description: 176 | name: stream_channel 177 | url: "https://pub.dartlang.org" 178 | source: hosted 179 | version: "2.0.0" 180 | string_scanner: 181 | dependency: transitive 182 | description: 183 | name: string_scanner 184 | url: "https://pub.dartlang.org" 185 | source: hosted 186 | version: "1.0.5" 187 | term_glyph: 188 | dependency: transitive 189 | description: 190 | name: term_glyph 191 | url: "https://pub.dartlang.org" 192 | source: hosted 193 | version: "1.1.0" 194 | test_api: 195 | dependency: transitive 196 | description: 197 | name: test_api 198 | url: "https://pub.dartlang.org" 199 | source: hosted 200 | version: "0.2.5" 201 | typed_data: 202 | dependency: transitive 203 | description: 204 | name: typed_data 205 | url: "https://pub.dartlang.org" 206 | source: hosted 207 | version: "1.1.6" 208 | vector_math: 209 | dependency: transitive 210 | description: 211 | name: vector_math 212 | url: "https://pub.dartlang.org" 213 | source: hosted 214 | version: "2.0.8" 215 | sdks: 216 | dart: ">=2.2.2 <3.0.0" 217 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: aws_iot_example 2 | description: Demonstrates how to use the aws_iot plugin. 3 | publish_to: 'none' 4 | version: 1.0.0+1 5 | 6 | environment: 7 | sdk: ">=2.2.2 <3.0.0" 8 | 9 | dependencies: 10 | flutter: 11 | sdk: flutter 12 | 13 | # The following adds the Cupertino Icons font to your application. 14 | # Use with the CupertinoIcons class for iOS style icons. 15 | cupertino_icons: ^0.1.2 16 | 17 | flutter_cognito_plugin: ^1.0.2 18 | flutter_dotenv: ^2.1.0 19 | 20 | dev_dependencies: 21 | flutter_test: 22 | sdk: flutter 23 | 24 | aws_iot: 25 | path: ../ 26 | 27 | # For information on the generic Dart part of this file, see the 28 | # following page: https://dart.dev/tools/pub/pubspec 29 | 30 | # The following section is specific to Flutter. 31 | flutter: 32 | 33 | # The following line ensures that the Material Icons font is 34 | # included with your application, so that you can use the icons in 35 | # the material Icons class. 36 | uses-material-design: true 37 | 38 | assets: 39 | - assets/ 40 | 41 | # To add assets to your application, add an assets section, like this: 42 | # assets: 43 | # - images/a_dot_burr.jpeg 44 | # - images/a_dot_ham.jpeg 45 | 46 | # An image asset can refer to one or more resolution-specific "variants", see 47 | # https://flutter.dev/assets-and-images/#resolution-aware. 48 | 49 | # For details regarding adding assets from package dependencies, see 50 | # https://flutter.dev/assets-and-images/#from-packages 51 | 52 | # To add custom fonts to your application, add a fonts section here, 53 | # in this "flutter" section. Each entry in this list should have a 54 | # "family" key with the font family name, and a "fonts" key with a 55 | # list giving the asset and other descriptors for the font. For 56 | # example: 57 | # fonts: 58 | # - family: Schyler 59 | # fonts: 60 | # - asset: fonts/Schyler-Regular.ttf 61 | # - asset: fonts/Schyler-Italic.ttf 62 | # style: italic 63 | # - family: Trajan Pro 64 | # fonts: 65 | # - asset: fonts/TrajanPro.ttf 66 | # - asset: fonts/TrajanPro_Bold.ttf 67 | # weight: 700 68 | # 69 | # For details regarding fonts from package dependencies, 70 | # see https://flutter.dev/custom-fonts/#from-packages 71 | -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .vagrant/ 3 | .sconsign.dblite 4 | .svn/ 5 | 6 | .DS_Store 7 | *.swp 8 | profile 9 | 10 | DerivedData/ 11 | build/ 12 | GeneratedPluginRegistrant.h 13 | GeneratedPluginRegistrant.m 14 | 15 | .generated/ 16 | 17 | *.pbxuser 18 | *.mode1v3 19 | *.mode2v3 20 | *.perspectivev3 21 | 22 | !default.pbxuser 23 | !default.mode1v3 24 | !default.mode2v3 25 | !default.perspectivev3 26 | 27 | xcuserdata 28 | 29 | *.moved-aside 30 | 31 | *.pyc 32 | *sync/ 33 | Icon? 34 | .tags* 35 | 36 | /Flutter/Generated.xcconfig 37 | /Flutter/flutter_export_environment.sh -------------------------------------------------------------------------------- /ios/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IoTReady/flutter-aws-iot/885a76fd6214bde78962d7bb4bdef8f6bc8e1dd4/ios/Assets/.gitkeep -------------------------------------------------------------------------------- /ios/Classes/AwsIotPlugin.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "awsCore/AWSCategory.h" 3 | 4 | @interface AwsIotPlugin : NSObject 5 | + (AWSRegionType)parseAWSRegion:(NSString*)region; 6 | @end 7 | -------------------------------------------------------------------------------- /ios/Classes/AwsIotPlugin.m: -------------------------------------------------------------------------------- 1 | #import "AwsIotPlugin.h" 2 | #import 3 | #import "awsCore/AWSCategory.h" 4 | 5 | @implementation AwsIotPlugin 6 | + (void)registerWithRegistrar:(NSObject*)registrar { 7 | [SwiftAwsIotPlugin registerWithRegistrar:registrar]; 8 | } 9 | + (AWSRegionType)parseAWSRegion:(NSString*)region { 10 | return [region aws_regionTypeValue]; 11 | } 12 | @end 13 | -------------------------------------------------------------------------------- /ios/Classes/SwiftAwsIotPlugin.swift: -------------------------------------------------------------------------------- 1 | import AWSIoT 2 | import AWSMobileClient 3 | import Flutter 4 | import plugin_scaffold 5 | import UIKit 6 | 7 | public class SwiftAwsIotPlugin: NSObject, FlutterPlugin { 8 | public static func register(with registrar: FlutterPluginRegistrar) { 9 | let methods = PluginMethods() 10 | _ = createPluginScaffold( 11 | messenger: registrar.messenger(), 12 | channelName: "com.scientifichackers.aws_iot", 13 | methodMap: [ 14 | "attachPolicy": methods.attachPolicy 15 | ] 16 | ) 17 | } 18 | } 19 | 20 | class PluginMethods { 21 | let mobileClient = AWSMobileClient.default() 22 | 23 | func attachPolicy(call: FlutterMethodCall, result: @escaping FlutterResult) { 24 | let map = call.arguments as! [String: Any?] 25 | let identityId = map["identityId"] as! String 26 | let policyName = map["policyName"] as! String 27 | let region = map["region"] as! String 28 | 29 | let key = "com.scientifichackers.aws_iot/AWSIoT" 30 | AWSIoT.register( 31 | with: AWSServiceConfiguration( 32 | region: AwsIotPlugin.parseAWSRegion(region), 33 | credentialsProvider: mobileClient 34 | ), 35 | forKey: key 36 | ) 37 | let iot = AWSIoT(forKey: key) 38 | 39 | let attachPolicyReq = AWSIoTAttachPolicyRequest()! 40 | attachPolicyReq.policyName = policyName 41 | attachPolicyReq.target = identityId 42 | 43 | iot.attachPolicy(attachPolicyReq, completionHandler: { error in 44 | if let error = error { 45 | trySendError(result, error) 46 | } else { 47 | trySend(result) 48 | } 49 | }) 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /ios/aws_iot.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html 3 | # 4 | Pod::Spec.new do |s| 5 | s.name = 'aws_iot' 6 | s.version = '0.0.1' 7 | s.summary = 'A new flutter plugin project.' 8 | s.description = <<-DESC 9 | A new flutter plugin project. 10 | DESC 11 | s.homepage = 'http://example.com' 12 | s.license = { :file => '../LICENSE' } 13 | s.author = { 'Your Company' => 'email@example.com' } 14 | s.source = { :path => '.' } 15 | s.source_files = 'Classes/**/*' 16 | s.public_header_files = 'Classes/**/*.h' 17 | s.dependency 'Flutter' 18 | 19 | s.ios.deployment_target = '9.0' 20 | 21 | s.dependency 'plugin_scaffold' 22 | s.dependency 'AWSIoT', '~> 2.11.0' 23 | s.dependency 'AWSMobileClient', '~> 2.11.0' 24 | end 25 | -------------------------------------------------------------------------------- /lib/aws_iot.dart: -------------------------------------------------------------------------------- 1 | export 'src/client.dart'; -------------------------------------------------------------------------------- /lib/src/client.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'dart:convert'; 3 | import 'dart:typed_data'; 4 | 5 | import 'package:aws_iot/src/consts.dart'; 6 | import 'package:flutter/foundation.dart'; 7 | import 'package:flutter/services.dart'; 8 | import 'package:flutter_cognito_plugin/flutter_cognito_plugin.dart'; 9 | import 'package:mqtt_client/mqtt_client.dart'; 10 | import 'package:sigv4/sigv4.dart'; 11 | import 'package:typed_data/typed_data.dart'; 12 | 13 | class AWSIotDevice { 14 | final String endpoint; 15 | final String clientId; 16 | final bool enableLogging; 17 | 18 | StreamController _msgControl; 19 | Stream messages; 20 | 21 | MqttClient _client; 22 | 23 | MqttClient get client { 24 | if (_client == null) { 25 | throw AWSIotNotConnected(); 26 | } 27 | return _client; 28 | } 29 | 30 | set client(MqttClient client) { 31 | _client = client; 32 | } 33 | 34 | AWSIotDevice({ 35 | @required this.endpoint, 36 | @required this.clientId, 37 | this.enableLogging: false, 38 | }) { 39 | _msgControl = StreamController(); 40 | messages = _msgControl.stream.asBroadcastStream(); 41 | } 42 | 43 | Stream filterMessages(String topicFilter) async* { 44 | var topic = SubscriptionTopic(topicFilter); 45 | await for (var msg in messages) { 46 | if (topic.matches(PublicationTopic(msg.topic))) { 47 | yield msg; 48 | } 49 | } 50 | } 51 | 52 | Future connect() async { 53 | var url = await getWebSocketURL(); 54 | client = MqttClient(url, clientId); 55 | client.logging(on: enableLogging); 56 | client.useWebSocket = true; 57 | client.port = 443; 58 | client.connectionMessage = 59 | MqttConnectMessage().withClientIdentifier(clientId).keepAliveFor(300); 60 | client.keepAlivePeriod = 300; 61 | 62 | try { 63 | await client.connect(); 64 | } on Exception catch (e) { 65 | client.disconnect(); 66 | throw e; 67 | } 68 | 69 | client.updates.listen((messages) { 70 | for (var msg in messages) { 71 | MqttPublishMessage pubMsg = msg.payload; 72 | _msgControl.add( 73 | AWSIotMsg( 74 | msg.topic, 75 | Uint8List.fromList(pubMsg.payload.message.toList()), 76 | ), 77 | ); 78 | } 79 | }); 80 | } 81 | 82 | Future getWebSocketURL() async { 83 | var now = _generateDatetime(); 84 | var region = getRegion(); 85 | var credentials = await Cognito.getCredentials(); 86 | 87 | var creds = [ 88 | credentials.accessKey, 89 | _getDate(now), 90 | region, 91 | serviceName, 92 | awsS4Request, 93 | ]; 94 | var queryParams = { 95 | 'X-Amz-Algorithm': aws4HmacSha256, 96 | 'X-Amz-Credential': creds.join('/'), 97 | 'X-Amz-Date': now, 98 | 'X-Amz-SignedHeaders': 'host', 99 | }; 100 | 101 | var canonicalQueryString = Sigv4.buildCanonicalQueryString(queryParams); 102 | var request = Sigv4.buildCanonicalRequest( 103 | 'GET', 104 | urlPath, 105 | queryParams, 106 | {'host': endpoint}, 107 | '', 108 | ); 109 | 110 | var hashedCanonicalRequest = Sigv4.hashCanonicalRequest(request); 111 | var stringToSign = Sigv4.buildStringToSign( 112 | now, 113 | Sigv4.buildCredentialScope(now, region, serviceName), 114 | hashedCanonicalRequest, 115 | ); 116 | 117 | var signingKey = Sigv4.calculateSigningKey( 118 | credentials.secretKey, 119 | now, 120 | region, 121 | serviceName, 122 | ); 123 | 124 | var signature = Sigv4.calculateSignature(signingKey, stringToSign); 125 | 126 | var finalParams = 127 | '$canonicalQueryString&X-Amz-Signature=$signature&X-Amz-Security-Token=${Uri.encodeComponent(credentials.sessionToken)}'; 128 | 129 | return '$scheme$endpoint$urlPath?$finalParams'; 130 | } 131 | 132 | String _generateDatetime() { 133 | return new DateTime.now() 134 | .toUtc() 135 | .toString() 136 | .replaceAll(new RegExp(r'\.\d*Z$'), 'Z') 137 | .replaceAll(new RegExp(r'[:-]|\.\d{3}'), '') 138 | .split(' ') 139 | .join('T'); 140 | } 141 | 142 | String _getDate(String dateTime) { 143 | return dateTime.substring(0, 8); 144 | } 145 | 146 | void disconnect() { 147 | return client.disconnect(); 148 | } 149 | 150 | void publishBytes(Uint8List data, {@required String topic}) { 151 | client.publishMessage( 152 | topic, 153 | MqttQos.atMostOnce, 154 | Uint8Buffer()..addAll(data), 155 | ); 156 | } 157 | 158 | void publishStr(String str, {@required String topic}) { 159 | publishBytes(utf8.encode(str), topic: topic); 160 | } 161 | 162 | void publishJson(dynamic json, {@required String topic}) { 163 | publishStr(jsonEncode(json), topic: topic); 164 | } 165 | 166 | Subscription subscribe( 167 | String topic, { 168 | MqttQos qos = MqttQos.atMostOnce, 169 | }) { 170 | return client.subscribe(topic, qos); 171 | } 172 | 173 | void unsubscribe(String topic) { 174 | client.unsubscribe(topic); 175 | } 176 | 177 | static const channel = const MethodChannel('com.scientifichackers.aws_iot'); 178 | 179 | Future attachPolicy({ 180 | @required String identityId, 181 | @required String policyName, 182 | }) async { 183 | assert(identityId != null && policyName != null); 184 | await channel.invokeMethod('attachPolicy', { 185 | 'identityId': identityId ?? '', 186 | 'policyName': policyName ?? '', 187 | 'region': getRegion(), 188 | }); 189 | } 190 | 191 | String getRegion() { 192 | var endpointWithoutPort = endpoint.split(':')[0]; 193 | var splits = endpointWithoutPort.split('.'); 194 | var offset = splits.length == 7 ? 3 : 2; 195 | try { 196 | return splits[offset]; 197 | } on IndexError { 198 | throw InvalidAWSIotEndpoint("Cannot parse region from endpoint."); 199 | } 200 | } 201 | } 202 | 203 | class AWSIotMsg { 204 | final String topic; 205 | final Uint8List asBytes; 206 | 207 | AWSIotMsg(this.topic, this.asBytes); 208 | 209 | String get asStr => utf8.decode(asBytes); 210 | 211 | dynamic get asJson => jsonDecode(asStr); 212 | 213 | @override 214 | String toString() { 215 | return "<$runtimeType topic: '$topic' asStr: '$asStr'>"; 216 | } 217 | } 218 | 219 | class InvalidAWSIotEndpoint implements Exception { 220 | final String msg; 221 | 222 | InvalidAWSIotEndpoint(this.msg); 223 | 224 | @override 225 | String toString() { 226 | return '<$runtimeType: $msg>'; 227 | } 228 | } 229 | 230 | class AWSIotNotConnected implements Exception { 231 | @override 232 | String toString() { 233 | return '<$runtimeType: You must call connect() before using the device>'; 234 | } 235 | } 236 | -------------------------------------------------------------------------------- /lib/src/consts.dart: -------------------------------------------------------------------------------- 1 | const serviceName = 'iotdevicegateway'; 2 | const awsS4Request = 'aws4_request'; 3 | const aws4HmacSha256 = 'AWS4-HMAC-SHA256'; 4 | const scheme = 'wss://'; 5 | const urlPath = '/mqtt'; 6 | -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | async: 5 | dependency: transitive 6 | description: 7 | name: async 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "2.3.0" 11 | boolean_selector: 12 | dependency: transitive 13 | description: 14 | name: boolean_selector 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "1.0.5" 18 | charcode: 19 | dependency: transitive 20 | description: 21 | name: charcode 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "1.1.2" 25 | collection: 26 | dependency: transitive 27 | description: 28 | name: collection 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "1.14.11" 32 | convert: 33 | dependency: transitive 34 | description: 35 | name: convert 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "2.1.1" 39 | crypto: 40 | dependency: "direct main" 41 | description: 42 | name: crypto 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "2.1.3" 46 | event_bus: 47 | dependency: transitive 48 | description: 49 | name: event_bus 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "1.1.0" 53 | flutter: 54 | dependency: "direct main" 55 | description: flutter 56 | source: sdk 57 | version: "0.0.0" 58 | flutter_cognito_plugin: 59 | dependency: "direct main" 60 | description: 61 | name: flutter_cognito_plugin 62 | url: "https://pub.dartlang.org" 63 | source: hosted 64 | version: "1.0.2" 65 | flutter_test: 66 | dependency: "direct dev" 67 | description: flutter 68 | source: sdk 69 | version: "0.0.0" 70 | logging: 71 | dependency: transitive 72 | description: 73 | name: logging 74 | url: "https://pub.dartlang.org" 75 | source: hosted 76 | version: "0.11.3+2" 77 | matcher: 78 | dependency: transitive 79 | description: 80 | name: matcher 81 | url: "https://pub.dartlang.org" 82 | source: hosted 83 | version: "0.12.5" 84 | meta: 85 | dependency: transitive 86 | description: 87 | name: meta 88 | url: "https://pub.dartlang.org" 89 | source: hosted 90 | version: "1.1.7" 91 | mqtt_client: 92 | dependency: "direct main" 93 | description: 94 | name: mqtt_client 95 | url: "https://pub.dartlang.org" 96 | source: hosted 97 | version: "5.6.1" 98 | path: 99 | dependency: transitive 100 | description: 101 | name: path 102 | url: "https://pub.dartlang.org" 103 | source: hosted 104 | version: "1.6.4" 105 | pedantic: 106 | dependency: transitive 107 | description: 108 | name: pedantic 109 | url: "https://pub.dartlang.org" 110 | source: hosted 111 | version: "1.8.0+1" 112 | plugin_scaffold: 113 | dependency: "direct main" 114 | description: 115 | name: plugin_scaffold 116 | url: "https://pub.dartlang.org" 117 | source: hosted 118 | version: "2.0.0" 119 | quiver: 120 | dependency: transitive 121 | description: 122 | name: quiver 123 | url: "https://pub.dartlang.org" 124 | source: hosted 125 | version: "2.0.5" 126 | sigv4: 127 | dependency: "direct main" 128 | description: 129 | name: sigv4 130 | url: "https://pub.dartlang.org" 131 | source: hosted 132 | version: "1.0.0" 133 | sky_engine: 134 | dependency: transitive 135 | description: flutter 136 | source: sdk 137 | version: "0.0.99" 138 | source_span: 139 | dependency: transitive 140 | description: 141 | name: source_span 142 | url: "https://pub.dartlang.org" 143 | source: hosted 144 | version: "1.5.5" 145 | stack_trace: 146 | dependency: transitive 147 | description: 148 | name: stack_trace 149 | url: "https://pub.dartlang.org" 150 | source: hosted 151 | version: "1.9.3" 152 | stream_channel: 153 | dependency: transitive 154 | description: 155 | name: stream_channel 156 | url: "https://pub.dartlang.org" 157 | source: hosted 158 | version: "2.0.0" 159 | string_scanner: 160 | dependency: transitive 161 | description: 162 | name: string_scanner 163 | url: "https://pub.dartlang.org" 164 | source: hosted 165 | version: "1.0.5" 166 | term_glyph: 167 | dependency: transitive 168 | description: 169 | name: term_glyph 170 | url: "https://pub.dartlang.org" 171 | source: hosted 172 | version: "1.1.0" 173 | test_api: 174 | dependency: transitive 175 | description: 176 | name: test_api 177 | url: "https://pub.dartlang.org" 178 | source: hosted 179 | version: "0.2.5" 180 | typed_data: 181 | dependency: "direct main" 182 | description: 183 | name: typed_data 184 | url: "https://pub.dartlang.org" 185 | source: hosted 186 | version: "1.1.6" 187 | vector_math: 188 | dependency: transitive 189 | description: 190 | name: vector_math 191 | url: "https://pub.dartlang.org" 192 | source: hosted 193 | version: "2.0.8" 194 | sdks: 195 | dart: ">=2.2.2 <3.0.0" 196 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: aws_iot 2 | description: A new flutter plugin project. 3 | version: 0.1.0 4 | author: Dev Aggarwal 5 | homepage: https://github.com/IoTReady/flutter-aws-iot 6 | 7 | environment: 8 | sdk: ">=2.1.0 <3.0.0" 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | 14 | flutter_cognito_plugin: ^1.0.2 15 | plugin_scaffold: ^2.0.0 16 | crypto: ^2.1.3 17 | mqtt_client: ^5.5.0 18 | sigv4: ^1.0.0 19 | typed_data: ^1.1.6 20 | 21 | dev_dependencies: 22 | flutter_test: 23 | sdk: flutter 24 | 25 | # For information on the generic Dart part of this file, see the 26 | # following page: https://dart.dev/tools/pub/pubspec 27 | 28 | # The following section is specific to Flutter. 29 | flutter: 30 | # This section identifies this Flutter project as a plugin project. 31 | # The androidPackage and pluginClass identifiers should not ordinarily 32 | # be modified. They are used by the tooling to maintain consistency when 33 | # adding or updating assets for this project. 34 | plugin: 35 | androidPackage: com.scientifichackers.aws_iot 36 | pluginClass: AwsIotPlugin 37 | 38 | # To add assets to your plugin package, add an assets section, like this: 39 | # assets: 40 | # - images/a_dot_burr.jpeg 41 | # - images/a_dot_ham.jpeg 42 | # 43 | # For details regarding assets in packages, see 44 | # https://flutter.dev/assets-and-images/#from-packages 45 | # 46 | # An image asset can refer to one or more resolution-specific "variants", see 47 | # https://flutter.dev/assets-and-images/#resolution-aware. 48 | 49 | # To add custom fonts to your plugin package, add a fonts section here, 50 | # in this "flutter" section. Each entry in this list should have a 51 | # "family" key with the font family name, and a "fonts" key with a 52 | # list giving the asset and other descriptors for the font. For 53 | # example: 54 | # fonts: 55 | # - family: Schyler 56 | # fonts: 57 | # - asset: fonts/Schyler-Regular.ttf 58 | # - asset: fonts/Schyler-Italic.ttf 59 | # style: italic 60 | # - family: Trajan Pro 61 | # fonts: 62 | # - asset: fonts/TrajanPro.ttf 63 | # - asset: fonts/TrajanPro_Bold.ttf 64 | # weight: 700 65 | # 66 | # For details regarding fonts in packages, see 67 | # https://flutter.dev/custom-fonts/#from-packages 68 | --------------------------------------------------------------------------------