├── .gitignore ├── .idea ├── codeStyles │ └── Project.xml ├── libraries │ ├── Dart_SDK.xml │ └── Flutter_Plugins.xml ├── misc.xml ├── modules.xml ├── vcs.xml └── workspace.xml ├── CHANGELOG.md ├── LICENSE ├── README.md ├── android ├── .classpath ├── .gitignore ├── .idea │ ├── .name │ ├── caches │ │ ├── build_file_checksums.ser │ │ └── gradle_models.ser │ ├── encodings.xml │ ├── gradle.xml │ ├── misc.xml │ └── vcs.xml ├── .project ├── .settings │ └── org.eclipse.buildship.core.prefs ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── settings.gradle └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── example │ │ └── medianotification │ │ ├── MediaNotificationPlugin.java │ │ ├── NotificationPanel.java │ │ └── NotificationReturnSlot.java │ └── res │ ├── drawable-hdpi │ ├── baseline_pause_black_18.png │ ├── baseline_pause_black_24.png │ ├── baseline_pause_black_36.png │ ├── baseline_pause_black_48.png │ ├── baseline_play_arrow_black_18.png │ ├── baseline_play_arrow_black_24.png │ ├── baseline_play_arrow_black_36.png │ ├── baseline_play_arrow_black_48.png │ ├── baseline_skip_next_black_18.png │ ├── baseline_skip_next_black_24.png │ ├── baseline_skip_next_black_36.png │ ├── baseline_skip_next_black_48.png │ ├── baseline_skip_previous_black_18.png │ ├── baseline_skip_previous_black_24.png │ ├── baseline_skip_previous_black_36.png │ ├── baseline_skip_previous_black_48.png │ └── ic_stat_music_note.png │ ├── drawable-mdpi │ ├── baseline_pause_black_18.png │ ├── baseline_pause_black_24.png │ ├── baseline_pause_black_36.png │ ├── baseline_pause_black_48.png │ ├── baseline_play_arrow_black_18.png │ ├── baseline_play_arrow_black_24.png │ ├── baseline_play_arrow_black_36.png │ ├── baseline_play_arrow_black_48.png │ ├── baseline_skip_next_black_18.png │ ├── baseline_skip_next_black_24.png │ ├── baseline_skip_next_black_36.png │ ├── baseline_skip_next_black_48.png │ ├── baseline_skip_previous_black_18.png │ ├── baseline_skip_previous_black_24.png │ ├── baseline_skip_previous_black_36.png │ ├── baseline_skip_previous_black_48.png │ └── ic_stat_music_note.png │ ├── drawable-xhdpi │ ├── baseline_pause_black_18.png │ ├── baseline_pause_black_24.png │ ├── baseline_pause_black_36.png │ ├── baseline_pause_black_48.png │ ├── baseline_play_arrow_black_18.png │ ├── baseline_play_arrow_black_24.png │ ├── baseline_play_arrow_black_36.png │ ├── baseline_play_arrow_black_48.png │ ├── baseline_skip_next_black_18.png │ ├── baseline_skip_next_black_24.png │ ├── baseline_skip_next_black_36.png │ ├── baseline_skip_next_black_48.png │ ├── baseline_skip_previous_black_18.png │ ├── baseline_skip_previous_black_24.png │ ├── baseline_skip_previous_black_36.png │ ├── baseline_skip_previous_black_48.png │ └── ic_stat_music_note.png │ ├── drawable-xxhdpi │ ├── baseline_pause_black_18.png │ ├── baseline_pause_black_24.png │ ├── baseline_pause_black_36.png │ ├── baseline_pause_black_48.png │ ├── baseline_play_arrow_black_18.png │ ├── baseline_play_arrow_black_24.png │ ├── baseline_play_arrow_black_36.png │ ├── baseline_play_arrow_black_48.png │ ├── baseline_skip_next_black_18.png │ ├── baseline_skip_next_black_24.png │ ├── baseline_skip_next_black_36.png │ ├── baseline_skip_next_black_48.png │ ├── baseline_skip_previous_black_18.png │ ├── baseline_skip_previous_black_24.png │ ├── baseline_skip_previous_black_36.png │ ├── baseline_skip_previous_black_48.png │ └── ic_stat_music_note.png │ ├── drawable-xxxhdpi │ ├── baseline_pause_black_18.png │ ├── baseline_pause_black_24.png │ ├── baseline_pause_black_36.png │ ├── baseline_pause_black_48.png │ ├── baseline_play_arrow_black_18.png │ ├── baseline_play_arrow_black_24.png │ ├── baseline_play_arrow_black_36.png │ ├── baseline_play_arrow_black_48.png │ ├── baseline_skip_next_black_18.png │ ├── baseline_skip_next_black_24.png │ ├── baseline_skip_next_black_36.png │ ├── baseline_skip_next_black_48.png │ ├── baseline_skip_previous_black_18.png │ ├── baseline_skip_previous_black_24.png │ ├── baseline_skip_previous_black_36.png │ ├── baseline_skip_previous_black_48.png │ └── ic_stat_music_note.png │ ├── drawable │ └── launch_background.xml │ ├── layout │ └── notificationlayout.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 ├── example ├── .gitignore ├── .idea │ ├── libraries │ │ ├── Dart_SDK.xml │ │ └── Flutter_for_Android.xml │ ├── modules.xml │ ├── runConfigurations │ │ └── main_dart.xml │ └── workspace.xml ├── .metadata ├── README.md ├── android │ ├── .gitignore │ ├── .idea │ │ ├── gradle.xml │ │ ├── misc.xml │ │ ├── modules.xml │ │ └── runConfigurations.xml │ ├── .project │ ├── .settings │ │ └── org.eclipse.buildship.core.prefs │ ├── app │ │ ├── build.gradle │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── medianotificationexample │ │ │ │ └── MainActivity.java │ │ │ └── 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 │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── ios │ ├── .gitignore │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ └── Release.xcconfig │ ├── Podfile │ ├── Podfile.lock │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── Runner │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── 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 │ │ └── main.m ├── lib │ └── main.dart ├── media_notification_example.iml ├── media_notification_example_android.iml └── pubspec.yaml ├── ios ├── .gitignore ├── Assets │ └── .gitkeep ├── Classes │ ├── MediaNotificationPlugin.h │ └── MediaNotificationPlugin.m └── media_notification.podspec ├── lib └── media_notification.dart ├── media_notification.iml ├── media_notification_android.iml └── pubspec.yaml /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .dart_tool/ 3 | 4 | .packages 5 | .pub/ 6 | pubspec.lock 7 | 8 | build/ 9 | -------------------------------------------------------------------------------- /.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 15 | 16 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /.idea/libraries/Dart_SDK.xml: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /.idea/libraries/Flutter_Plugins.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.0.1 2 | 3 | * TODO: Describe initial release. 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # media_notification 2 | 3 | Media notification for flutter, on android 4 | 5 | ## Getting Started 6 | 7 | For help getting started with Flutter, view our online 8 | [documentation](https://flutter.io/). 9 | 10 | For help on editing plugin code, view the [documentation](https://flutter.io/platform-plugins/#edit-code). -------------------------------------------------------------------------------- /android/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /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/.idea/.name: -------------------------------------------------------------------------------- 1 | media_notification -------------------------------------------------------------------------------- /android/.idea/caches/build_file_checksums.ser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/.idea/caches/build_file_checksums.ser -------------------------------------------------------------------------------- /android/.idea/caches/gradle_models.ser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/.idea/caches/gradle_models.ser -------------------------------------------------------------------------------- /android/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /android/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16 | 17 | -------------------------------------------------------------------------------- /android/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 37 | 38 | 39 | 40 | 41 | 42 | 44 | -------------------------------------------------------------------------------- /android/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /android/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | media_notification 4 | Project media_notification created by Buildship. 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.buildship.core.gradleprojectbuilder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.jdt.core.javanature 21 | org.eclipse.buildship.core.gradleprojectnature 22 | 23 | 24 | -------------------------------------------------------------------------------- /android/.settings/org.eclipse.buildship.core.prefs: -------------------------------------------------------------------------------- 1 | connection.project.dir= 2 | eclipse.preferences.version=1 3 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | group 'com.example.medianotification' 2 | version '1.0-SNAPSHOT' 3 | 4 | buildscript { 5 | repositories { 6 | google() 7 | jcenter() 8 | } 9 | 10 | dependencies { 11 | classpath 'com.android.tools.build:gradle:3.2.1' 12 | } 13 | } 14 | 15 | rootProject.allprojects { 16 | repositories { 17 | google() 18 | jcenter() 19 | } 20 | } 21 | 22 | apply plugin: 'com.android.library' 23 | 24 | android { 25 | compileSdkVersion 28 26 | 27 | defaultConfig { 28 | minSdkVersion 18 29 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 30 | } 31 | lintOptions { 32 | disable 'InvalidPackage' 33 | } 34 | } 35 | 36 | dependencies { 37 | implementation 'androidx.media:media:1.0.0' 38 | } -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | android.enableJetifier=true 2 | android.useAndroidX=true 3 | org.gradle.jvmargs=-Xmx1536M 4 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Aug 14 23:17:04 YEKT 2018 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.6-all.zip 7 | -------------------------------------------------------------------------------- /android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'media_notification' 2 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /android/src/main/java/com/example/medianotification/MediaNotificationPlugin.java: -------------------------------------------------------------------------------- 1 | package com.example.medianotification; 2 | 3 | import io.flutter.plugin.common.MethodCall; 4 | import io.flutter.plugin.common.MethodChannel; 5 | import io.flutter.plugin.common.MethodChannel.MethodCallHandler; 6 | import io.flutter.plugin.common.MethodChannel.Result; 7 | import io.flutter.plugin.common.PluginRegistry.Registrar; 8 | import android.app.NotificationChannel; 9 | import android.app.NotificationManager; 10 | import android.content.Context; 11 | import android.media.AudioManager; 12 | import android.os.Build; 13 | import android.net.wifi.WifiManager; 14 | import android.net.wifi.WifiManager.WifiLock; 15 | import android.util.Log; 16 | 17 | 18 | /** MediaNotificationPlugin */ 19 | public class MediaNotificationPlugin implements MethodCallHandler { 20 | private static final String TAG = "MediaNotificationPanel"; 21 | private static final String CHANNEL_ID = "media_notification"; 22 | private static Registrar registrar; 23 | private static NotificationPanel nPanel; 24 | private static MethodChannel channel; 25 | 26 | private MediaNotificationPlugin(Registrar r) { 27 | registrar = r; 28 | } 29 | 30 | /** Plugin registration. */ 31 | public static void registerWith(Registrar registrar) { 32 | MediaNotificationPlugin plugin = new MediaNotificationPlugin(registrar); 33 | 34 | MediaNotificationPlugin.channel = new MethodChannel(registrar.messenger(), "media_notification"); 35 | MediaNotificationPlugin.channel.setMethodCallHandler(new MediaNotificationPlugin(registrar)); 36 | } 37 | 38 | @Override 39 | public void onMethodCall(MethodCall call, Result result) { 40 | switch (call.method) { 41 | case "show": 42 | final String title = call.argument("title"); 43 | final String author = call.argument("author"); 44 | final boolean play = call.argument("play"); 45 | show(title, author, play); 46 | result.success(null); 47 | break; 48 | 49 | case "hide": 50 | hide(); 51 | result.success(null); 52 | break; 53 | 54 | case "stopSound": 55 | stopSound(); 56 | result.success(null); 57 | break; 58 | 59 | case "getWifiLock": 60 | getWifiLock(); 61 | result.success(null); 62 | break; 63 | 64 | case "releaseWifiLock": 65 | releaseLocks(); 66 | result.success(null); 67 | break; 68 | 69 | default: 70 | result.notImplemented(); 71 | } 72 | } 73 | 74 | public static void callEvent(String event) { 75 | if (channel != null) { 76 | MediaNotificationPlugin.channel.invokeMethod(event, null, new Result() { 77 | @Override 78 | public void success(Object o) { } 79 | 80 | @Override 81 | public void error(String s, String s1, Object o) { } 82 | 83 | @Override 84 | public void notImplemented() { } 85 | }); 86 | } else { 87 | Log.e(TAG, "Message callEvent - Channel Null"); 88 | } 89 | } 90 | 91 | public static void show(String title, String author, boolean play) { 92 | Log.i(TAG, "show"); 93 | if (nPanel != null) { 94 | nPanel.releaseLocks(); 95 | } 96 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { 97 | int importance = NotificationManager.IMPORTANCE_DEFAULT; 98 | NotificationChannel channel = new NotificationChannel(CHANNEL_ID, CHANNEL_ID, importance); 99 | if (channel != null) { 100 | channel.enableVibration(false); 101 | channel.setSound(null, null); 102 | NotificationManager notificationManager = registrar.context().getSystemService(NotificationManager.class); 103 | notificationManager.createNotificationChannel(channel); 104 | } 105 | } 106 | nPanel = new NotificationPanel(registrar.context(), title, author, play); 107 | } 108 | 109 | private void hide() { 110 | Log.i(TAG, "hide"); 111 | if (nPanel != null) { 112 | nPanel.notificationCancel(); 113 | } 114 | } 115 | private void stopSound() { 116 | Log.i(TAG, "stopSound"); 117 | if (nPanel != null) { 118 | nPanel.stopSound(); 119 | } else { 120 | show("RÚV", "", false); 121 | nPanel.stopSound(); 122 | hide(); 123 | } 124 | } 125 | 126 | private void getWifiLock() { 127 | Log.i(TAG, "getWifiLock"); 128 | if (nPanel != null) { 129 | nPanel.getWifiLock(); 130 | } else { 131 | show("RÚV", "", false); 132 | nPanel.getWifiLock(); 133 | hide(); 134 | } 135 | 136 | } 137 | 138 | private void releaseLocks() { 139 | Log.i(TAG, "releaseWifiLock"); 140 | if (nPanel != null) { 141 | nPanel.releaseLocks(); 142 | } else { 143 | show("RÚV", "", false); 144 | nPanel.releaseLocks(); 145 | hide(); 146 | } 147 | } 148 | 149 | public void onDestroy() { 150 | hide(); 151 | } 152 | } 153 | -------------------------------------------------------------------------------- /android/src/main/java/com/example/medianotification/NotificationPanel.java: -------------------------------------------------------------------------------- 1 | package com.example.medianotification; 2 | 3 | import android.app.Activity; 4 | import android.app.ActivityManager; 5 | import android.app.Notification; 6 | import android.app.NotificationManager; 7 | import android.app.PendingIntent; 8 | import android.content.Context; 9 | import android.content.Intent; 10 | import android.media.AudioManager; 11 | import android.net.wifi.WifiManager; 12 | import android.os.Build; 13 | import android.os.PowerManager; 14 | import androidx.core.app.NotificationCompat; 15 | import android.util.Log; 16 | import android.widget.RemoteViews; 17 | 18 | import java.util.Iterator; 19 | import java.util.List; 20 | import java.util.Timer; 21 | import java.util.TimerTask; 22 | 23 | public class NotificationPanel extends Activity { 24 | private static final String TAG = "MediaNotificationPanel"; 25 | private static final int NOTIFICATION_ID = 1565461; 26 | Timer t; 27 | private Context parent; 28 | private NotificationManager nManager; 29 | private NotificationCompat.Builder nBuilder; 30 | private RemoteViews remoteView; 31 | private String title; 32 | private String author; 33 | private boolean play; 34 | private WifiManager.WifiLock wifiLock; 35 | private PowerManager.WakeLock wakeLock; 36 | private AudioManager audioManager; 37 | PowerManager powerManager; 38 | 39 | public NotificationPanel(Context parent, String title, String author, boolean play) { 40 | this.parent = parent; 41 | this.title = title; 42 | this.author = author; 43 | this.play = play; 44 | 45 | Intent dismissIntent = new Intent(parent, NotificationReturnSlot.class) 46 | .setAction("dismiss"); 47 | PendingIntent pendingDismissIntent = PendingIntent.getBroadcast(parent, 0, dismissIntent, PendingIntent.FLAG_CANCEL_CURRENT); 48 | 49 | nBuilder = new NotificationCompat.Builder(parent, "media_notification") 50 | .setOngoing(play) 51 | .setSmallIcon(R.drawable.ic_stat_music_note) 52 | .setVibrate(new long[]{0L}) 53 | .setSound(null) 54 | .setDeleteIntent(pendingDismissIntent); 55 | 56 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { 57 | nBuilder.setVisibility(NotificationCompat.VISIBILITY_PUBLIC); 58 | } 59 | 60 | if (Build.VERSION.SDK_INT > Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) { 61 | nBuilder.setPriority(Notification.STREAM_DEFAULT); 62 | } 63 | 64 | remoteView = new RemoteViews(parent.getPackageName(), R.layout.notificationlayout); 65 | 66 | remoteView.setTextViewText(R.id.title, title); 67 | remoteView.setTextViewText(R.id.author, author); 68 | 69 | if (this.play) { 70 | remoteView.setImageViewResource(R.id.toggle, R.drawable.baseline_pause_black_48); 71 | } else { 72 | remoteView.setImageViewResource(R.id.toggle, R.drawable.baseline_play_arrow_black_48); 73 | } 74 | 75 | setListeners(remoteView); 76 | nBuilder.setContent(remoteView); 77 | 78 | Notification notification = nBuilder.build(); 79 | 80 | nManager = (NotificationManager) parent.getSystemService(Context.NOTIFICATION_SERVICE); 81 | nManager.notify(NOTIFICATION_ID, notification); 82 | } 83 | 84 | private void requestWifiLock() { 85 | if (Build.VERSION.SDK_INT < 3) { 86 | Log.i(TAG, "Sæki ekki WifiLock, build version er: " + Integer.toString(Build.VERSION.SDK_INT)); 87 | return; 88 | } 89 | try { 90 | if (wifiLock == null) { 91 | WifiManager wifiManager = ((WifiManager)parent.getApplicationContext().getSystemService(Context.WIFI_SERVICE)); 92 | wifiLock = wifiManager.createWifiLock(WifiManager.WIFI_MODE_FULL_HIGH_PERF, "ruv.gardina:wifilock"); 93 | wifiLock.setReferenceCounted(false); 94 | } 95 | if (!wifiLock.isHeld()) { 96 | wifiLock.acquire(); 97 | } 98 | } catch (Exception e) { 99 | Log.e(TAG, "THROW - Fékk ekki WifiLock: " + e.getLocalizedMessage()); 100 | } 101 | } 102 | 103 | private void releaseWifiLock() { 104 | if (Build.VERSION.SDK_INT < 3) { 105 | return; 106 | } 107 | if (wifiLock == null) { 108 | return; 109 | } 110 | try { 111 | if (wifiLock.isHeld()) { 112 | wifiLock.release(); 113 | wifiLock = null; 114 | } 115 | } catch (Exception e) { 116 | Log.e(TAG, "THROW - Released ekki WifiLock: " + e.getLocalizedMessage()); 117 | } 118 | } 119 | 120 | private void requestWakeLock() { 121 | if (Build.VERSION.SDK_INT < 1) { 122 | Log.i(TAG, "Sæki ekki WakeLock, build version er: " + Integer.toString(Build.VERSION.SDK_INT)); 123 | return; 124 | } 125 | try { 126 | if (powerManager == null) { 127 | powerManager = (PowerManager)parent.getSystemService(Context.POWER_SERVICE); 128 | } 129 | if (wakeLock == null) { 130 | wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "ruv.WakeLock.player:wakeLock"); 131 | wakeLock.setReferenceCounted(false); 132 | } 133 | if (!wakeLock.isHeld()) { 134 | wakeLock.acquire(); 135 | } 136 | } catch (Exception e) { 137 | Log.e(TAG, "THROW - Fékk ekki WakeLock: " + e.getLocalizedMessage()); 138 | } 139 | } 140 | 141 | private void releaseWakeLock() { 142 | if (Build.VERSION.SDK_INT < 1) { 143 | return; 144 | } 145 | if (wakeLock == null) { 146 | return; 147 | } 148 | try { 149 | if (wakeLock.isHeld()) { 150 | wakeLock.release(); 151 | wakeLock = null; 152 | } 153 | } catch (Exception e) { 154 | Log.e(TAG, "THROW - Released ekki WakeLock: " + e.getLocalizedMessage()); 155 | } 156 | } 157 | 158 | private void requestAudioFocus() { 159 | if (Build.VERSION.SDK_INT < 8) { 160 | Log.i(TAG, "Sæki ekki audioFocus, build version er: " + Integer.toString(Build.VERSION.SDK_INT)); 161 | return; 162 | } 163 | try { 164 | if (audioManager == null) { 165 | audioManager = (AudioManager) parent.getApplicationContext().getSystemService(Context.AUDIO_SERVICE); 166 | } 167 | int result = audioManager.requestAudioFocus(null, AudioManager.STREAM_MUSIC, AudioManager.AUDIOFOCUS_GAIN); 168 | if (result == audioManager.AUDIOFOCUS_REQUEST_GRANTED) { 169 | Log.i(TAG, "Fékk audioFocus"); 170 | } else { 171 | Log.i(TAG, "Fékk ekki audioFocus"); 172 | } 173 | } catch (Exception e) { 174 | Log.e(TAG, "THROW - Fékk ekki audioFocus: " + e.getLocalizedMessage()); 175 | } 176 | } 177 | 178 | private void releaseAudioFocus() { 179 | if (Build.VERSION.SDK_INT < 8) { 180 | return; 181 | } 182 | if (audioManager == null) { 183 | return; 184 | } 185 | try { 186 | if (!audioManager.isMusicActive()) { 187 | audioManager.abandonAudioFocus(null); 188 | audioManager = null; 189 | } 190 | } catch (Exception e) { 191 | Log.e(TAG, "THROW - Released ekki AudioFocus: " + e.getLocalizedMessage()); 192 | } 193 | } 194 | 195 | public void setListeners(RemoteViews view){ 196 | Intent intent = new Intent(parent, NotificationReturnSlot.class) 197 | .setAction("toggle") 198 | .putExtra("title", this.title) 199 | .putExtra("author", this.author) 200 | .putExtra("action", !this.play ? "play" : "pause"); 201 | PendingIntent pendingIntent = PendingIntent.getBroadcast(parent, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); 202 | view.setOnClickPendingIntent(R.id.toggle, pendingIntent); 203 | 204 | Intent nextIntent = new Intent(parent, NotificationReturnSlot.class) 205 | .setAction("next"); 206 | PendingIntent pendingNextIntent = PendingIntent.getBroadcast(parent, 0, nextIntent, PendingIntent.FLAG_UPDATE_CURRENT); 207 | view.setOnClickPendingIntent(R.id.next, pendingNextIntent); 208 | 209 | Intent prevIntent = new Intent(parent, NotificationReturnSlot.class) 210 | .setAction("prev"); 211 | PendingIntent pendingPrevIntent = PendingIntent.getBroadcast(parent, 0, prevIntent, PendingIntent.FLAG_UPDATE_CURRENT); 212 | view.setOnClickPendingIntent(R.id.prev, pendingPrevIntent); 213 | 214 | Intent selectIntent = new Intent(parent, NotificationReturnSlot.class) 215 | .setAction("select"); 216 | PendingIntent selectPendingIntent = PendingIntent.getBroadcast(parent, 0, selectIntent, PendingIntent.FLAG_CANCEL_CURRENT); 217 | view.setOnClickPendingIntent(R.id.layout, selectPendingIntent); 218 | } 219 | 220 | public void notificationCancel() { 221 | nManager.cancel(NOTIFICATION_ID); 222 | } 223 | 224 | /* 225 | public void closeNotificationIfNotRunning() { 226 | Log.i(TAG, "Gísli's Heartbeat"); 227 | //return; 228 | 229 | boolean running = isAppRunning(parent); 230 | if (!running) { 231 | // Remove the notification 232 | releaseLocks(); 233 | notificationCancel(); 234 | } 235 | } 236 | */ 237 | 238 | public void stopSound() { 239 | requestAudioFocus(); 240 | } 241 | 242 | public void getWifiLock() { 243 | // Vinn med hljóð í bakgrunni 244 | requestWakeLock(); 245 | requestAudioFocus(); 246 | requestWifiLock(); 247 | 248 | /* 249 | // Setup listener 250 | if (t == null) { 251 | t = new Timer(); 252 | t.scheduleAtFixedRate(new TimerTask() { 253 | @Override 254 | public void run() { 255 | closeNotificationIfNotRunning(); 256 | } 257 | }, 1000, 1000); 258 | } 259 | */ 260 | } 261 | 262 | public void releaseLocks() { 263 | releaseWakeLock(); 264 | releaseAudioFocus(); 265 | releaseWifiLock(); 266 | /* 267 | if (t != null) { 268 | t.cancel(); 269 | t = null; 270 | } 271 | */ 272 | } 273 | 274 | @Override 275 | protected void onDestroy() { 276 | Log.i(TAG, "Media Gardina onDestroy"); 277 | nManager.cancel(NOTIFICATION_ID); 278 | releaseLocks(); 279 | //t.cancel(); 280 | super.onDestroy(); 281 | } 282 | 283 | void select() { 284 | if (audioManager != null) { 285 | if (audioManager.isMusicActive()) { 286 | return; 287 | } 288 | } 289 | releaseLocks(); 290 | notificationCancel(); 291 | } 292 | 293 | /* 294 | private boolean isAppRunning(Context context) { 295 | ActivityManager m = (ActivityManager) context.getSystemService( ACTIVITY_SERVICE ); 296 | List runningTaskInfoList = m.getRunningTasks(10); 297 | Iterator itr = runningTaskInfoList.iterator(); 298 | int n=0; 299 | while(itr.hasNext()){ 300 | n++; 301 | itr.next(); 302 | } 303 | if(n==1){ // App is killed 304 | return false; 305 | } 306 | return true; // App is in background or foreground 307 | } 308 | */ 309 | } 310 | -------------------------------------------------------------------------------- /android/src/main/java/com/example/medianotification/NotificationReturnSlot.java: -------------------------------------------------------------------------------- 1 | package com.example.medianotification; 2 | 3 | import android.content.BroadcastReceiver; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.content.pm.PackageManager; 7 | import android.util.Log; 8 | 9 | public class NotificationReturnSlot extends BroadcastReceiver { 10 | 11 | @Override 12 | public void onReceive(Context context, Intent intent) { 13 | switch (intent.getAction()) { 14 | case "dismiss": 15 | MediaNotificationPlugin.callEvent("dismiss"); 16 | break; 17 | 18 | case "close": 19 | MediaNotificationPlugin.callEvent("close"); 20 | break; 21 | 22 | 23 | case "prev": 24 | MediaNotificationPlugin.callEvent("prev"); 25 | break; 26 | 27 | case "next": 28 | MediaNotificationPlugin.callEvent("next"); 29 | break; 30 | 31 | case "toggle": 32 | String title = intent.getStringExtra("title"); 33 | String author = intent.getStringExtra("author"); 34 | String action = intent.getStringExtra("action"); 35 | 36 | MediaNotificationPlugin.show(title, author, action.equals("play")); 37 | MediaNotificationPlugin.callEvent(action); 38 | break; 39 | 40 | case "select": 41 | Intent closeDialog = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS); 42 | context.sendBroadcast(closeDialog); 43 | String packageName = context.getPackageName(); 44 | PackageManager pm = context.getPackageManager(); 45 | Intent launchIntent = pm.getLaunchIntentForPackage(packageName); 46 | context.startActivity(launchIntent); 47 | 48 | MediaNotificationPlugin.callEvent("select"); 49 | break; 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/baseline_pause_black_18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-hdpi/baseline_pause_black_18.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/baseline_pause_black_24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-hdpi/baseline_pause_black_24.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/baseline_pause_black_36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-hdpi/baseline_pause_black_36.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/baseline_pause_black_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-hdpi/baseline_pause_black_48.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/baseline_play_arrow_black_18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-hdpi/baseline_play_arrow_black_18.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/baseline_play_arrow_black_24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-hdpi/baseline_play_arrow_black_24.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/baseline_play_arrow_black_36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-hdpi/baseline_play_arrow_black_36.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/baseline_play_arrow_black_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-hdpi/baseline_play_arrow_black_48.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/baseline_skip_next_black_18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-hdpi/baseline_skip_next_black_18.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/baseline_skip_next_black_24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-hdpi/baseline_skip_next_black_24.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/baseline_skip_next_black_36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-hdpi/baseline_skip_next_black_36.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/baseline_skip_next_black_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-hdpi/baseline_skip_next_black_48.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/baseline_skip_previous_black_18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-hdpi/baseline_skip_previous_black_18.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/baseline_skip_previous_black_24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-hdpi/baseline_skip_previous_black_24.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/baseline_skip_previous_black_36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-hdpi/baseline_skip_previous_black_36.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/baseline_skip_previous_black_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-hdpi/baseline_skip_previous_black_48.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-hdpi/ic_stat_music_note.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-hdpi/ic_stat_music_note.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/baseline_pause_black_18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-mdpi/baseline_pause_black_18.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/baseline_pause_black_24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-mdpi/baseline_pause_black_24.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/baseline_pause_black_36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-mdpi/baseline_pause_black_36.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/baseline_pause_black_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-mdpi/baseline_pause_black_48.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/baseline_play_arrow_black_18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-mdpi/baseline_play_arrow_black_18.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/baseline_play_arrow_black_24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-mdpi/baseline_play_arrow_black_24.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/baseline_play_arrow_black_36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-mdpi/baseline_play_arrow_black_36.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/baseline_play_arrow_black_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-mdpi/baseline_play_arrow_black_48.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/baseline_skip_next_black_18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-mdpi/baseline_skip_next_black_18.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/baseline_skip_next_black_24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-mdpi/baseline_skip_next_black_24.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/baseline_skip_next_black_36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-mdpi/baseline_skip_next_black_36.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/baseline_skip_next_black_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-mdpi/baseline_skip_next_black_48.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/baseline_skip_previous_black_18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-mdpi/baseline_skip_previous_black_18.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/baseline_skip_previous_black_24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-mdpi/baseline_skip_previous_black_24.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/baseline_skip_previous_black_36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-mdpi/baseline_skip_previous_black_36.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/baseline_skip_previous_black_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-mdpi/baseline_skip_previous_black_48.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-mdpi/ic_stat_music_note.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-mdpi/ic_stat_music_note.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xhdpi/baseline_pause_black_18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-xhdpi/baseline_pause_black_18.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xhdpi/baseline_pause_black_24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-xhdpi/baseline_pause_black_24.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xhdpi/baseline_pause_black_36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-xhdpi/baseline_pause_black_36.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xhdpi/baseline_pause_black_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-xhdpi/baseline_pause_black_48.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xhdpi/baseline_play_arrow_black_18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-xhdpi/baseline_play_arrow_black_18.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xhdpi/baseline_play_arrow_black_24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-xhdpi/baseline_play_arrow_black_24.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xhdpi/baseline_play_arrow_black_36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-xhdpi/baseline_play_arrow_black_36.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xhdpi/baseline_play_arrow_black_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-xhdpi/baseline_play_arrow_black_48.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xhdpi/baseline_skip_next_black_18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-xhdpi/baseline_skip_next_black_18.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xhdpi/baseline_skip_next_black_24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-xhdpi/baseline_skip_next_black_24.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xhdpi/baseline_skip_next_black_36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-xhdpi/baseline_skip_next_black_36.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xhdpi/baseline_skip_next_black_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-xhdpi/baseline_skip_next_black_48.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xhdpi/baseline_skip_previous_black_18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-xhdpi/baseline_skip_previous_black_18.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xhdpi/baseline_skip_previous_black_24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-xhdpi/baseline_skip_previous_black_24.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xhdpi/baseline_skip_previous_black_36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-xhdpi/baseline_skip_previous_black_36.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xhdpi/baseline_skip_previous_black_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-xhdpi/baseline_skip_previous_black_48.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xhdpi/ic_stat_music_note.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-xhdpi/ic_stat_music_note.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxhdpi/baseline_pause_black_18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-xxhdpi/baseline_pause_black_18.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxhdpi/baseline_pause_black_24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-xxhdpi/baseline_pause_black_24.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxhdpi/baseline_pause_black_36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-xxhdpi/baseline_pause_black_36.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxhdpi/baseline_pause_black_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-xxhdpi/baseline_pause_black_48.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxhdpi/baseline_play_arrow_black_18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-xxhdpi/baseline_play_arrow_black_18.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxhdpi/baseline_play_arrow_black_24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-xxhdpi/baseline_play_arrow_black_24.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxhdpi/baseline_play_arrow_black_36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-xxhdpi/baseline_play_arrow_black_36.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxhdpi/baseline_play_arrow_black_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-xxhdpi/baseline_play_arrow_black_48.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxhdpi/baseline_skip_next_black_18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-xxhdpi/baseline_skip_next_black_18.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxhdpi/baseline_skip_next_black_24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-xxhdpi/baseline_skip_next_black_24.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxhdpi/baseline_skip_next_black_36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-xxhdpi/baseline_skip_next_black_36.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxhdpi/baseline_skip_next_black_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-xxhdpi/baseline_skip_next_black_48.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxhdpi/baseline_skip_previous_black_18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-xxhdpi/baseline_skip_previous_black_18.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxhdpi/baseline_skip_previous_black_24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-xxhdpi/baseline_skip_previous_black_24.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxhdpi/baseline_skip_previous_black_36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-xxhdpi/baseline_skip_previous_black_36.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxhdpi/baseline_skip_previous_black_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-xxhdpi/baseline_skip_previous_black_48.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxhdpi/ic_stat_music_note.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-xxhdpi/ic_stat_music_note.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxxhdpi/baseline_pause_black_18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-xxxhdpi/baseline_pause_black_18.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxxhdpi/baseline_pause_black_24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-xxxhdpi/baseline_pause_black_24.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxxhdpi/baseline_pause_black_36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-xxxhdpi/baseline_pause_black_36.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxxhdpi/baseline_pause_black_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-xxxhdpi/baseline_pause_black_48.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxxhdpi/baseline_play_arrow_black_18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-xxxhdpi/baseline_play_arrow_black_18.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxxhdpi/baseline_play_arrow_black_24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-xxxhdpi/baseline_play_arrow_black_24.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxxhdpi/baseline_play_arrow_black_36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-xxxhdpi/baseline_play_arrow_black_36.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxxhdpi/baseline_play_arrow_black_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-xxxhdpi/baseline_play_arrow_black_48.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxxhdpi/baseline_skip_next_black_18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-xxxhdpi/baseline_skip_next_black_18.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxxhdpi/baseline_skip_next_black_24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-xxxhdpi/baseline_skip_next_black_24.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxxhdpi/baseline_skip_next_black_36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-xxxhdpi/baseline_skip_next_black_36.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxxhdpi/baseline_skip_next_black_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-xxxhdpi/baseline_skip_next_black_48.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxxhdpi/baseline_skip_previous_black_18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-xxxhdpi/baseline_skip_previous_black_18.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxxhdpi/baseline_skip_previous_black_24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-xxxhdpi/baseline_skip_previous_black_24.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxxhdpi/baseline_skip_previous_black_36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-xxxhdpi/baseline_skip_previous_black_36.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxxhdpi/baseline_skip_previous_black_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-xxxhdpi/baseline_skip_previous_black_48.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxxhdpi/ic_stat_music_note.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/drawable-xxxhdpi/ic_stat_music_note.png -------------------------------------------------------------------------------- /android/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/src/main/res/layout/notificationlayout.xml: -------------------------------------------------------------------------------- 1 | 6 | 19 | 32 | 33 | 42 | 50 | 58 | -------------------------------------------------------------------------------- /android/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/android/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .dart_tool/ 3 | 4 | .packages 5 | .pub/ 6 | 7 | build/ 8 | 9 | .flutter-plugins 10 | -------------------------------------------------------------------------------- /example/.idea/libraries/Dart_SDK.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /example/.idea/libraries/Flutter_for_Android.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /example/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /example/.idea/runConfigurations/main_dart.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /example/.idea/workspace.xml: -------------------------------------------------------------------------------- 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 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /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: c7ea3ca377e909469c68f2ab878a5bc53d3cf66b 8 | channel: beta 9 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # media_notification_example 2 | 3 | Demonstrates how to use the media_notification plugin. 4 | 5 | ## Getting Started 6 | 7 | For help getting started with Flutter, view our online 8 | [documentation](https://flutter.io/). 9 | -------------------------------------------------------------------------------- /example/android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | *.class 3 | .gradle 4 | /local.properties 5 | /.idea/workspace.xml 6 | /.idea/libraries 7 | .DS_Store 8 | /build 9 | /captures 10 | GeneratedPluginRegistrant.java 11 | -------------------------------------------------------------------------------- /example/android/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 19 | -------------------------------------------------------------------------------- /example/android/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16 | 26 | 27 | 28 | 29 | 30 | 31 | 33 | -------------------------------------------------------------------------------- /example/android/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /example/android/.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /example/android/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | android 4 | Project android created by Buildship. 5 | 6 | 7 | 8 | 9 | org.eclipse.buildship.core.gradleprojectbuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.buildship.core.gradleprojectnature 16 | 17 | 18 | -------------------------------------------------------------------------------- /example/android/.settings/org.eclipse.buildship.core.prefs: -------------------------------------------------------------------------------- 1 | connection.project.dir= 2 | eclipse.preferences.version=1 3 | -------------------------------------------------------------------------------- /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 | apply plugin: 'com.android.application' 15 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 16 | 17 | android { 18 | compileSdkVersion 27 19 | 20 | lintOptions { 21 | disable 'InvalidPackage' 22 | } 23 | 24 | defaultConfig { 25 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 26 | applicationId "com.example.medianotification" 27 | minSdkVersion 16 28 | targetSdkVersion 27 29 | versionCode 1 30 | versionName "1.0" 31 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 32 | } 33 | 34 | buildTypes { 35 | release { 36 | // TODO: Add your own signing config for the release build. 37 | // Signing with the debug keys for now, so `flutter run --release` works. 38 | signingConfig signingConfigs.debug 39 | } 40 | } 41 | } 42 | 43 | flutter { 44 | source '../..' 45 | } 46 | 47 | dependencies { 48 | testImplementation 'junit:junit:4.12' 49 | androidTestImplementation 'com.android.support.test:runner:1.0.1' 50 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' 51 | } 52 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 8 | 9 | 10 | 15 | 19 | 26 | 30 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/example/medianotificationexample/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.medianotificationexample; 2 | 3 | import android.os.Bundle; 4 | import io.flutter.app.FlutterActivity; 5 | import io.flutter.plugins.GeneratedPluginRegistrant; 6 | 7 | public class MainActivity extends FlutterActivity { 8 | @Override 9 | protected void onCreate(Bundle savedInstanceState) { 10 | super.onCreate(savedInstanceState); 11 | GeneratedPluginRegistrant.registerWith(this); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /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/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/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/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/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/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/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/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/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/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/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/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.0.1' 9 | } 10 | } 11 | 12 | allprojects { 13 | repositories { 14 | google() 15 | jcenter() 16 | } 17 | } 18 | 19 | rootProject.buildDir = '../build' 20 | subprojects { 21 | project.buildDir = "${rootProject.buildDir}/${project.name}" 22 | } 23 | subprojects { 24 | project.evaluationDependsOn(':app') 25 | } 26 | 27 | task clean(type: Delete) { 28 | delete rootProject.buildDir 29 | } 30 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/example/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /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.1-all.zip 7 | -------------------------------------------------------------------------------- /example/android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /example/android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /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/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/app.flx 37 | /Flutter/app.zip 38 | /Flutter/flutter_assets/ 39 | /Flutter/App.framework 40 | /Flutter/Flutter.framework 41 | /Flutter/Generated.xcconfig 42 | /ServiceDefinitions.json 43 | 44 | Pods/ 45 | .symlinks/ 46 | -------------------------------------------------------------------------------- /example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 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 | # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock 37 | # referring to absolute paths on developers' machines. 38 | system('rm -rf .symlinks') 39 | system('mkdir -p .symlinks/plugins') 40 | 41 | # Flutter Pods 42 | generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig') 43 | if generated_xcode_build_settings.empty? 44 | puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter packages get is executed first." 45 | end 46 | generated_xcode_build_settings.map { |p| 47 | if p[:name] == 'FLUTTER_FRAMEWORK_DIR' 48 | symlink = File.join('.symlinks', 'flutter') 49 | File.symlink(File.dirname(p[:path]), symlink) 50 | pod 'Flutter', :path => File.join(symlink, File.basename(p[:path])) 51 | end 52 | } 53 | 54 | # Plugin Pods 55 | plugin_pods = parse_KV_file('../.flutter-plugins') 56 | plugin_pods.map { |p| 57 | symlink = File.join('.symlinks', 'plugins', p[:name]) 58 | File.symlink(p[:path], symlink) 59 | pod p[:name], :path => File.join(symlink, 'ios') 60 | } 61 | end 62 | 63 | post_install do |installer| 64 | installer.pods_project.targets.each do |target| 65 | target.build_configurations.each do |config| 66 | config.build_settings['ENABLE_BITCODE'] = 'NO' 67 | end 68 | end 69 | end 70 | -------------------------------------------------------------------------------- /example/ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Flutter (1.0.0) 3 | - media_notification (0.0.1): 4 | - Flutter 5 | 6 | DEPENDENCIES: 7 | - Flutter (from `.symlinks/flutter/ios`) 8 | - media_notification (from `.symlinks/plugins/media_notification/ios`) 9 | 10 | EXTERNAL SOURCES: 11 | Flutter: 12 | :path: ".symlinks/flutter/ios" 13 | media_notification: 14 | :path: ".symlinks/plugins/media_notification/ios" 15 | 16 | SPEC CHECKSUMS: 17 | Flutter: 58dd7d1b27887414a370fcccb9e645c08ffd7a6a 18 | media_notification: a5e7f8103c374bf5dc77ce5b96279ce38e9796fb 19 | 20 | PODFILE CHECKSUM: aff02bfeed411c636180d6812254b2daeea14d09 21 | 22 | COCOAPODS: 1.7.1 23 | -------------------------------------------------------------------------------- /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 | 2CC5EB55F90EF6963B8F7863 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D4D91AF420F0E7E2824D6EAA /* libPods-Runner.a */; }; 12 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 13 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; 14 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 15 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; 16 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 17 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; 18 | 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB31CF90195004384FC /* Generated.xcconfig */; }; 19 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; 20 | 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; 21 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 22 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 23 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 24 | /* End PBXBuildFile section */ 25 | 26 | /* Begin PBXCopyFilesBuildPhase section */ 27 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 28 | isa = PBXCopyFilesBuildPhase; 29 | buildActionMask = 2147483647; 30 | dstPath = ""; 31 | dstSubfolderSpec = 10; 32 | files = ( 33 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, 34 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, 35 | ); 36 | name = "Embed Frameworks"; 37 | runOnlyForDeploymentPostprocessing = 0; 38 | }; 39 | /* End PBXCopyFilesBuildPhase section */ 40 | 41 | /* Begin PBXFileReference section */ 42 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 43 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 44 | 2C218E51F0E66FDF1CC6459A /* 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 = ""; }; 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 | 4F78CCF345AE82EDB2D38B33 /* 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 = ""; }; 48 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 49 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 50 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; 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 | 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 56 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 57 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 58 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 59 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 60 | D4D91AF420F0E7E2824D6EAA /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; 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 | 2CC5EB55F90EF6963B8F7863 /* libPods-Runner.a in Frameworks */, 71 | ); 72 | runOnlyForDeploymentPostprocessing = 0; 73 | }; 74 | /* End PBXFrameworksBuildPhase section */ 75 | 76 | /* Begin PBXGroup section */ 77 | 7EB685BC3D3751143E70D405 /* Frameworks */ = { 78 | isa = PBXGroup; 79 | children = ( 80 | D4D91AF420F0E7E2824D6EAA /* libPods-Runner.a */, 81 | ); 82 | name = Frameworks; 83 | sourceTree = ""; 84 | }; 85 | 94DFF29348AAA009C88369C6 /* Pods */ = { 86 | isa = PBXGroup; 87 | children = ( 88 | 2C218E51F0E66FDF1CC6459A /* Pods-Runner.debug.xcconfig */, 89 | 4F78CCF345AE82EDB2D38B33 /* Pods-Runner.release.xcconfig */, 90 | ); 91 | name = Pods; 92 | path = Pods; 93 | sourceTree = ""; 94 | }; 95 | 9740EEB11CF90186004384FC /* Flutter */ = { 96 | isa = PBXGroup; 97 | children = ( 98 | 3B80C3931E831B6300D905FE /* App.framework */, 99 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 100 | 9740EEBA1CF902C7004384FC /* Flutter.framework */, 101 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 102 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 103 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 104 | ); 105 | name = Flutter; 106 | sourceTree = ""; 107 | }; 108 | 97C146E51CF9000F007C117D = { 109 | isa = PBXGroup; 110 | children = ( 111 | 9740EEB11CF90186004384FC /* Flutter */, 112 | 97C146F01CF9000F007C117D /* Runner */, 113 | 97C146EF1CF9000F007C117D /* Products */, 114 | 94DFF29348AAA009C88369C6 /* Pods */, 115 | 7EB685BC3D3751143E70D405 /* Frameworks */, 116 | ); 117 | sourceTree = ""; 118 | }; 119 | 97C146EF1CF9000F007C117D /* Products */ = { 120 | isa = PBXGroup; 121 | children = ( 122 | 97C146EE1CF9000F007C117D /* Runner.app */, 123 | ); 124 | name = Products; 125 | sourceTree = ""; 126 | }; 127 | 97C146F01CF9000F007C117D /* Runner */ = { 128 | isa = PBXGroup; 129 | children = ( 130 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, 131 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, 132 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 133 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 134 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 135 | 97C147021CF9000F007C117D /* Info.plist */, 136 | 97C146F11CF9000F007C117D /* Supporting Files */, 137 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 138 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 139 | ); 140 | path = Runner; 141 | sourceTree = ""; 142 | }; 143 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 144 | isa = PBXGroup; 145 | children = ( 146 | 97C146F21CF9000F007C117D /* main.m */, 147 | ); 148 | name = "Supporting Files"; 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 | A4CC612C168E1A94B153E9F7 /* [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 | 5D5DAA9F0BF747DFD046FB58 /* [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 = 0910; 183 | ORGANIZATIONNAME = "The Chromium Authors"; 184 | TargetAttributes = { 185 | 97C146ED1CF9000F007C117D = { 186 | CreatedOnToolsVersion = 7.3.1; 187 | DevelopmentTeam = KA2H4XFK9J; 188 | }; 189 | }; 190 | }; 191 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 192 | compatibilityVersion = "Xcode 3.2"; 193 | developmentRegion = English; 194 | hasScannedForEncodings = 0; 195 | knownRegions = ( 196 | English, 197 | en, 198 | Base, 199 | ); 200 | mainGroup = 97C146E51CF9000F007C117D; 201 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 202 | projectDirPath = ""; 203 | projectRoot = ""; 204 | targets = ( 205 | 97C146ED1CF9000F007C117D /* Runner */, 206 | ); 207 | }; 208 | /* End PBXProject section */ 209 | 210 | /* Begin PBXResourcesBuildPhase section */ 211 | 97C146EC1CF9000F007C117D /* Resources */ = { 212 | isa = PBXResourcesBuildPhase; 213 | buildActionMask = 2147483647; 214 | files = ( 215 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 216 | 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */, 217 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 218 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, 219 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 220 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 221 | ); 222 | runOnlyForDeploymentPostprocessing = 0; 223 | }; 224 | /* End PBXResourcesBuildPhase section */ 225 | 226 | /* Begin PBXShellScriptBuildPhase section */ 227 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 228 | isa = PBXShellScriptBuildPhase; 229 | buildActionMask = 2147483647; 230 | files = ( 231 | ); 232 | inputPaths = ( 233 | ); 234 | name = "Thin Binary"; 235 | outputPaths = ( 236 | ); 237 | runOnlyForDeploymentPostprocessing = 0; 238 | shellPath = /bin/sh; 239 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; 240 | }; 241 | 5D5DAA9F0BF747DFD046FB58 /* [CP] Embed Pods Frameworks */ = { 242 | isa = PBXShellScriptBuildPhase; 243 | buildActionMask = 2147483647; 244 | files = ( 245 | ); 246 | inputPaths = ( 247 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", 248 | "${PODS_ROOT}/../.symlinks/flutter/ios/Flutter.framework", 249 | ); 250 | name = "[CP] Embed Pods Frameworks"; 251 | outputPaths = ( 252 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework", 253 | ); 254 | runOnlyForDeploymentPostprocessing = 0; 255 | shellPath = /bin/sh; 256 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; 257 | showEnvVarsInLog = 0; 258 | }; 259 | 9740EEB61CF901F6004384FC /* Run Script */ = { 260 | isa = PBXShellScriptBuildPhase; 261 | buildActionMask = 2147483647; 262 | files = ( 263 | ); 264 | inputPaths = ( 265 | ); 266 | name = "Run Script"; 267 | outputPaths = ( 268 | ); 269 | runOnlyForDeploymentPostprocessing = 0; 270 | shellPath = /bin/sh; 271 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 272 | }; 273 | A4CC612C168E1A94B153E9F7 /* [CP] Check Pods Manifest.lock */ = { 274 | isa = PBXShellScriptBuildPhase; 275 | buildActionMask = 2147483647; 276 | files = ( 277 | ); 278 | inputFileListPaths = ( 279 | ); 280 | inputPaths = ( 281 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 282 | "${PODS_ROOT}/Manifest.lock", 283 | ); 284 | name = "[CP] Check Pods Manifest.lock"; 285 | outputFileListPaths = ( 286 | ); 287 | outputPaths = ( 288 | "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", 289 | ); 290 | runOnlyForDeploymentPostprocessing = 0; 291 | shellPath = /bin/sh; 292 | 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"; 293 | showEnvVarsInLog = 0; 294 | }; 295 | /* End PBXShellScriptBuildPhase section */ 296 | 297 | /* Begin PBXSourcesBuildPhase section */ 298 | 97C146EA1CF9000F007C117D /* Sources */ = { 299 | isa = PBXSourcesBuildPhase; 300 | buildActionMask = 2147483647; 301 | files = ( 302 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, 303 | 97C146F31CF9000F007C117D /* main.m in Sources */, 304 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 305 | ); 306 | runOnlyForDeploymentPostprocessing = 0; 307 | }; 308 | /* End PBXSourcesBuildPhase section */ 309 | 310 | /* Begin PBXVariantGroup section */ 311 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 312 | isa = PBXVariantGroup; 313 | children = ( 314 | 97C146FB1CF9000F007C117D /* Base */, 315 | ); 316 | name = Main.storyboard; 317 | sourceTree = ""; 318 | }; 319 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 320 | isa = PBXVariantGroup; 321 | children = ( 322 | 97C147001CF9000F007C117D /* Base */, 323 | ); 324 | name = LaunchScreen.storyboard; 325 | sourceTree = ""; 326 | }; 327 | /* End PBXVariantGroup section */ 328 | 329 | /* Begin XCBuildConfiguration section */ 330 | 97C147031CF9000F007C117D /* Debug */ = { 331 | isa = XCBuildConfiguration; 332 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 333 | buildSettings = { 334 | ALWAYS_SEARCH_USER_PATHS = NO; 335 | CLANG_ANALYZER_NONNULL = YES; 336 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 337 | CLANG_CXX_LIBRARY = "libc++"; 338 | CLANG_ENABLE_MODULES = YES; 339 | CLANG_ENABLE_OBJC_ARC = YES; 340 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 341 | CLANG_WARN_BOOL_CONVERSION = YES; 342 | CLANG_WARN_COMMA = YES; 343 | CLANG_WARN_CONSTANT_CONVERSION = YES; 344 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 345 | CLANG_WARN_EMPTY_BODY = YES; 346 | CLANG_WARN_ENUM_CONVERSION = YES; 347 | CLANG_WARN_INFINITE_RECURSION = YES; 348 | CLANG_WARN_INT_CONVERSION = YES; 349 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 350 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 351 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 352 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 353 | CLANG_WARN_STRICT_PROTOTYPES = YES; 354 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 355 | CLANG_WARN_UNREACHABLE_CODE = YES; 356 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 357 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 358 | COPY_PHASE_STRIP = NO; 359 | DEBUG_INFORMATION_FORMAT = dwarf; 360 | ENABLE_STRICT_OBJC_MSGSEND = YES; 361 | ENABLE_TESTABILITY = YES; 362 | GCC_C_LANGUAGE_STANDARD = gnu99; 363 | GCC_DYNAMIC_NO_PIC = NO; 364 | GCC_NO_COMMON_BLOCKS = YES; 365 | GCC_OPTIMIZATION_LEVEL = 0; 366 | GCC_PREPROCESSOR_DEFINITIONS = ( 367 | "DEBUG=1", 368 | "$(inherited)", 369 | ); 370 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 371 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 372 | GCC_WARN_UNDECLARED_SELECTOR = YES; 373 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 374 | GCC_WARN_UNUSED_FUNCTION = YES; 375 | GCC_WARN_UNUSED_VARIABLE = YES; 376 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 377 | MTL_ENABLE_DEBUG_INFO = YES; 378 | ONLY_ACTIVE_ARCH = YES; 379 | SDKROOT = iphoneos; 380 | TARGETED_DEVICE_FAMILY = "1,2"; 381 | }; 382 | name = Debug; 383 | }; 384 | 97C147041CF9000F007C117D /* Release */ = { 385 | isa = XCBuildConfiguration; 386 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 387 | buildSettings = { 388 | ALWAYS_SEARCH_USER_PATHS = NO; 389 | CLANG_ANALYZER_NONNULL = YES; 390 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 391 | CLANG_CXX_LIBRARY = "libc++"; 392 | CLANG_ENABLE_MODULES = YES; 393 | CLANG_ENABLE_OBJC_ARC = YES; 394 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 395 | CLANG_WARN_BOOL_CONVERSION = YES; 396 | CLANG_WARN_COMMA = YES; 397 | CLANG_WARN_CONSTANT_CONVERSION = YES; 398 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 399 | CLANG_WARN_EMPTY_BODY = YES; 400 | CLANG_WARN_ENUM_CONVERSION = YES; 401 | CLANG_WARN_INFINITE_RECURSION = YES; 402 | CLANG_WARN_INT_CONVERSION = YES; 403 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 404 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 405 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 406 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 407 | CLANG_WARN_STRICT_PROTOTYPES = YES; 408 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 409 | CLANG_WARN_UNREACHABLE_CODE = YES; 410 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 411 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 412 | COPY_PHASE_STRIP = NO; 413 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 414 | ENABLE_NS_ASSERTIONS = NO; 415 | ENABLE_STRICT_OBJC_MSGSEND = YES; 416 | GCC_C_LANGUAGE_STANDARD = gnu99; 417 | GCC_NO_COMMON_BLOCKS = YES; 418 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 419 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 420 | GCC_WARN_UNDECLARED_SELECTOR = YES; 421 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 422 | GCC_WARN_UNUSED_FUNCTION = YES; 423 | GCC_WARN_UNUSED_VARIABLE = YES; 424 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 425 | MTL_ENABLE_DEBUG_INFO = NO; 426 | SDKROOT = iphoneos; 427 | TARGETED_DEVICE_FAMILY = "1,2"; 428 | VALIDATE_PRODUCT = YES; 429 | }; 430 | name = Release; 431 | }; 432 | 97C147061CF9000F007C117D /* Debug */ = { 433 | isa = XCBuildConfiguration; 434 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 435 | buildSettings = { 436 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 437 | CURRENT_PROJECT_VERSION = 1; 438 | DEVELOPMENT_TEAM = KA2H4XFK9J; 439 | ENABLE_BITCODE = NO; 440 | FRAMEWORK_SEARCH_PATHS = ( 441 | "$(inherited)", 442 | "$(PROJECT_DIR)/Flutter", 443 | ); 444 | INFOPLIST_FILE = Runner/Info.plist; 445 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 446 | LIBRARY_SEARCH_PATHS = ( 447 | "$(inherited)", 448 | "$(PROJECT_DIR)/Flutter", 449 | ); 450 | PRODUCT_BUNDLE_IDENTIFIER = com.example.mediaNotificationExample; 451 | PRODUCT_NAME = "$(TARGET_NAME)"; 452 | VERSIONING_SYSTEM = "apple-generic"; 453 | }; 454 | name = Debug; 455 | }; 456 | 97C147071CF9000F007C117D /* Release */ = { 457 | isa = XCBuildConfiguration; 458 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 459 | buildSettings = { 460 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 461 | CURRENT_PROJECT_VERSION = 1; 462 | DEVELOPMENT_TEAM = KA2H4XFK9J; 463 | ENABLE_BITCODE = NO; 464 | FRAMEWORK_SEARCH_PATHS = ( 465 | "$(inherited)", 466 | "$(PROJECT_DIR)/Flutter", 467 | ); 468 | INFOPLIST_FILE = Runner/Info.plist; 469 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 470 | LIBRARY_SEARCH_PATHS = ( 471 | "$(inherited)", 472 | "$(PROJECT_DIR)/Flutter", 473 | ); 474 | PRODUCT_BUNDLE_IDENTIFIER = com.example.mediaNotificationExample; 475 | PRODUCT_NAME = "$(TARGET_NAME)"; 476 | VERSIONING_SYSTEM = "apple-generic"; 477 | }; 478 | name = Release; 479 | }; 480 | /* End XCBuildConfiguration section */ 481 | 482 | /* Begin XCConfigurationList section */ 483 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 484 | isa = XCConfigurationList; 485 | buildConfigurations = ( 486 | 97C147031CF9000F007C117D /* Debug */, 487 | 97C147041CF9000F007C117D /* Release */, 488 | ); 489 | defaultConfigurationIsVisible = 0; 490 | defaultConfigurationName = Release; 491 | }; 492 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 493 | isa = XCConfigurationList; 494 | buildConfigurations = ( 495 | 97C147061CF9000F007C117D /* Debug */, 496 | 97C147071CF9000F007C117D /* Release */, 497 | ); 498 | defaultConfigurationIsVisible = 0; 499 | defaultConfigurationName = Release; 500 | }; 501 | /* End XCConfigurationList section */ 502 | }; 503 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 504 | } 505 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 33 | 34 | 40 | 41 | 42 | 43 | 44 | 45 | 56 | 58 | 64 | 65 | 66 | 67 | 68 | 69 | 75 | 77 | 83 | 84 | 85 | 86 | 88 | 89 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /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.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildSystemType 6 | Original 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : FlutterAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #include "AppDelegate.h" 2 | #include "GeneratedPluginRegistrant.h" 3 | #import 4 | #import 5 | 6 | @implementation AppDelegate 7 | 8 | - (BOOL)application:(UIApplication *)application 9 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 10 | [GeneratedPluginRegistrant registerWithRegistry:self]; 11 | // Override point for customization after application launch. 12 | NSError *error = nil; 13 | if (![[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:&error]) { 14 | NSLog(@"%@", error); 15 | } 16 | [[UIApplication sharedApplication] beginReceivingRemoteControlEvents]; 17 | return [super application:application didFinishLaunchingWithOptions:launchOptions]; 18 | 19 | } 20 | 21 | 22 | //- (void)remoteControlReceivedWithEvent:(UIEvent *)receivedEvent { 23 | // if (receivedEvent.type == UIEventTypeRemoteControl) { 24 | // switch (receivedEvent.subtype) { 25 | // case UIEventSubtypeRemoteControlPlay: 26 | // [[NSNotificationCenter defaultCenter] postNotificationName:kCYCAppDelegatePlayPauseNotificationName object:nil]; 27 | // break; 28 | // case UIEventSubtypeRemoteControlPause: 29 | // [[NSNotificationCenter defaultCenter] postNotificationName:kCYCAppDelegatePlayPauseNotificationName object:nil]; 30 | // break; 31 | // case UIEventSubtypeRemoteControlTogglePlayPause: 32 | // [[NSNotificationCenter defaultCenter] postNotificationName:kCYCAppDelegatePlayPauseNotificationName object:nil]; 33 | // break; 34 | // default: 35 | // break; 36 | // } 37 | // } 38 | //} 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /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/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/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/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/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/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/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/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/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/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/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/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/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/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/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/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/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/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/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/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/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/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/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/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/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/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/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/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/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/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/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/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/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 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | media_notification_example 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 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/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char* argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'dart:async'; 3 | 4 | import 'package:flutter/services.dart'; 5 | import 'package:media_notification/media_notification.dart'; 6 | 7 | void main() => runApp(new MyApp()); 8 | 9 | class MyApp extends StatefulWidget { 10 | @override 11 | _MyAppState createState() => new _MyAppState(); 12 | } 13 | 14 | class _MyAppState extends State { 15 | String status = 'hidden'; 16 | 17 | @override 18 | void initState() { 19 | super.initState(); 20 | 21 | MediaNotification.setListener('pause', () { 22 | setState(() => status = 'pause'); 23 | }); 24 | 25 | MediaNotification.setListener('play', () { 26 | setState(() => status = 'play'); 27 | }); 28 | 29 | MediaNotification.setListener('next', () { 30 | 31 | }); 32 | 33 | MediaNotification.setListener('prev', () { 34 | 35 | }); 36 | 37 | MediaNotification.setListener('select', () { 38 | 39 | }); 40 | } 41 | 42 | Future stopSound() async { 43 | try { 44 | await MediaNotification.stopSound(); 45 | } on PlatformException { 46 | print("Exception stopSound"); 47 | } 48 | } 49 | 50 | Future lock() async { 51 | try { 52 | await MediaNotification.getWifiLock(); 53 | } on PlatformException { 54 | print("Exception getWifiLock"); 55 | } 56 | } 57 | 58 | Future release() async { 59 | try { 60 | await MediaNotification.releaseWifiLock(); 61 | } on PlatformException { 62 | print("Exception releaseWifiLock"); 63 | } 64 | } 65 | 66 | Future hide() async { 67 | try { 68 | await MediaNotification.hide(); 69 | setState(() => status = 'hidden'); 70 | } on PlatformException { 71 | print("Exception hide"); 72 | } 73 | } 74 | 75 | Future show(title, author) async { 76 | try { 77 | await MediaNotification.show(title: title, author: author); 78 | setState(() => status = 'play'); 79 | } on PlatformException { 80 | print("Exception show"); 81 | } 82 | } 83 | 84 | @override 85 | Widget build(BuildContext context) { 86 | return new MaterialApp( 87 | home: new Scaffold( 88 | appBar: new AppBar( 89 | title: const Text('Plugin example app'), 90 | ), 91 | body: new Center( 92 | child: Container( 93 | height: 350.0, 94 | child: Column( 95 | mainAxisAlignment: MainAxisAlignment.spaceEvenly, 96 | children: [ 97 | FlatButton( 98 | child: Text('Show notification'), 99 | onPressed: () => show('Title', 'Song author'), 100 | ), 101 | FlatButton( 102 | child: Text('Update notification'), 103 | onPressed: () => show('New title', 'New song author'), 104 | ), 105 | FlatButton( 106 | child: Text('Hide notification'), 107 | onPressed: hide, 108 | ), 109 | FlatButton( 110 | child: Text('Kill Other Sound'), 111 | onPressed: stopSound, 112 | ), 113 | FlatButton( 114 | child: Text('WiFi Lock'), 115 | onPressed: lock, 116 | ), 117 | FlatButton( 118 | child: Text('WiFi Release'), 119 | onPressed: release, 120 | ), 121 | Text('Status: ' + status) 122 | ], 123 | ), 124 | ) 125 | ), 126 | ), 127 | ); 128 | } 129 | } 130 | -------------------------------------------------------------------------------- /example/media_notification_example.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /example/media_notification_example_android.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: media_notification_example 2 | description: Demonstrates how to use the media_notification plugin. 3 | 4 | dependencies: 5 | flutter: 6 | sdk: flutter 7 | 8 | # The following adds the Cupertino Icons font to your application. 9 | # Use with the CupertinoIcons class for iOS style icons. 10 | cupertino_icons: ^0.1.2 11 | 12 | dev_dependencies: 13 | flutter_test: 14 | sdk: flutter 15 | 16 | media_notification: 17 | path: ../ 18 | 19 | # For information on the generic Dart part of this file, see the 20 | # following page: https://www.dartlang.org/tools/pub/pubspec 21 | 22 | # The following section is specific to Flutter. 23 | flutter: 24 | 25 | # The following line ensures that the Material Icons font is 26 | # included with your application, so that you can use the icons in 27 | # the material Icons class. 28 | uses-material-design: true 29 | 30 | # To add assets to your application, add an assets section, like this: 31 | # assets: 32 | # - images/a_dot_burr.jpeg 33 | # - images/a_dot_ham.jpeg 34 | 35 | # An image asset can refer to one or more resolution-specific "variants", see 36 | # https://flutter.io/assets-and-images/#resolution-aware. 37 | 38 | # For details regarding adding assets from package dependencies, see 39 | # https://flutter.io/assets-and-images/#from-packages 40 | 41 | # To add custom fonts to your application, add a fonts section here, 42 | # in this "flutter" section. Each entry in this list should have a 43 | # "family" key with the font family name, and a "fonts" key with a 44 | # list giving the asset and other descriptors for the font. For 45 | # example: 46 | # fonts: 47 | # - family: Schyler 48 | # fonts: 49 | # - asset: fonts/Schyler-Regular.ttf 50 | # - asset: fonts/Schyler-Italic.ttf 51 | # style: italic 52 | # - family: Trajan Pro 53 | # fonts: 54 | # - asset: fonts/TrajanPro.ttf 55 | # - asset: fonts/TrajanPro_Bold.ttf 56 | # weight: 700 57 | # 58 | # For details regarding fonts from package dependencies, 59 | # see https://flutter.io/custom-fonts/#from-packages 60 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ios/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iampawan/flutter_media_notification/f4e837d313db38ecf7bd264e2f64063239e6a9d4/ios/Assets/.gitkeep -------------------------------------------------------------------------------- /ios/Classes/MediaNotificationPlugin.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface MediaNotificationPlugin : NSObject 4 | @end 5 | -------------------------------------------------------------------------------- /ios/Classes/MediaNotificationPlugin.m: -------------------------------------------------------------------------------- 1 | #import "MediaNotificationPlugin.h" 2 | #import 3 | #import 4 | #import 5 | 6 | @implementation MediaNotificationPlugin 7 | + (void)registerWithRegistrar:(NSObject*)registrar { 8 | FlutterMethodChannel* channel = [FlutterMethodChannel 9 | methodChannelWithName:@"media_notification" 10 | binaryMessenger:[registrar messenger]]; 11 | MediaNotificationPlugin* instance = [[MediaNotificationPlugin alloc] init]; 12 | [registrar addMethodCallDelegate:instance channel:channel]; 13 | } 14 | 15 | - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result { 16 | if ([@"show" isEqualToString:call.method]) { 17 | NSString* title = call.arguments[@"title"]; 18 | NSString* author = call.arguments[@"author"]; 19 | BOOL play = call.arguments[@"play"]; 20 | 21 | NSMutableDictionary *albumInfo = [[NSMutableDictionary alloc] init]; 22 | // UIImage *artWork = [UIImage imageNamed:album.imageUrl]; 23 | [albumInfo setObject:title forKey:MPMediaItemPropertyTitle]; 24 | [albumInfo setObject:author forKey:MPMediaItemPropertyArtist]; 25 | // [albumInfo setObject:album.title forKey:MPMediaItemPropertyAlbumTitle]; 26 | // [albumInfo setObject:artworkP forKey:MPMediaItemPropertyArtwork]; 27 | // [albumInfo setObject:album.playrDur forKey:MPMediaItemPropertyPlaybackDuration] 28 | // [albumInfo setObject:album.elapsedTime forKey:MPNowPlayingInfoPropertyElapsedPlaybackTime] 29 | [[MPNowPlayingInfoCenter defaultCenter] setNowPlayingInfo:albumInfo]; 30 | 31 | if (play == YES) { 32 | [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil]; 33 | [[AVAudioSession sharedInstance]setActive:YES error:nil]; 34 | } 35 | 36 | //setup and receive remote control events: 37 | 38 | result(@"success"); 39 | } 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /ios/media_notification.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 = 'media_notification' 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 = '8.0' 20 | end 21 | 22 | -------------------------------------------------------------------------------- /lib/media_notification.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:flutter/services.dart'; 4 | import 'package:meta/meta.dart'; 5 | 6 | class MediaNotification { 7 | static const MethodChannel _channel = const MethodChannel('media_notification'); 8 | static Map _listeners = new Map(); 9 | 10 | static Future _myUtilsHandler(MethodCall methodCall) async { 11 | _listeners.forEach((event, callback) { 12 | if (methodCall.method == event) { 13 | callback(); 14 | return true; 15 | } 16 | }); 17 | } 18 | 19 | static Future show({@required title, @required author, play = true}) async { 20 | final Map params = { 21 | 'title': title, 22 | 'author': author, 23 | 'play': play 24 | }; 25 | await _channel.invokeMethod('show', params); 26 | 27 | _channel.setMethodCallHandler(_myUtilsHandler); 28 | } 29 | 30 | static Future hide() async { 31 | await _channel.invokeMethod('hide'); 32 | } 33 | 34 | static setListener(String event, Function callback) { 35 | _listeners.addAll({event: callback}); 36 | } 37 | 38 | static stopSound() async { 39 | await _channel.invokeMethod('stopSound'); 40 | } 41 | 42 | static getWifiLock() async { 43 | await _channel.invokeMethod('getWifiLock'); 44 | } 45 | 46 | static releaseWifiLock() async { 47 | await _channel.invokeMethod('releaseWifiLock'); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /media_notification.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /media_notification_android.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: media_notification 2 | description: Flutter media notification 3 | version: 0.0.5 4 | author: Dmitry 5 | homepage: https://github.com/Zeratyll/flutter_media_notification 6 | 7 | dependencies: 8 | flutter: 9 | sdk: flutter 10 | meta: ^1.0.4 11 | # For information on the generic Dart part of this file, see the 12 | # following page: https://www.dartlang.org/tools/pub/pubspec 13 | 14 | dev_dependencies: 15 | flutter_test: 16 | sdk: flutter 17 | mockito: ^3.0.2 18 | 19 | # The following section is specific to Flutter. 20 | flutter: 21 | plugin: 22 | androidPackage: com.example.medianotification 23 | pluginClass: MediaNotificationPlugin 24 | 25 | environment: 26 | sdk: ">=2.0.0-dev.28.0 <3.0.0" 27 | flutter: ">=0.1.4 <2.0.0" --------------------------------------------------------------------------------