diff --git a/packages/firebase_dynamic_links/CHANGELOG.md b/packages/firebase_dynamic_links/CHANGELOG.md index 04e18d9e9815..561c447c2a7e 100644 --- a/packages/firebase_dynamic_links/CHANGELOG.md +++ b/packages/firebase_dynamic_links/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.5.0+1 + +* Update documentation to reflect new repository location. +* Update unit tests to call `TestWidgetsFlutterBinding.ensureInitialized`. + ## 0.5.0 * **Breaking change**. Changed architecture and method names to be able to differentiate between diff --git a/packages/firebase_in_app_messaging/.gitignore b/packages/firebase_in_app_messaging/.gitignore new file mode 100644 index 000000000000..e9dc58d3d6e2 --- /dev/null +++ b/packages/firebase_in_app_messaging/.gitignore @@ -0,0 +1,7 @@ +.DS_Store +.dart_tool/ + +.packages +.pub/ + +build/ diff --git a/packages/firebase_in_app_messaging/.metadata b/packages/firebase_in_app_messaging/.metadata new file mode 100644 index 000000000000..330eadcb22d6 --- /dev/null +++ b/packages/firebase_in_app_messaging/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: 2e540931f73593e35627592ca4f9a4ca3035ed31 + channel: stable + +project_type: plugin diff --git a/packages/firebase_in_app_messaging/CHANGELOG.md b/packages/firebase_in_app_messaging/CHANGELOG.md new file mode 100644 index 000000000000..12a046c09fbf --- /dev/null +++ b/packages/firebase_in_app_messaging/CHANGELOG.md @@ -0,0 +1,15 @@ +## 0.0.1+3 + +* Update AGP, gradle and inappmessaging-display versions on Android. + +## 0.0.1+2 + +* Remove dependency `androidx.annotation:annotation:1.0.0`. + +## 0.0.1+1 + +* Update google-services Android gradle plugin to 4.3.0 in documentation and examples. + +## 0.0.1 + +* Initial release. diff --git a/packages/firebase_in_app_messaging/LICENSE b/packages/firebase_in_app_messaging/LICENSE new file mode 100644 index 000000000000..7319cc0d9e04 --- /dev/null +++ b/packages/firebase_in_app_messaging/LICENSE @@ -0,0 +1,26 @@ +Copyright 2018, the Chromium project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/firebase_in_app_messaging/README.md b/packages/firebase_in_app_messaging/README.md new file mode 100644 index 000000000000..24e904e950cb --- /dev/null +++ b/packages/firebase_in_app_messaging/README.md @@ -0,0 +1,88 @@ +# firebase_in_app_messaging plugin + +A Flutter plugin to use the [Firebase In-App Messaging API](https://firebase.google.com/products/in-app-messaging). + +*Note*: This plugin is still under development, and some APIs might not be available yet. [Feedback](https://github.com/FirebaseExtended/flutterfire/issues) and [Pull Requests](https://github.com/FirebaseExtended/flutterfire/pulls) are most welcome! + +## Usage + +### Import the firebase_in_app_messaging plugin +To use the firebase_in_app_messaging plugin, follow the [plugin installation instructions](https://pub.dartlang.org/packages/firebase_in_app_messaging#pub-pkg-tab-installing). + +### Android integration + +There are a few extra steps required for the Android integration. Enable the Google services by configuring the Gradle scripts as such. + +1. Add the classpath to the `[project]/android/build.gradle` file. +```gradle +dependencies { + // Example existing classpath + classpath 'com.android.tools.build:gradle:3.3.0' + // Add the google services classpath + classpath 'com.google.gms:google-services:4.3.0' +} +``` + +2. Add the apply plugin to the `[project]/android/app/build.gradle` file. +```gradle +// ADD THIS AT THE BOTTOM +apply plugin: 'com.google.gms.google-services' +``` + +*Note:* If this section is not completed you will get an error like this: +``` +java.lang.IllegalStateException: +Default FirebaseApp is not initialized in this process [package name]. +Make sure to call FirebaseApp.initializeApp(Context) first. +``` + +*Note:* When you are debugging on Android, use a device or AVD with Google Play services. +Otherwise you will not be able to use Firebase In-App Messaging. + +### Use the plugin + +To show In-App Messages in your app, no extra setup is required - just import the plugin and you +are good to go. However, to modify message behavior (as documented [here](https://firebase.google.com/docs/in-app-messaging/modify-message-behavior)), the plugin provides the following methods - + +First off, add the following imports to your Dart code: +```dart +import 'package:firebase_in_app_messaging/firebase_in_app_messaging.dart'; +``` + +#### Programmatic Triggers ([docs](https://firebase.google.com/docs/in-app-messaging/modify-message-behavior?platform=android#trigger_in-app_messages_programmatically)) + +To trigger in-app messages programmatically + +```dart +FirebaseInAppMessaging.triggerEvent('eventName'); +``` + +#### Temporarily disable in-app messages ([docs](https://firebase.google.com/docs/in-app-messaging/modify-message-behavior?platform=android#temporarily_disable_in-app_messages)) + +If you'd like to suppress message displays for any reason, for example to avoid interrupting a sequence of payment processing screens, you can do that the following + +```dart +FirebaseInAppMessaging.setMessagesSuppressed(true); + + +// To re-enable +FirebaseInAppMessaging.setMessagesSuppressed(false); +``` + +#### Enable opt-out message delivery ([docs](https://firebase.google.com/docs/in-app-messaging/modify-message-behavior?platform=android#enable_opt-out_message_delivery)) + +First, follow the step outlined [here](https://firebase.google.com/docs/in-app-messaging/modify-message-behavior#enable_opt-out_message_delivery) for both iOS and Android. Then add the following code in your app: + +```dart +FirebaseInAppMessaging.setAutomaticDataCollectionEnabled(false); +``` + +## Example + +See the [example application](https://github.com/FirebaseExtended/flutterfire/tree/master/packages/firebase_in_app_messaging/example) source +for a complete sample app using the Firebase In-App Messaging. + +## Issues and feedback + +Please file [issues](https://github.com/flutter/flutter/issues/new) +to send feedback or report a bug. Thank you! diff --git a/packages/firebase_in_app_messaging/android/.gitignore b/packages/firebase_in_app_messaging/android/.gitignore new file mode 100644 index 000000000000..c6cbe562a427 --- /dev/null +++ b/packages/firebase_in_app_messaging/android/.gitignore @@ -0,0 +1,8 @@ +*.iml +.gradle +/local.properties +/.idea/workspace.xml +/.idea/libraries +.DS_Store +/build +/captures diff --git a/packages/firebase_in_app_messaging/android/build.gradle b/packages/firebase_in_app_messaging/android/build.gradle new file mode 100644 index 000000000000..280a86f48056 --- /dev/null +++ b/packages/firebase_in_app_messaging/android/build.gradle @@ -0,0 +1,37 @@ +group 'com.example.firebase_in_app_messaging' +version '1.0-SNAPSHOT' + +buildscript { + repositories { + google() + jcenter() + } + + dependencies { + classpath 'com.android.tools.build:gradle:3.4.2' + } +} + +rootProject.allprojects { + repositories { + google() + jcenter() + } +} + +apply plugin: 'com.android.library' + +android { + compileSdkVersion 28 + + defaultConfig { + minSdkVersion 16 + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + lintOptions { + disable 'InvalidPackage' + } + dependencies { + api 'com.google.firebase:firebase-inappmessaging-display:18.0.2' + } +} diff --git a/packages/firebase_in_app_messaging/android/gradle.properties b/packages/firebase_in_app_messaging/android/gradle.properties new file mode 100644 index 000000000000..2bd6f4fda009 --- /dev/null +++ b/packages/firebase_in_app_messaging/android/gradle.properties @@ -0,0 +1,2 @@ +org.gradle.jvmargs=-Xmx1536M + diff --git a/packages/firebase_in_app_messaging/android/settings.gradle b/packages/firebase_in_app_messaging/android/settings.gradle new file mode 100644 index 000000000000..727175685e2b --- /dev/null +++ b/packages/firebase_in_app_messaging/android/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'firebase_in_app_messaging' diff --git a/packages/firebase_in_app_messaging/android/src/main/AndroidManifest.xml b/packages/firebase_in_app_messaging/android/src/main/AndroidManifest.xml new file mode 100644 index 000000000000..b6953a13e119 --- /dev/null +++ b/packages/firebase_in_app_messaging/android/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + diff --git a/packages/firebase_in_app_messaging/android/src/main/java/com/example/firebase_in_app_messaging/FirebaseInAppMessagingPlugin.java b/packages/firebase_in_app_messaging/android/src/main/java/com/example/firebase_in_app_messaging/FirebaseInAppMessagingPlugin.java new file mode 100644 index 000000000000..8a4c6bcfc71e --- /dev/null +++ b/packages/firebase_in_app_messaging/android/src/main/java/com/example/firebase_in_app_messaging/FirebaseInAppMessagingPlugin.java @@ -0,0 +1,59 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package com.example.firebase_in_app_messaging; + +import com.google.firebase.inappmessaging.FirebaseInAppMessaging; +import io.flutter.plugin.common.MethodCall; +import io.flutter.plugin.common.MethodChannel; +import io.flutter.plugin.common.MethodChannel.MethodCallHandler; +import io.flutter.plugin.common.MethodChannel.Result; +import io.flutter.plugin.common.PluginRegistry.Registrar; + +/** FirebaseInAppMessagingPlugin */ +public class FirebaseInAppMessagingPlugin implements MethodCallHandler { + private final FirebaseInAppMessaging instance; + + public static void registerWith(Registrar registrar) { + final MethodChannel channel = + new MethodChannel(registrar.messenger(), "plugins.flutter.io/firebase_in_app_messaging"); + channel.setMethodCallHandler(new FirebaseInAppMessagingPlugin()); + } + + private FirebaseInAppMessagingPlugin() { + instance = FirebaseInAppMessaging.getInstance(); + } + + @Override + public void onMethodCall(MethodCall call, Result result) { + switch (call.method) { + case "triggerEvent": + { + String eventName = call.argument("eventName"); + instance.triggerEvent(eventName); + result.success(null); + break; + } + case "setMessagesSuppressed": + { + Boolean suppress = (Boolean) call.arguments; + instance.setMessagesSuppressed(suppress); + result.success(null); + break; + } + case "setAutomaticDataCollectionEnabled": + { + Boolean enabled = (Boolean) call.arguments; + instance.setAutomaticDataCollectionEnabled(enabled); + result.success(null); + break; + } + default: + { + result.notImplemented(); + break; + } + } + } +} diff --git a/packages/firebase_in_app_messaging/example/.gitignore b/packages/firebase_in_app_messaging/example/.gitignore new file mode 100644 index 000000000000..ac4a90645ca3 --- /dev/null +++ b/packages/firebase_in_app_messaging/example/.gitignore @@ -0,0 +1,72 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +.dart_tool/ +.flutter-plugins +.packages +.pub-cache/ +.pub/ +/build/ + +# Android related +**/android/**/gradle-wrapper.jar +**/android/.gradle +**/android/captures/ +**/android/gradlew +**/android/gradlew.bat +**/android/local.properties +**/android/**/GeneratedPluginRegistrant.java + +# iOS/XCode related +**/ios/**/*.mode1v3 +**/ios/**/*.mode2v3 +**/ios/**/*.moved-aside +**/ios/**/*.pbxuser +**/ios/**/*.perspectivev3 +**/ios/**/*sync/ +**/ios/**/.sconsign.dblite +**/ios/**/.tags* +**/ios/**/.vagrant/ +**/ios/**/DerivedData/ +**/ios/**/Icon? +**/ios/**/Pods/ +**/ios/**/.symlinks/ +**/ios/**/profile +**/ios/**/xcuserdata +**/ios/.generated/ +**/ios/Flutter/App.framework +**/ios/Flutter/Flutter.framework +**/ios/Flutter/Generated.xcconfig +**/ios/Flutter/app.flx +**/ios/Flutter/app.zip +**/ios/Flutter/flutter_assets/ +**/ios/ServiceDefinitions.json +**/ios/Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!**/ios/**/default.mode1v3 +!**/ios/**/default.mode2v3 +!**/ios/**/default.pbxuser +!**/ios/**/default.perspectivev3 +!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages diff --git a/packages/firebase_in_app_messaging/example/.metadata b/packages/firebase_in_app_messaging/example/.metadata new file mode 100644 index 000000000000..0fc331292ca8 --- /dev/null +++ b/packages/firebase_in_app_messaging/example/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: 2e540931f73593e35627592ca4f9a4ca3035ed31 + channel: stable + +project_type: app diff --git a/packages/firebase_in_app_messaging/example/README.md b/packages/firebase_in_app_messaging/example/README.md new file mode 100644 index 000000000000..5146fbdf4919 --- /dev/null +++ b/packages/firebase_in_app_messaging/example/README.md @@ -0,0 +1,4 @@ +# firebase_in_app_messaging_example + +Demonstrates how to use the firebase_in_app_messaging plugin. + diff --git a/packages/firebase_in_app_messaging/example/android/app/build.gradle b/packages/firebase_in_app_messaging/example/android/app/build.gradle new file mode 100644 index 000000000000..ce9e3c1143fb --- /dev/null +++ b/packages/firebase_in_app_messaging/example/android/app/build.gradle @@ -0,0 +1,63 @@ +def localProperties = new Properties() +def localPropertiesFile = rootProject.file('local.properties') +if (localPropertiesFile.exists()) { + localPropertiesFile.withReader('UTF-8') { reader -> + localProperties.load(reader) + } +} + +def flutterRoot = localProperties.getProperty('flutter.sdk') +if (flutterRoot == null) { + throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") +} + +def flutterVersionCode = localProperties.getProperty('flutter.versionCode') +if (flutterVersionCode == null) { + flutterVersionCode = '1' +} + +def flutterVersionName = localProperties.getProperty('flutter.versionName') +if (flutterVersionName == null) { + flutterVersionName = '1.0' +} + +apply plugin: 'com.android.application' +apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" + +android { + compileSdkVersion 28 + + lintOptions { + disable 'InvalidPackage' + } + + defaultConfig { + applicationId "com.example.firebase_in_app_messaging_example" + minSdkVersion 16 + targetSdkVersion 28 + versionCode flutterVersionCode.toInteger() + versionName flutterVersionName + testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + multiDexEnabled true + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig signingConfigs.debug + } + } +} + +flutter { + source '../..' +} + +dependencies { + testImplementation 'junit:junit:4.12' + androidTestImplementation 'androidx.test:runner:1.2.0' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' +} + +apply plugin: 'com.google.gms.google-services' diff --git a/packages/firebase_in_app_messaging/example/android/app/google-services.json b/packages/firebase_in_app_messaging/example/android/app/google-services.json new file mode 100644 index 000000000000..3e7c1eea26e7 --- /dev/null +++ b/packages/firebase_in_app_messaging/example/android/app/google-services.json @@ -0,0 +1,83 @@ +{ + "project_info": { + "project_number": "417703151161", + "firebase_url": "https://fiamflutter.firebaseio.com", + "project_id": "fiamflutter", + "storage_bucket": "fiamflutter.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:417703151161:android:362d1e29a3978127", + "android_client_info": { + "package_name": "com.example.firebase_in_app_messaging_example" + } + }, + "oauth_client": [ + { + "client_id": "417703151161-qkgc7njdplpe7s05eg8k3qlq8ruqj03a.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyBWb90xr1JZGil-JEBULhYeb5w3qM2pYDI" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "417703151161-qkgc7njdplpe7s05eg8k3qlq8ruqj03a.apps.googleusercontent.com", + "client_type": 3 + }, + { + "client_id": "417703151161-a2kb2fdjfkd3khbhd2lkf0uvobashf55.apps.googleusercontent.com", + "client_type": 2, + "ios_info": { + "bundle_id": "com.example.firebaseInappmessagingExample" + } + } + ] + } + } + }, + { + "client_info": { + "mobilesdk_app_id": "1:417703151161:android:e6d1fd37b00bc472", + "android_client_info": { + "package_name": "com.example.firebase_inappmessaging_example" + } + }, + "oauth_client": [ + { + "client_id": "417703151161-qkgc7njdplpe7s05eg8k3qlq8ruqj03a.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyBWb90xr1JZGil-JEBULhYeb5w3qM2pYDI" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "417703151161-qkgc7njdplpe7s05eg8k3qlq8ruqj03a.apps.googleusercontent.com", + "client_type": 3 + }, + { + "client_id": "417703151161-a2kb2fdjfkd3khbhd2lkf0uvobashf55.apps.googleusercontent.com", + "client_type": 2, + "ios_info": { + "bundle_id": "com.example.firebaseInappmessagingExample" + } + } + ] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/packages/firebase_in_app_messaging/example/android/app/gradle.properties b/packages/firebase_in_app_messaging/example/android/app/gradle.properties new file mode 100644 index 000000000000..dbb7bf70d15c --- /dev/null +++ b/packages/firebase_in_app_messaging/example/android/app/gradle.properties @@ -0,0 +1,2 @@ +android.enableJetifier=true +android.useAndroidX=true diff --git a/packages/firebase_in_app_messaging/example/android/app/src/debug/AndroidManifest.xml b/packages/firebase_in_app_messaging/example/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 000000000000..94dd5928d625 --- /dev/null +++ b/packages/firebase_in_app_messaging/example/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/packages/firebase_in_app_messaging/example/android/app/src/main/AndroidManifest.xml b/packages/firebase_in_app_messaging/example/android/app/src/main/AndroidManifest.xml new file mode 100644 index 000000000000..d2fa82033723 --- /dev/null +++ b/packages/firebase_in_app_messaging/example/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + diff --git a/packages/firebase_in_app_messaging/example/android/app/src/main/java/com/example/firebase_in_app_messaging_example/MainActivity.java b/packages/firebase_in_app_messaging/example/android/app/src/main/java/com/example/firebase_in_app_messaging_example/MainActivity.java new file mode 100644 index 000000000000..98218250276a --- /dev/null +++ b/packages/firebase_in_app_messaging/example/android/app/src/main/java/com/example/firebase_in_app_messaging_example/MainActivity.java @@ -0,0 +1,13 @@ +package com.example.firebase_in_app_messaging_example; + +import android.os.Bundle; +import io.flutter.app.FlutterActivity; +import io.flutter.plugins.GeneratedPluginRegistrant; + +public class MainActivity extends FlutterActivity { + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + GeneratedPluginRegistrant.registerWith(this); + } +} diff --git a/packages/firebase_in_app_messaging/example/android/app/src/main/res/drawable/launch_background.xml b/packages/firebase_in_app_messaging/example/android/app/src/main/res/drawable/launch_background.xml new file mode 100644 index 000000000000..304732f88420 --- /dev/null +++ b/packages/firebase_in_app_messaging/example/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/packages/firebase_in_app_messaging/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/packages/firebase_in_app_messaging/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 000000000000..db77bb4b7b09 Binary files /dev/null and b/packages/firebase_in_app_messaging/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/packages/firebase_in_app_messaging/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/packages/firebase_in_app_messaging/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 000000000000..17987b79bb8a Binary files /dev/null and b/packages/firebase_in_app_messaging/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/packages/firebase_in_app_messaging/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/packages/firebase_in_app_messaging/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 000000000000..09d4391482be Binary files /dev/null and b/packages/firebase_in_app_messaging/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/packages/firebase_in_app_messaging/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/packages/firebase_in_app_messaging/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 000000000000..d5f1c8d34e7a Binary files /dev/null and b/packages/firebase_in_app_messaging/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/packages/firebase_in_app_messaging/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/packages/firebase_in_app_messaging/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 000000000000..4d6372eebdb2 Binary files /dev/null and b/packages/firebase_in_app_messaging/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/packages/firebase_in_app_messaging/example/android/app/src/main/res/values/styles.xml b/packages/firebase_in_app_messaging/example/android/app/src/main/res/values/styles.xml new file mode 100644 index 000000000000..00fa4417cfbe --- /dev/null +++ b/packages/firebase_in_app_messaging/example/android/app/src/main/res/values/styles.xml @@ -0,0 +1,8 @@ + + + + diff --git a/packages/firebase_in_app_messaging/example/android/app/src/profile/AndroidManifest.xml b/packages/firebase_in_app_messaging/example/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 000000000000..94dd5928d625 --- /dev/null +++ b/packages/firebase_in_app_messaging/example/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/packages/firebase_in_app_messaging/example/android/build.gradle b/packages/firebase_in_app_messaging/example/android/build.gradle new file mode 100644 index 000000000000..f373ec6839c9 --- /dev/null +++ b/packages/firebase_in_app_messaging/example/android/build.gradle @@ -0,0 +1,31 @@ +buildscript { + repositories { + google() + jcenter() + } + + dependencies { + classpath 'com.android.tools.build:gradle:3.4.2' + classpath 'com.google.gms:google-services:4.3.0' + + } +} + +allprojects { + repositories { + google() + jcenter() + } +} + +rootProject.buildDir = '../build' +subprojects { + project.buildDir = "${rootProject.buildDir}/${project.name}" +} +subprojects { + project.evaluationDependsOn(':app') +} + +task clean(type: Delete) { + delete rootProject.buildDir +} diff --git a/packages/firebase_in_app_messaging/example/android/gradle.properties b/packages/firebase_in_app_messaging/example/android/gradle.properties new file mode 100644 index 000000000000..2bd6f4fda009 --- /dev/null +++ b/packages/firebase_in_app_messaging/example/android/gradle.properties @@ -0,0 +1,2 @@ +org.gradle.jvmargs=-Xmx1536M + diff --git a/packages/firebase_in_app_messaging/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/firebase_in_app_messaging/example/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 000000000000..659814bcc887 --- /dev/null +++ b/packages/firebase_in_app_messaging/example/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Mon Aug 05 20:16:36 BRT 2019 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip diff --git a/packages/firebase_in_app_messaging/example/android/settings.gradle b/packages/firebase_in_app_messaging/example/android/settings.gradle new file mode 100644 index 000000000000..5a2f14fb18f6 --- /dev/null +++ b/packages/firebase_in_app_messaging/example/android/settings.gradle @@ -0,0 +1,15 @@ +include ':app' + +def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() + +def plugins = new Properties() +def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') +if (pluginsFile.exists()) { + pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } +} + +plugins.each { name, path -> + def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() + include ":$name" + project(":$name").projectDir = pluginDirectory +} diff --git a/packages/firebase_in_app_messaging/example/ios/Flutter/AppFrameworkInfo.plist b/packages/firebase_in_app_messaging/example/ios/Flutter/AppFrameworkInfo.plist new file mode 100644 index 000000000000..6b4c0f78a785 --- /dev/null +++ b/packages/firebase_in_app_messaging/example/ios/Flutter/AppFrameworkInfo.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + App + CFBundleIdentifier + io.flutter.flutter.app + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + App + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + MinimumOSVersion + 8.0 + + diff --git a/packages/firebase_in_app_messaging/example/ios/Flutter/Debug.xcconfig b/packages/firebase_in_app_messaging/example/ios/Flutter/Debug.xcconfig new file mode 100644 index 000000000000..e8efba114687 --- /dev/null +++ b/packages/firebase_in_app_messaging/example/ios/Flutter/Debug.xcconfig @@ -0,0 +1,2 @@ +#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include "Generated.xcconfig" diff --git a/packages/firebase_in_app_messaging/example/ios/Flutter/Release.xcconfig b/packages/firebase_in_app_messaging/example/ios/Flutter/Release.xcconfig new file mode 100644 index 000000000000..399e9340e6f6 --- /dev/null +++ b/packages/firebase_in_app_messaging/example/ios/Flutter/Release.xcconfig @@ -0,0 +1,2 @@ +#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include "Generated.xcconfig" diff --git a/packages/firebase_in_app_messaging/example/ios/Runner.xcodeproj/project.pbxproj b/packages/firebase_in_app_messaging/example/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 000000000000..3b7693aef91e --- /dev/null +++ b/packages/firebase_in_app_messaging/example/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,600 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; + 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 9031715A22DD332B00CA8C68 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 9031715922DD332B00CA8C68 /* GoogleService-Info.plist */; }; + 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; + 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; + 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; + 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; + E638726B1F84F369FCA09810 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 914982FDACC51A62D1FAC1F1 /* libPods-Runner.a */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9705A1C41CF9048500538489 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, + 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 2D51D38D6F347D924BF73402 /* 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 = ""; }; + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; + 4DBCB98EE08F0263FFB39A45 /* 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 = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 9031715922DD332B00CA8C68 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; + 914982FDACC51A62D1FAC1F1 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 9697814F64329B9DFDDD2D22 /* 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 = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; + 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; + 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; + 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 97C146EB1CF9000F007C117D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, + 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, + E638726B1F84F369FCA09810 /* libPods-Runner.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 3273157BD1F69AB58A8F6978 /* Pods */ = { + isa = PBXGroup; + children = ( + 2D51D38D6F347D924BF73402 /* Pods-Runner.debug.xcconfig */, + 4DBCB98EE08F0263FFB39A45 /* Pods-Runner.release.xcconfig */, + 9697814F64329B9DFDDD2D22 /* Pods-Runner.profile.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; + 9308F32363B77379BD52E16A /* Frameworks */ = { + isa = PBXGroup; + children = ( + 914982FDACC51A62D1FAC1F1 /* libPods-Runner.a */, + ); + name = Frameworks; + sourceTree = ""; + }; + 9740EEB11CF90186004384FC /* Flutter */ = { + isa = PBXGroup; + children = ( + 3B80C3931E831B6300D905FE /* App.framework */, + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, + 9740EEBA1CF902C7004384FC /* Flutter.framework */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 9740EEB31CF90195004384FC /* Generated.xcconfig */, + ); + name = Flutter; + sourceTree = ""; + }; + 97C146E51CF9000F007C117D = { + isa = PBXGroup; + children = ( + 9740EEB11CF90186004384FC /* Flutter */, + 97C146F01CF9000F007C117D /* Runner */, + 97C146EF1CF9000F007C117D /* Products */, + 3273157BD1F69AB58A8F6978 /* Pods */, + 9308F32363B77379BD52E16A /* Frameworks */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + ); + name = Products; + sourceTree = ""; + }; + 97C146F01CF9000F007C117D /* Runner */ = { + isa = PBXGroup; + children = ( + 9031715922DD332B00CA8C68 /* GoogleService-Info.plist */, + 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, + 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, + 97C146FA1CF9000F007C117D /* Main.storyboard */, + 97C146FD1CF9000F007C117D /* Assets.xcassets */, + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, + 97C147021CF9000F007C117D /* Info.plist */, + 97C146F11CF9000F007C117D /* Supporting Files */, + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + ); + path = Runner; + sourceTree = ""; + }; + 97C146F11CF9000F007C117D /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 97C146F21CF9000F007C117D /* main.m */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 97C146ED1CF9000F007C117D /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 9FEE87118A15F39DB7049483 /* [CP] Check Pods Manifest.lock */, + 9740EEB61CF901F6004384FC /* Run Script */, + 97C146EA1CF9000F007C117D /* Sources */, + 97C146EB1CF9000F007C117D /* Frameworks */, + 97C146EC1CF9000F007C117D /* Resources */, + 9705A1C41CF9048500538489 /* Embed Frameworks */, + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + 9CB2B92FB733B57CFCD2086E /* [CP] Embed Pods Frameworks */, + 4E58458F4BA4D6603A0A2A9C /* [CP] Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Runner; + productName = Runner; + productReference = 97C146EE1CF9000F007C117D /* Runner.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 97C146E61CF9000F007C117D /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1020; + ORGANIZATIONNAME = "The Chromium Authors"; + TargetAttributes = { + 97C146ED1CF9000F007C117D = { + CreatedOnToolsVersion = 7.3.1; + DevelopmentTeam = TA9VLBVN24; + }; + }; + }; + buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 97C146E51CF9000F007C117D; + productRefGroup = 97C146EF1CF9000F007C117D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 97C146ED1CF9000F007C117D /* Runner */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 97C146EC1CF9000F007C117D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + 9031715A22DD332B00CA8C68 /* GoogleService-Info.plist in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Thin Binary"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; + }; + 4E58458F4BA4D6603A0A2A9C /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + 9740EEB61CF901F6004384FC /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + }; + 9CB2B92FB733B57CFCD2086E /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 9FEE87118A15F39DB7049483 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, + 97C146F31CF9000F007C117D /* main.m in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 97C146FA1CF9000F007C117D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C146FB1CF9000F007C117D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C147001CF9000F007C117D /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 249021D3217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Profile; + }; + 249021D4217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = TA9VLBVN24; + ENABLE_BITCODE = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.firebaseInAppMessagingExample; + PRODUCT_NAME = "$(TARGET_NAME)"; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 97C147041CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 97C147061CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = TA9VLBVN24; + ENABLE_BITCODE = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.firebaseInAppMessagingExample; + PRODUCT_NAME = "$(TARGET_NAME)"; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 97C147071CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = TA9VLBVN24; + ENABLE_BITCODE = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.firebaseInAppMessagingExample; + PRODUCT_NAME = "$(TARGET_NAME)"; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147031CF9000F007C117D /* Debug */, + 97C147041CF9000F007C117D /* Release */, + 249021D3217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147061CF9000F007C117D /* Debug */, + 97C147071CF9000F007C117D /* Release */, + 249021D4217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 97C146E61CF9000F007C117D /* Project object */; +} diff --git a/packages/firebase_in_app_messaging/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/firebase_in_app_messaging/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 000000000000..37add4ed8194 --- /dev/null +++ b/packages/firebase_in_app_messaging/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/AppDelegate.h b/packages/firebase_in_app_messaging/example/ios/Runner/AppDelegate.h new file mode 100644 index 000000000000..36e21bbf9cf4 --- /dev/null +++ b/packages/firebase_in_app_messaging/example/ios/Runner/AppDelegate.h @@ -0,0 +1,6 @@ +#import +#import + +@interface AppDelegate : FlutterAppDelegate + +@end diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/AppDelegate.m b/packages/firebase_in_app_messaging/example/ios/Runner/AppDelegate.m new file mode 100644 index 000000000000..59a72e90be12 --- /dev/null +++ b/packages/firebase_in_app_messaging/example/ios/Runner/AppDelegate.m @@ -0,0 +1,13 @@ +#include "AppDelegate.h" +#include "GeneratedPluginRegistrant.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application + didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + [GeneratedPluginRegistrant registerWithRegistry:self]; + // Override point for customization after application launch. + return [super application:application didFinishLaunchingWithOptions:launchOptions]; +} + +@end diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000000..d36b1fab2d9d --- /dev/null +++ b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,122 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@3x.png", + "scale" : "3x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@1x.png", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@1x.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@1x.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@2x.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-App-83.5x83.5@2x.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "Icon-App-1024x1024@1x.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png new file mode 100644 index 000000000000..3d43d11e66f4 Binary files /dev/null and b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png new file mode 100644 index 000000000000..28c6bf03016f Binary files /dev/null and b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 000000000000..2ccbfd967d96 Binary files /dev/null and b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 000000000000..f091b6b0bca8 Binary files /dev/null and b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 000000000000..4cde12118dda Binary files /dev/null and b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 000000000000..d0ef06e7edb8 Binary files /dev/null and b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png new file mode 100644 index 000000000000..dcdc2306c285 Binary files /dev/null and b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png new file mode 100644 index 000000000000..2ccbfd967d96 Binary files /dev/null and b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 000000000000..c8f9ed8f5cee Binary files /dev/null and b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 000000000000..a6d6b8609df0 Binary files /dev/null and b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 000000000000..a6d6b8609df0 Binary files /dev/null and b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 000000000000..75b2d164a5a9 Binary files /dev/null and b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 000000000000..c4df70d39da7 Binary files /dev/null and b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png new file mode 100644 index 000000000000..6a84f41e14e2 Binary files /dev/null and b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 000000000000..d0e1f5853602 Binary files /dev/null and b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 000000000000..0bedcf2fd467 --- /dev/null +++ b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "LaunchImage.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 000000000000..9da19eacad3b Binary files /dev/null and b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 000000000000..9da19eacad3b Binary files /dev/null and b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 000000000000..9da19eacad3b Binary files /dev/null and b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md new file mode 100644 index 000000000000..89c2725b70f1 --- /dev/null +++ b/packages/firebase_in_app_messaging/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md @@ -0,0 +1,5 @@ +# Launch Screen Assets + +You can customize the launch screen with your own desired assets by replacing the image files in this directory. + +You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/packages/firebase_in_app_messaging/example/ios/Runner/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 000000000000..f2e259c7c939 --- /dev/null +++ b/packages/firebase_in_app_messaging/example/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/Base.lproj/Main.storyboard b/packages/firebase_in_app_messaging/example/ios/Runner/Base.lproj/Main.storyboard new file mode 100644 index 000000000000..3950f04ab0f9 --- /dev/null +++ b/packages/firebase_in_app_messaging/example/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/GoogleService-Info.plist b/packages/firebase_in_app_messaging/example/ios/Runner/GoogleService-Info.plist new file mode 100644 index 000000000000..0ad19e34cfee --- /dev/null +++ b/packages/firebase_in_app_messaging/example/ios/Runner/GoogleService-Info.plist @@ -0,0 +1,36 @@ + + + + + CLIENT_ID + 417703151161-0kmftqj80per9egdcai8c89sefjdptfg.apps.googleusercontent.com + REVERSED_CLIENT_ID + com.googleusercontent.apps.417703151161-0kmftqj80per9egdcai8c89sefjdptfg + API_KEY + AIzaSyAirg5nBv4fsGWF82ITldAd04thCp04WQ0 + GCM_SENDER_ID + 417703151161 + PLIST_VERSION + 1 + BUNDLE_ID + com.example.firebaseInAppMessagingExample + PROJECT_ID + fiamflutter + STORAGE_BUCKET + fiamflutter.appspot.com + IS_ADS_ENABLED + + IS_ANALYTICS_ENABLED + + IS_APPINVITE_ENABLED + + IS_GCM_ENABLED + + IS_SIGNIN_ENABLED + + GOOGLE_APP_ID + 1:417703151161:ios:2ad9dffe6e82f02c + DATABASE_URL + https://fiamflutter.firebaseio.com + + \ No newline at end of file diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/Info.plist b/packages/firebase_in_app_messaging/example/ios/Runner/Info.plist new file mode 100644 index 000000000000..9afd5ae7969f --- /dev/null +++ b/packages/firebase_in_app_messaging/example/ios/Runner/Info.plist @@ -0,0 +1,45 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + firebase_in_app_messaging_example + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UIViewControllerBasedStatusBarAppearance + + + diff --git a/packages/firebase_in_app_messaging/example/ios/Runner/main.m b/packages/firebase_in_app_messaging/example/ios/Runner/main.m new file mode 100644 index 000000000000..dff6597e4513 --- /dev/null +++ b/packages/firebase_in_app_messaging/example/ios/Runner/main.m @@ -0,0 +1,9 @@ +#import +#import +#import "AppDelegate.h" + +int main(int argc, char* argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/packages/firebase_in_app_messaging/example/lib/main.dart b/packages/firebase_in_app_messaging/example/lib/main.dart new file mode 100644 index 000000000000..8f187657f95e --- /dev/null +++ b/packages/firebase_in_app_messaging/example/lib/main.dart @@ -0,0 +1,123 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'dart:async'; + +import 'package:firebase_analytics/firebase_analytics.dart'; +import 'package:firebase_in_app_messaging/firebase_in_app_messaging.dart'; +import 'package:flutter/material.dart'; + +void main() => runApp(MyApp()); + +class MyApp extends StatelessWidget { + static FirebaseAnalytics analytics = FirebaseAnalytics(); + static FirebaseInAppMessaging fiam = FirebaseInAppMessaging(); + + @override + Widget build(BuildContext context) { + return MaterialApp( + home: Scaffold( + appBar: AppBar( + title: const Text('In-App Messaging example'), + ), + body: Builder(builder: (BuildContext context) { + return Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + AnalyticsEventExample(), + ProgrammaticTriggersExample(fiam), + ], + ), + ); + }), + )); + } +} + +class ProgrammaticTriggersExample extends StatelessWidget { + const ProgrammaticTriggersExample(this.fiam); + + final FirebaseInAppMessaging fiam; + + @override + Widget build(BuildContext context) { + return Card( + child: Padding( + padding: const EdgeInsets.all(24.0), + child: Column( + children: [ + Text( + "Programmatic Trigger", + style: TextStyle( + fontStyle: FontStyle.italic, + fontSize: 18, + ), + ), + const SizedBox(height: 8), + const Text("Manually trigger events programmatically "), + const SizedBox(height: 8), + RaisedButton( + onPressed: () { + fiam.triggerEvent('chicken_event'); + Scaffold.of(context).showSnackBar(SnackBar( + content: const Text("Triggering event: chicken_event"))); + }, + color: Colors.blue, + child: Text( + "Programmatic Triggers".toUpperCase(), + style: TextStyle(color: Colors.white), + ), + ) + ], + ), + ), + ); + } +} + +class AnalyticsEventExample extends StatelessWidget { + Future _sendAnalyticsEvent() async { + await MyApp.analytics + .logEvent(name: 'awesome_event', parameters: { + 'int': 42, // not required? + }); + } + + @override + Widget build(BuildContext context) { + return Card( + child: Padding( + padding: const EdgeInsets.all(24.0), + child: Column( + children: [ + Text( + "Log an analytics event", + style: TextStyle( + fontStyle: FontStyle.italic, + fontSize: 18, + ), + ), + const SizedBox(height: 8), + const Text("Trigger an analytics event"), + const SizedBox(height: 8), + RaisedButton( + onPressed: () { + _sendAnalyticsEvent(); + Scaffold.of(context).showSnackBar(SnackBar( + content: + const Text("Firing analytics event: awesome_event"))); + }, + color: Colors.blue, + child: Text( + "Log event".toUpperCase(), + style: TextStyle(color: Colors.white), + ), + ), + ], + ), + ), + ); + } +} diff --git a/packages/firebase_in_app_messaging/example/pubspec.yaml b/packages/firebase_in_app_messaging/example/pubspec.yaml new file mode 100644 index 000000000000..a2acd35b132f --- /dev/null +++ b/packages/firebase_in_app_messaging/example/pubspec.yaml @@ -0,0 +1,26 @@ +name: firebase_in_app_messaging_example +description: Demonstrates how to use the firebase_in_app_messaging plugin. +publish_to: 'none' + +environment: + sdk: ">=2.1.0 <3.0.0" + +dependencies: + flutter: + sdk: flutter + cupertino_icons: ^0.1.2 + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_driver: + sdk: flutter + test: any + + firebase_in_app_messaging: + path: ../ + firebase_core: ^0.4.0+8 + firebase_analytics: ^4.0.2 + +flutter: + uses-material-design: true diff --git a/packages/firebase_in_app_messaging/example/test_driver/firebase_in_app_messaging.dart b/packages/firebase_in_app_messaging/example/test_driver/firebase_in_app_messaging.dart new file mode 100644 index 000000000000..62953cee0316 --- /dev/null +++ b/packages/firebase_in_app_messaging/example/test_driver/firebase_in_app_messaging.dart @@ -0,0 +1,32 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'dart:async'; + +import 'package:firebase_in_app_messaging/firebase_in_app_messaging.dart'; +import 'package:flutter_driver/driver_extension.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + final Completer completer = Completer(); + enableFlutterDriverExtension(handler: (_) => completer.future); + tearDownAll(() => completer.complete(null)); + + group('firebase_in_app_messaging', () { + FirebaseInAppMessaging fiam; + + setUp(() { + fiam = FirebaseInAppMessaging(); + }); + + test('triggerEvent', () { + expect(fiam.triggerEvent('someEvent'), completes); + }); + + test('logging', () { + expect(fiam.setMessagesSuppressed(true), completes); + expect(fiam.setAutomaticDataCollectionEnabled(true), completes); + }); + }); +} diff --git a/packages/firebase_in_app_messaging/example/test_driver/firebase_in_app_messaging_test.dart b/packages/firebase_in_app_messaging/example/test_driver/firebase_in_app_messaging_test.dart new file mode 100644 index 000000000000..cc11eae240e3 --- /dev/null +++ b/packages/firebase_in_app_messaging/example/test_driver/firebase_in_app_messaging_test.dart @@ -0,0 +1,7 @@ +import 'package:flutter_driver/flutter_driver.dart'; + +void main() async { + final FlutterDriver driver = await FlutterDriver.connect(); + await driver.requestData(null, timeout: const Duration(minutes: 1)); + driver.close(); +} diff --git a/packages/firebase_in_app_messaging/ios/.gitignore b/packages/firebase_in_app_messaging/ios/.gitignore new file mode 100644 index 000000000000..710ec6cf1c71 --- /dev/null +++ b/packages/firebase_in_app_messaging/ios/.gitignore @@ -0,0 +1,36 @@ +.idea/ +.vagrant/ +.sconsign.dblite +.svn/ + +.DS_Store +*.swp +profile + +DerivedData/ +build/ +GeneratedPluginRegistrant.h +GeneratedPluginRegistrant.m + +.generated/ + +*.pbxuser +*.mode1v3 +*.mode2v3 +*.perspectivev3 + +!default.pbxuser +!default.mode1v3 +!default.mode2v3 +!default.perspectivev3 + +xcuserdata + +*.moved-aside + +*.pyc +*sync/ +Icon? +.tags* + +/Flutter/Generated.xcconfig diff --git a/packages/firebase_in_app_messaging/ios/Assets/.gitkeep b/packages/firebase_in_app_messaging/ios/Assets/.gitkeep new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/firebase_in_app_messaging/ios/Classes/FirebaseInAppMessagingPlugin.h b/packages/firebase_in_app_messaging/ios/Classes/FirebaseInAppMessagingPlugin.h new file mode 100644 index 000000000000..8a11472c4197 --- /dev/null +++ b/packages/firebase_in_app_messaging/ios/Classes/FirebaseInAppMessagingPlugin.h @@ -0,0 +1,8 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import + +@interface FirebaseInAppMessagingPlugin : NSObject +@end diff --git a/packages/firebase_in_app_messaging/ios/Classes/FirebaseInAppMessagingPlugin.m b/packages/firebase_in_app_messaging/ios/Classes/FirebaseInAppMessagingPlugin.m new file mode 100644 index 000000000000..8ae625e4915b --- /dev/null +++ b/packages/firebase_in_app_messaging/ios/Classes/FirebaseInAppMessagingPlugin.m @@ -0,0 +1,51 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "FirebaseInAppMessagingPlugin.h" + +#import + +@implementation FirebaseInAppMessagingPlugin ++ (void)registerWithRegistrar:(NSObject *)registrar { + FlutterMethodChannel *channel = + [FlutterMethodChannel methodChannelWithName:@"plugins.flutter.io/firebase_in_app_messaging" + binaryMessenger:[registrar messenger]]; + FirebaseInAppMessagingPlugin *instance = [[FirebaseInAppMessagingPlugin alloc] init]; + [registrar addMethodCallDelegate:instance channel:channel]; +} + +- (instancetype)init { + self = [super init]; + if (self) { + if (![FIRApp appNamed:@"__FIRAPP_DEFAULT"]) { + NSLog(@"Configuring the default Firebase app..."); + [FIRApp configure]; + NSLog(@"Configured the default Firebase app %@.", [FIRApp defaultApp].name); + } + } + return self; +} + +- (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result { + if ([@"triggerEvent" isEqualToString:call.method]) { + NSString *eventName = call.arguments[@"eventName"]; + FIRInAppMessaging *fiam = [FIRInAppMessaging inAppMessaging]; + [fiam triggerEvent:eventName]; + result(nil); + } else if ([@"setMessagesSuppressed" isEqualToString:call.method]) { + NSNumber *suppress = [NSNumber numberWithBool:call.arguments]; + FIRInAppMessaging *fiam = [FIRInAppMessaging inAppMessaging]; + fiam.messageDisplaySuppressed = [suppress boolValue]; + result(nil); + } else if ([@"setAutomaticDataCollectionEnabled" isEqualToString:call.method]) { + NSNumber *enabled = [NSNumber numberWithBool:call.arguments]; + FIRInAppMessaging *fiam = [FIRInAppMessaging inAppMessaging]; + fiam.automaticDataCollectionEnabled = [enabled boolValue]; + result(nil); + } else { + result(FlutterMethodNotImplemented); + } +} + +@end diff --git a/packages/firebase_in_app_messaging/ios/firebase_in_app_messaging.podspec b/packages/firebase_in_app_messaging/ios/firebase_in_app_messaging.podspec new file mode 100644 index 000000000000..fd303b761684 --- /dev/null +++ b/packages/firebase_in_app_messaging/ios/firebase_in_app_messaging.podspec @@ -0,0 +1,24 @@ +# +# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html +# +Pod::Spec.new do |s| + s.name = 'firebase_in_app_messaging' + s.version = '0.0.1' + s.summary = 'In-App Messaging Plugin for Firebase' + s.description = <<-DESC +Flutter plugin for Firebase In-App Messaging. + DESC + s.homepage = 'https://github.com/FirebaseExtended/flutterfire/tree/master/packages/firebase_in_app_messaging' + s.license = { :file => '../LICENSE' } + s.author = { 'Flutter Team' => 'flutter-dev@googlegroups.com' } + s.source = { :path => '.' } + s.source_files = 'Classes/**/*' + s.public_header_files = 'Classes/**/*.h' + s.dependency 'Flutter' + s.dependency 'Firebase' + s.dependency 'Firebase/InAppMessagingDisplay' + s.static_framework = true + + s.ios.deployment_target = '8.0' +end + diff --git a/packages/firebase_in_app_messaging/lib/firebase_in_app_messaging.dart b/packages/firebase_in_app_messaging/lib/firebase_in_app_messaging.dart new file mode 100644 index 000000000000..e6549888c3ed --- /dev/null +++ b/packages/firebase_in_app_messaging/lib/firebase_in_app_messaging.dart @@ -0,0 +1,42 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'dart:async'; + +import 'package:flutter/services.dart'; +import 'package:meta/meta.dart'; + +class FirebaseInAppMessaging { + @visibleForTesting + static const MethodChannel channel = + MethodChannel('plugins.flutter.io/firebase_in_app_messaging'); + + static FirebaseInAppMessaging _instance = FirebaseInAppMessaging(); + + /// Gets the instance of In-App Messaging for the default Firebase app. + static FirebaseInAppMessaging get instance => _instance; + + /// Triggers an analytics event. + Future triggerEvent(String eventName) async { + await channel.invokeMethod( + 'triggerEvent', {'eventName': eventName}); + } + + /// Enables or disables suppression of message displays. + Future setMessagesSuppressed(bool suppress) async { + if (suppress == null) { + throw ArgumentError.notNull('suppress'); + } + await channel.invokeMethod('setMessagesSuppressed', suppress); + } + + /// Disable data collection for the app. + Future setAutomaticDataCollectionEnabled(bool enabled) async { + if (enabled == null) { + throw ArgumentError.notNull('enabled'); + } + await channel.invokeMethod( + 'setAutomaticDataCollectionEnabled', enabled); + } +} diff --git a/packages/firebase_in_app_messaging/pubspec.yaml b/packages/firebase_in_app_messaging/pubspec.yaml new file mode 100644 index 000000000000..d2de0d00d22a --- /dev/null +++ b/packages/firebase_in_app_messaging/pubspec.yaml @@ -0,0 +1,25 @@ +name: firebase_in_app_messaging +description: Flutter plugin for Firebase In-App Messaging. +version: 0.0.1+3 +author: Flutter Team +homepage: https://github.com/FirebaseExtended/flutterfire/tree/master/packages/firebase_in_app_messaging + +environment: + sdk: ">=2.1.0 <3.0.0" + +dependencies: + meta: ^1.1.6 + flutter: + sdk: flutter + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_driver: + sdk: flutter + test: any + +flutter: + plugin: + androidPackage: com.example.firebase_in_app_messaging + pluginClass: FirebaseInAppMessagingPlugin diff --git a/packages/firebase_in_app_messaging/test/firebase_in_app_messaging_test.dart b/packages/firebase_in_app_messaging/test/firebase_in_app_messaging_test.dart new file mode 100644 index 000000000000..7e883a7ee714 --- /dev/null +++ b/packages/firebase_in_app_messaging/test/firebase_in_app_messaging_test.dart @@ -0,0 +1,60 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:firebase_in_app_messaging/firebase_in_app_messaging.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + TestWidgetsFlutterBinding.ensureInitialized(); + + group('$FirebaseInAppMessaging', () { + final List log = []; + + setUp(() { + log.clear(); + FirebaseInAppMessaging.channel + .setMockMethodCallHandler((MethodCall methodcall) async { + log.add(methodcall); + return true; + }); + }); + + test('triggerEvent', () async { + final FirebaseInAppMessaging fiam = FirebaseInAppMessaging(); + await fiam.triggerEvent('someEvent'); + expect(log, [ + isMethodCall('triggerEvent', + arguments: {"eventName": "someEvent"}), + ]); + }); + + test('setMessagesSuppressed', () async { + final FirebaseInAppMessaging fiam = FirebaseInAppMessaging(); + await fiam.setMessagesSuppressed(true); + expect(log, + [isMethodCall('setMessagesSuppressed', arguments: true)]); + + log.clear(); + fiam.setMessagesSuppressed(false); + expect(log, [ + isMethodCall('setMessagesSuppressed', arguments: false), + ]); + }); + + test('setDataCollectionEnabled', () async { + final FirebaseInAppMessaging fiam = FirebaseInAppMessaging(); + await fiam.setAutomaticDataCollectionEnabled(true); + expect(log, [ + isMethodCall('setAutomaticDataCollectionEnabled', arguments: true) + ]); + + log.clear(); + fiam.setAutomaticDataCollectionEnabled(false); + expect(log, [ + isMethodCall('setAutomaticDataCollectionEnabled', arguments: false), + ]); + }); + }); +}