├── .gitignore ├── CapacitorDarkMode.podspec ├── README.md ├── android ├── build.gradle ├── build │ ├── generated │ │ └── source │ │ │ └── buildConfig │ │ │ └── debug │ │ │ └── com │ │ │ └── bkon │ │ │ └── capacitor │ │ │ └── DarkMode │ │ │ └── capacitordarkmode │ │ │ └── BuildConfig.java │ ├── intermediates │ │ ├── aapt_friendly_merged_manifests │ │ │ └── debug │ │ │ │ └── aapt │ │ │ │ ├── AndroidManifest.xml │ │ │ │ └── output.json │ │ ├── annotation_processor_list │ │ │ └── debug │ │ │ │ └── annotationProcessors.json │ │ ├── compile_library_classes │ │ │ └── debug │ │ │ │ └── classes.jar │ │ ├── compile_library_classes_jar │ │ │ └── debug │ │ │ │ └── classes.jar │ │ ├── compile_only_not_namespaced_r_class_jar │ │ │ └── debug │ │ │ │ └── R.jar │ │ ├── compile_symbol_list │ │ │ └── debug │ │ │ │ └── R.txt │ │ ├── compiled_local_resources │ │ │ └── debug │ │ │ │ └── out │ │ │ │ └── layout_bridge_layout_main.xml.flat │ │ ├── incremental │ │ │ ├── debug-mergeNativeLibs │ │ │ │ └── merge-state │ │ │ ├── mergeDebugJniLibFolders │ │ │ │ └── merger.xml │ │ │ ├── mergeDebugShaders │ │ │ │ └── merger.xml │ │ │ ├── packageDebugAssets │ │ │ │ └── merger.xml │ │ │ └── packageDebugResources │ │ │ │ ├── compile-file-map.properties │ │ │ │ ├── merged.dir │ │ │ │ └── values │ │ │ │ │ └── values.xml │ │ │ │ └── merger.xml │ │ ├── javac │ │ │ └── debug │ │ │ │ └── classes │ │ │ │ └── com │ │ │ │ └── bkon │ │ │ │ └── capacitor │ │ │ │ └── DarkMode │ │ │ │ ├── DarkMode.class │ │ │ │ └── capacitordarkmode │ │ │ │ └── BuildConfig.class │ │ ├── library_java_res │ │ │ └── debug │ │ │ │ └── res.jar │ │ ├── library_manifest │ │ │ └── debug │ │ │ │ └── AndroidManifest.xml │ │ ├── local_only_symbol_list │ │ │ └── debug │ │ │ │ └── R-def.txt │ │ ├── manifest_merge_blame_file │ │ │ └── debug │ │ │ │ └── manifest-merger-blame-debug-report.txt │ │ ├── merged_manifests │ │ │ └── debug │ │ │ │ └── output.json │ │ ├── navigation_json │ │ │ └── debug │ │ │ │ └── navigation.json │ │ ├── packaged_res │ │ │ └── debug │ │ │ │ ├── layout │ │ │ │ └── bridge_layout_main.xml │ │ │ │ └── values │ │ │ │ └── values.xml │ │ ├── runtime_library_classes │ │ │ └── debug │ │ │ │ └── classes.jar │ │ ├── runtime_library_classes_jar │ │ │ └── debug │ │ │ │ └── classes.jar │ │ └── symbol_list_with_package_name │ │ │ └── debug │ │ │ └── package-aware-r.txt │ └── outputs │ │ └── logs │ │ └── manifest-merger-debug-report.txt ├── capacitor-dark-mode.iml ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── local.properties ├── proguard-rules.pro ├── settings.gradle └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── getcapacitor │ │ └── android │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── bkon │ │ │ └── capacitor │ │ │ └── DarkMode │ │ │ └── DarkMode.java │ └── res │ │ ├── layout │ │ └── bridge_layout_main.xml │ │ └── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── com │ └── getcapacitor │ └── ExampleUnitTest.java ├── dist ├── esm │ ├── definitions.d.ts │ ├── definitions.js │ ├── definitions.js.map │ ├── index.d.ts │ ├── index.js │ ├── index.js.map │ ├── web.d.ts │ ├── web.js │ └── web.js.map ├── plugin.js └── plugin.js.map ├── ios ├── Plugin.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcuserdata │ │ │ └── hinddeep.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ └── hinddeep.xcuserdatad │ │ └── xcschemes │ │ └── xcschememanagement.plist ├── Plugin.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── xcuserdata │ │ └── hinddeep.xcuserdatad │ │ └── UserInterfaceState.xcuserstate ├── Plugin │ ├── Info.plist │ ├── Plugin.h │ ├── Plugin.m │ └── Plugin.swift ├── PluginTests │ ├── Info.plist │ └── PluginTests.swift ├── Podfile ├── Podfile.lock └── Pods │ ├── Local Podspecs │ ├── Capacitor.podspec.json │ └── CapacitorCordova.podspec.json │ ├── Manifest.lock │ ├── Pods.xcodeproj │ ├── project.pbxproj │ └── xcuserdata │ │ └── hinddeep.xcuserdatad │ │ └── xcschemes │ │ ├── Capacitor.xcscheme │ │ ├── CapacitorCordova.xcscheme │ │ ├── Pods-Plugin.xcscheme │ │ ├── Pods-PluginTests.xcscheme │ │ └── xcschememanagement.plist │ └── Target Support Files │ ├── Capacitor │ ├── Capacitor-Info.plist │ ├── Capacitor-dummy.m │ ├── Capacitor-prefix.pch │ ├── Capacitor-umbrella.h │ ├── Capacitor.debug.xcconfig │ ├── Capacitor.modulemap │ └── Capacitor.release.xcconfig │ ├── CapacitorCordova │ ├── CapacitorCordova-Info.plist │ ├── CapacitorCordova-dummy.m │ ├── CapacitorCordova-prefix.pch │ ├── CapacitorCordova-umbrella.h │ ├── CapacitorCordova.debug.xcconfig │ ├── CapacitorCordova.modulemap │ └── CapacitorCordova.release.xcconfig │ ├── Pods-Plugin │ ├── Pods-Plugin-Info.plist │ ├── Pods-Plugin-acknowledgements.markdown │ ├── Pods-Plugin-acknowledgements.plist │ ├── Pods-Plugin-dummy.m │ ├── Pods-Plugin-umbrella.h │ ├── Pods-Plugin.debug.xcconfig │ ├── Pods-Plugin.modulemap │ └── Pods-Plugin.release.xcconfig │ └── Pods-PluginTests │ ├── Pods-PluginTests-Info.plist │ ├── Pods-PluginTests-acknowledgements.markdown │ ├── Pods-PluginTests-acknowledgements.plist │ ├── Pods-PluginTests-dummy.m │ ├── Pods-PluginTests-frameworks.sh │ ├── Pods-PluginTests-umbrella.h │ ├── Pods-PluginTests.debug.xcconfig │ ├── Pods-PluginTests.modulemap │ └── Pods-PluginTests.release.xcconfig ├── package-lock.json ├── package.json ├── rollup.config.js ├── src ├── definitions.ts ├── index.ts └── web.ts └── tsconfig.json /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /CapacitorDarkMode.podspec: -------------------------------------------------------------------------------- 1 | require 'json' 2 | 3 | package = JSON.parse(File.read(File.join(__dir__, 'package.json'))) 4 | 5 | Pod::Spec.new do |s| 6 | s.name = 'CapacitorDarkMode' 7 | s.version = package['version'] 8 | s.summary = package['description'] 9 | s.license = package['license'] 10 | s.homepage = package['repository']['url'] 11 | s.author = package['author'] 12 | s.source = { :git => package['repository']['url'], :tag => s.version.to_s } 13 | s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}' 14 | s.ios.deployment_target = '12.0' 15 | s.dependency 'Capacitor' 16 | s.swift_version = '5.1' 17 | end 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Ionic Capacitor Dark Mode 2 | 3 | For detailed tutorial on how to enable dark mode using this plugin visit: 4 | https://medium.com/@hinddeep.purohit007/supporting-dark-mode-in-ionic-capacitor-8e57fe9dbd47 5 | 6 | Platforms Supported: Android, iOS, Electron and Web/PWA 7 | 8 | This plugin can be used to monitor the changes made to system's dark mode. 9 | 10 | # Installation
11 | 12 | npm install capacitor-dark-mode 13 | 14 | # Android Configuration:
15 | 16 | 1. Open AndroidManifest.xml and find the activity tag.
17 | 2. Inspect android:configChanges="..."
18 | 3. If you find uiMode, please remove it. If it isn't present you can move on safely without doing anything. 19 | 20 | Open MainActivity.java and add the following code inside this.init()
21 | registerPlugin(DarkMode.class);
22 | Adding the above mentioned line will add the following import statement:
23 | import com.bkon.capacitor.DarkMode.DarkMode;
24 | If you encounter errors, please add both the lines manually to MainActivity.java
25 | 26 | # iOS Configuration:
27 | 28 | In the native ios project you will find two modules namely, 'App' and 'Pods'
29 | 30 | 1. Select Pods
31 | 2. Expand 'Development Pods'
32 | 3. Expand 'Capacitor' and open 'CAPBridgeViewController.swift'
33 | 4. Scroll to the very end of the class and paste the following method
34 | ``` 35 | public override func traitCollectionDidChange(\_ previousTraitCollection: UITraitCollection?) { 36 | if #available(iOS 13.0, \*) { 37 | if self.traitCollection.userInterfaceStyle.rawValue != previousTraitCollection?.userInterfaceStyle.rawValue 38 | { 39 | var darkmode = ["isDarkModeOn":false] 40 | if self.traitCollection.userInterfaceStyle.rawValue == 2 41 | { 42 | darkmode = ["isDarkModeOn":true] 43 | } 44 | else 45 | { 46 | darkmode = ["isDarkModeOn":false] 47 | } 48 | NotificationCenter.default.post(name: NSNotification.Name(rawValue: "CAPDarkModeDidChange"), object: self, userInfo: darkmode ) 49 | } 50 | else 51 | { 52 | // No Change 53 | } 54 | } else { 55 | // Fallback on earlier versions. 56 | } 57 | } 58 | ``` 59 | 60 | # Web Configuration
61 | ``` 62 | import { Plugins } from '@capacitor/core'; 63 | const { DarkMode } = Plugins; 64 | import 'capacitor-dark-mode'; 65 | ``` 66 | 67 | SPECIAL NOTE: Remove the import " import 'capacitor-dark-mode' " when building the app for Android and iOS. THe native plugin will not be invoked if you forget to remove the import statement before building for Android and iOS Platform. 68 | 69 | If you wish to listen to system wide dark mode chamges on the web/PWA, add the following line to enable the listener: 70 | ``` 71 | if(!(platform.is("android") || platform.is("ios"))) 72 | { 73 | DarkMode.registerDarkModeChangeListener() 74 | } 75 | ``` 76 | # Listen for changes to Dark Mode: 77 | The event listener might run outside the zone of angular so we might have to trigger change detection ourselves. That is why changedetectorref.detectChanges() has been used.
78 | ``` 79 | DarkMode.addListener("darkModeStateChanged", (state: any) => 80 | if(state.isDarkModeOn) 81 | { 82 | // Dark mode is on. Apply dark theme to your app 83 | changedetectorref.detectChanges() 84 | } 85 | else 86 | { 87 | // Dark mode is off. Apply light theme to your app 88 | changedetectorref.detectChanges() 89 | } 90 | if(state.supported == false) 91 | { 92 | // Dark mode is not supported by the platform 93 | changedetectorref.detectChanges() 94 | } 95 | }); 96 | ``` 97 | 98 | # Check if dark mode is enabled or not: 99 | ``` 100 | let darkmode = await DarkMode.isDarkModeOn(); 101 | console.log(darkmode.isDarkModeOn); 102 | ``` 103 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | ext { 2 | junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.12' 3 | androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.1' 4 | androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.2.0' 5 | } 6 | 7 | buildscript { 8 | repositories { 9 | google() 10 | jcenter() 11 | } 12 | dependencies { 13 | classpath 'com.android.tools.build:gradle:3.6.1' 14 | } 15 | } 16 | 17 | apply plugin: 'com.android.library' 18 | 19 | android { 20 | compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 29 21 | defaultConfig { 22 | minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 21 23 | targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 29 24 | versionCode 1 25 | versionName "1.0" 26 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 27 | } 28 | buildTypes { 29 | release { 30 | minifyEnabled false 31 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 32 | } 33 | } 34 | lintOptions { 35 | abortOnError false 36 | } 37 | } 38 | 39 | repositories { 40 | google() 41 | jcenter() 42 | mavenCentral() 43 | } 44 | 45 | 46 | dependencies { 47 | implementation fileTree(dir: 'libs', include: ['*.jar']) 48 | implementation project(':capacitor-android') 49 | implementation "androidx.appcompat:appcompat:1.2.0" 50 | testImplementation "junit:junit:$junitVersion" 51 | androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion" 52 | androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion" 53 | } 54 | -------------------------------------------------------------------------------- /android/build/generated/source/buildConfig/debug/com/bkon/capacitor/DarkMode/capacitordarkmode/BuildConfig.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Automatically generated file. DO NOT MODIFY 3 | */ 4 | package com.bkon.capacitor.DarkMode.capacitordarkmode; 5 | 6 | public final class BuildConfig { 7 | public static final boolean DEBUG = Boolean.parseBoolean("true"); 8 | public static final String LIBRARY_PACKAGE_NAME = "com.bkon.capacitor.DarkMode.capacitordarkmode"; 9 | public static final String BUILD_TYPE = "debug"; 10 | public static final int VERSION_CODE = 1; 11 | public static final String VERSION_NAME = "1.0"; 12 | } 13 | -------------------------------------------------------------------------------- /android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "applicationId": "com.bkon.capacitor.DarkMode.capacitordarkmode", 4 | "variantType": "LIBRARY", 5 | "elements": [ 6 | { 7 | "outputType": { 8 | "type": "AAPT_FRIENDLY_MERGED_MANIFESTS" 9 | }, 10 | "apkData": { 11 | "type": "MAIN", 12 | "splits": [], 13 | "versionCode": 1, 14 | "versionName": "1.0", 15 | "outputFile": "capacitor-dark-mode-debug.aar", 16 | "fullName": "debug", 17 | "baseName": "debug", 18 | "dirName": "" 19 | }, 20 | "path": "AndroidManifest.xml", 21 | "properties": { 22 | "packageId": "com.bkon.capacitor.DarkMode.capacitordarkmode", 23 | "split": "" 24 | } 25 | } 26 | ] 27 | } -------------------------------------------------------------------------------- /android/build/intermediates/annotation_processor_list/debug/annotationProcessors.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /android/build/intermediates/compile_library_classes/debug/classes.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hinddeep/ionicCapacitorDarkMode/d8f0e3b86466234000c32597e2d9ba63e329446a/android/build/intermediates/compile_library_classes/debug/classes.jar -------------------------------------------------------------------------------- /android/build/intermediates/compile_library_classes_jar/debug/classes.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hinddeep/ionicCapacitorDarkMode/d8f0e3b86466234000c32597e2d9ba63e329446a/android/build/intermediates/compile_library_classes_jar/debug/classes.jar -------------------------------------------------------------------------------- /android/build/intermediates/compile_only_not_namespaced_r_class_jar/debug/R.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hinddeep/ionicCapacitorDarkMode/d8f0e3b86466234000c32597e2d9ba63e329446a/android/build/intermediates/compile_only_not_namespaced_r_class_jar/debug/R.jar -------------------------------------------------------------------------------- /android/build/intermediates/compiled_local_resources/debug/out/layout_bridge_layout_main.xml.flat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hinddeep/ionicCapacitorDarkMode/d8f0e3b86466234000c32597e2d9ba63e329446a/android/build/intermediates/compiled_local_resources/debug/out/layout_bridge_layout_main.xml.flat -------------------------------------------------------------------------------- /android/build/intermediates/incremental/debug-mergeNativeLibs/merge-state: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hinddeep/ionicCapacitorDarkMode/d8f0e3b86466234000c32597e2d9ba63e329446a/android/build/intermediates/incremental/debug-mergeNativeLibs/merge-state -------------------------------------------------------------------------------- /android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /android/build/intermediates/incremental/mergeDebugShaders/merger.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /android/build/intermediates/incremental/packageDebugAssets/merger.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /android/build/intermediates/incremental/packageDebugResources/compile-file-map.properties: -------------------------------------------------------------------------------- 1 | #Thu Aug 20 23:39:19 IST 2020 2 | /Users/hinddeep/Desktop/myapp2/node_modules/capacitor-dark-mode/android/src/main/res/layout/bridge_layout_main.xml=/Users/hinddeep/Desktop/myapp2/node_modules/capacitor-dark-mode/android/build/intermediates/packaged_res/debug/layout/bridge_layout_main.xml 3 | -------------------------------------------------------------------------------- /android/build/intermediates/incremental/packageDebugResources/merged.dir/values/values.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #000 4 | Just a simple string 5 | -------------------------------------------------------------------------------- /android/build/intermediates/incremental/packageDebugResources/merger.xml: -------------------------------------------------------------------------------- 1 | 2 | #000Just a simple string -------------------------------------------------------------------------------- /android/build/intermediates/javac/debug/classes/com/bkon/capacitor/DarkMode/DarkMode.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hinddeep/ionicCapacitorDarkMode/d8f0e3b86466234000c32597e2d9ba63e329446a/android/build/intermediates/javac/debug/classes/com/bkon/capacitor/DarkMode/DarkMode.class -------------------------------------------------------------------------------- /android/build/intermediates/javac/debug/classes/com/bkon/capacitor/DarkMode/capacitordarkmode/BuildConfig.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hinddeep/ionicCapacitorDarkMode/d8f0e3b86466234000c32597e2d9ba63e329446a/android/build/intermediates/javac/debug/classes/com/bkon/capacitor/DarkMode/capacitordarkmode/BuildConfig.class -------------------------------------------------------------------------------- /android/build/intermediates/library_java_res/debug/res.jar: -------------------------------------------------------------------------------- 1 | PK -------------------------------------------------------------------------------- /android/build/intermediates/library_manifest/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /android/build/intermediates/local_only_symbol_list/debug/R-def.txt: -------------------------------------------------------------------------------- 1 | R_DEF: Internal format may change without notice 2 | local 3 | color black 4 | id webview 5 | layout bridge_layout_main 6 | string my_string 7 | -------------------------------------------------------------------------------- /android/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt: -------------------------------------------------------------------------------- 1 | 1 2 | 2 6 | 6 7 | 7 /Users/hinddeep/Desktop/myapp2/node_modules/capacitor-dark-mode/android/src/main/AndroidManifest.xml 10 | 9 android:targetSdkVersion="29" /> 11 | 9-->/Users/hinddeep/Desktop/myapp2/node_modules/capacitor-dark-mode/android/src/main/AndroidManifest.xml 12 | 10 13 | 11 14 | -------------------------------------------------------------------------------- /android/build/intermediates/merged_manifests/debug/output.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "applicationId": "com.bkon.capacitor.DarkMode.capacitordarkmode", 4 | "variantType": "LIBRARY", 5 | "elements": [ 6 | { 7 | "outputType": { 8 | "type": "MERGED_MANIFESTS" 9 | }, 10 | "apkData": { 11 | "type": "MAIN", 12 | "splits": [], 13 | "versionCode": 1, 14 | "versionName": "1.0", 15 | "outputFile": "capacitor-dark-mode-debug.aar", 16 | "fullName": "debug", 17 | "baseName": "debug", 18 | "dirName": "" 19 | }, 20 | "path": "../../library_manifest/debug/AndroidManifest.xml", 21 | "properties": { 22 | "packageId": "com.bkon.capacitor.DarkMode.capacitordarkmode", 23 | "split": "" 24 | } 25 | } 26 | ] 27 | } -------------------------------------------------------------------------------- /android/build/intermediates/navigation_json/debug/navigation.json: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /android/build/intermediates/packaged_res/debug/layout/bridge_layout_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /android/build/intermediates/packaged_res/debug/values/values.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #000 4 | Just a simple string 5 | -------------------------------------------------------------------------------- /android/build/intermediates/runtime_library_classes/debug/classes.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hinddeep/ionicCapacitorDarkMode/d8f0e3b86466234000c32597e2d9ba63e329446a/android/build/intermediates/runtime_library_classes/debug/classes.jar -------------------------------------------------------------------------------- /android/build/intermediates/runtime_library_classes_jar/debug/classes.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hinddeep/ionicCapacitorDarkMode/d8f0e3b86466234000c32597e2d9ba63e329446a/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar -------------------------------------------------------------------------------- /android/build/outputs/logs/manifest-merger-debug-report.txt: -------------------------------------------------------------------------------- 1 | -- Merging decision tree log --- 2 | manifest 3 | ADDED from /Users/hinddeep/Desktop/myapp2/node_modules/capacitor-dark-mode/android/src/main/AndroidManifest.xml:2:3-4:14 4 | INJECTED from /Users/hinddeep/Desktop/myapp2/node_modules/capacitor-dark-mode/android/src/main/AndroidManifest.xml:2:3-4:14 5 | INJECTED from /Users/hinddeep/Desktop/myapp2/node_modules/capacitor-dark-mode/android/src/main/AndroidManifest.xml:2:3-4:14 6 | INJECTED from /Users/hinddeep/Desktop/myapp2/node_modules/capacitor-dark-mode/android/src/main/AndroidManifest.xml:2:3-4:14 7 | INJECTED from /Users/hinddeep/Desktop/myapp2/node_modules/capacitor-dark-mode/android/src/main/AndroidManifest.xml:2:3-4:14 8 | INJECTED from /Users/hinddeep/Desktop/myapp2/node_modules/capacitor-dark-mode/android/src/main/AndroidManifest.xml:2:3-4:14 9 | INJECTED from /Users/hinddeep/Desktop/myapp2/node_modules/capacitor-dark-mode/android/src/main/AndroidManifest.xml:2:3-4:14 10 | package 11 | ADDED from /Users/hinddeep/Desktop/myapp2/node_modules/capacitor-dark-mode/android/src/main/AndroidManifest.xml:3:7-62 12 | INJECTED from /Users/hinddeep/Desktop/myapp2/node_modules/capacitor-dark-mode/android/src/main/AndroidManifest.xml 13 | INJECTED from /Users/hinddeep/Desktop/myapp2/node_modules/capacitor-dark-mode/android/src/main/AndroidManifest.xml 14 | android:versionName 15 | INJECTED from /Users/hinddeep/Desktop/myapp2/node_modules/capacitor-dark-mode/android/src/main/AndroidManifest.xml 16 | ADDED from /Users/hinddeep/Desktop/myapp2/node_modules/capacitor-dark-mode/android/src/main/AndroidManifest.xml:2:3-4:14 17 | INJECTED from /Users/hinddeep/Desktop/myapp2/node_modules/capacitor-dark-mode/android/src/main/AndroidManifest.xml 18 | android:versionCode 19 | INJECTED from /Users/hinddeep/Desktop/myapp2/node_modules/capacitor-dark-mode/android/src/main/AndroidManifest.xml 20 | ADDED from /Users/hinddeep/Desktop/myapp2/node_modules/capacitor-dark-mode/android/src/main/AndroidManifest.xml:2:3-4:14 21 | INJECTED from /Users/hinddeep/Desktop/myapp2/node_modules/capacitor-dark-mode/android/src/main/AndroidManifest.xml 22 | xmlns:android 23 | ADDED from /Users/hinddeep/Desktop/myapp2/node_modules/capacitor-dark-mode/android/src/main/AndroidManifest.xml:2:13-71 24 | uses-sdk 25 | INJECTED from /Users/hinddeep/Desktop/myapp2/node_modules/capacitor-dark-mode/android/src/main/AndroidManifest.xml reason: use-sdk injection requested 26 | INJECTED from /Users/hinddeep/Desktop/myapp2/node_modules/capacitor-dark-mode/android/src/main/AndroidManifest.xml 27 | INJECTED from /Users/hinddeep/Desktop/myapp2/node_modules/capacitor-dark-mode/android/src/main/AndroidManifest.xml 28 | INJECTED from /Users/hinddeep/Desktop/myapp2/node_modules/capacitor-dark-mode/android/src/main/AndroidManifest.xml 29 | INJECTED from /Users/hinddeep/Desktop/myapp2/node_modules/capacitor-dark-mode/android/src/main/AndroidManifest.xml 30 | android:targetSdkVersion 31 | INJECTED from /Users/hinddeep/Desktop/myapp2/node_modules/capacitor-dark-mode/android/src/main/AndroidManifest.xml 32 | ADDED from /Users/hinddeep/Desktop/myapp2/node_modules/capacitor-dark-mode/android/src/main/AndroidManifest.xml 33 | INJECTED from /Users/hinddeep/Desktop/myapp2/node_modules/capacitor-dark-mode/android/src/main/AndroidManifest.xml 34 | android:minSdkVersion 35 | INJECTED from /Users/hinddeep/Desktop/myapp2/node_modules/capacitor-dark-mode/android/src/main/AndroidManifest.xml 36 | ADDED from /Users/hinddeep/Desktop/myapp2/node_modules/capacitor-dark-mode/android/src/main/AndroidManifest.xml 37 | INJECTED from /Users/hinddeep/Desktop/myapp2/node_modules/capacitor-dark-mode/android/src/main/AndroidManifest.xml 38 | -------------------------------------------------------------------------------- /android/capacitor-dark-mode.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 10 | 11 | 12 | 13 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | org.gradle.jvmargs=-Xmx1536m 13 | 14 | # When configured, Gradle will run in incubating parallel mode. 15 | # This option should only be used with decoupled projects. More details, visit 16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 17 | # org.gradle.parallel=true 18 | 19 | # AndroidX package structure to make it clearer which packages are bundled with the 20 | # Android operating system, and which are packaged with your app's APK 21 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 22 | android.useAndroidX=true 23 | # Automatically convert third-party libraries to use AndroidX 24 | android.enableJetifier=true 25 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hinddeep/ionicCapacitorDarkMode/d8f0e3b86466234000c32597e2d9ba63e329446a/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # 4 | # Copyright 2015 the original author or authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | ## 21 | ## Gradle start up script for UN*X 22 | ## 23 | ############################################################################## 24 | 25 | # Attempt to set APP_HOME 26 | # Resolve links: $0 may be a link 27 | PRG="$0" 28 | # Need this for relative symlinks. 29 | while [ -h "$PRG" ] ; do 30 | ls=`ls -ld "$PRG"` 31 | link=`expr "$ls" : '.*-> \(.*\)$'` 32 | if expr "$link" : '/.*' > /dev/null; then 33 | PRG="$link" 34 | else 35 | PRG=`dirname "$PRG"`"/$link" 36 | fi 37 | done 38 | SAVED="`pwd`" 39 | cd "`dirname \"$PRG\"`/" >/dev/null 40 | APP_HOME="`pwd -P`" 41 | cd "$SAVED" >/dev/null 42 | 43 | APP_NAME="Gradle" 44 | APP_BASE_NAME=`basename "$0"` 45 | 46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 48 | 49 | # Use the maximum available, or set MAX_FD != -1 to use that value. 50 | MAX_FD="maximum" 51 | 52 | warn () { 53 | echo "$*" 54 | } 55 | 56 | die () { 57 | echo 58 | echo "$*" 59 | echo 60 | exit 1 61 | } 62 | 63 | # OS specific support (must be 'true' or 'false'). 64 | cygwin=false 65 | msys=false 66 | darwin=false 67 | nonstop=false 68 | case "`uname`" in 69 | CYGWIN* ) 70 | cygwin=true 71 | ;; 72 | Darwin* ) 73 | darwin=true 74 | ;; 75 | MINGW* ) 76 | msys=true 77 | ;; 78 | NONSTOP* ) 79 | nonstop=true 80 | ;; 81 | esac 82 | 83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 84 | 85 | # Determine the Java command to use to start the JVM. 86 | if [ -n "$JAVA_HOME" ] ; then 87 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 88 | # IBM's JDK on AIX uses strange locations for the executables 89 | JAVACMD="$JAVA_HOME/jre/sh/java" 90 | else 91 | JAVACMD="$JAVA_HOME/bin/java" 92 | fi 93 | if [ ! -x "$JAVACMD" ] ; then 94 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 95 | 96 | Please set the JAVA_HOME variable in your environment to match the 97 | location of your Java installation." 98 | fi 99 | else 100 | JAVACMD="java" 101 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 102 | 103 | Please set the JAVA_HOME variable in your environment to match the 104 | location of your Java installation." 105 | fi 106 | 107 | # Increase the maximum file descriptors if we can. 108 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 109 | MAX_FD_LIMIT=`ulimit -H -n` 110 | if [ $? -eq 0 ] ; then 111 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 112 | MAX_FD="$MAX_FD_LIMIT" 113 | fi 114 | ulimit -n $MAX_FD 115 | if [ $? -ne 0 ] ; then 116 | warn "Could not set maximum file descriptor limit: $MAX_FD" 117 | fi 118 | else 119 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 120 | fi 121 | fi 122 | 123 | # For Darwin, add options to specify how the application appears in the dock 124 | if $darwin; then 125 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 126 | fi 127 | 128 | # For Cygwin or MSYS, switch paths to Windows format before running java 129 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then 130 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 131 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 132 | JAVACMD=`cygpath --unix "$JAVACMD"` 133 | 134 | # We build the pattern for arguments to be converted via cygpath 135 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 136 | SEP="" 137 | for dir in $ROOTDIRSRAW ; do 138 | ROOTDIRS="$ROOTDIRS$SEP$dir" 139 | SEP="|" 140 | done 141 | OURCYGPATTERN="(^($ROOTDIRS))" 142 | # Add a user-defined pattern to the cygpath arguments 143 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 144 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 145 | fi 146 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 147 | i=0 148 | for arg in "$@" ; do 149 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 150 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 151 | 152 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 153 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 154 | else 155 | eval `echo args$i`="\"$arg\"" 156 | fi 157 | i=$((i+1)) 158 | done 159 | case $i in 160 | (0) set -- ;; 161 | (1) set -- "$args0" ;; 162 | (2) set -- "$args0" "$args1" ;; 163 | (3) set -- "$args0" "$args1" "$args2" ;; 164 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 165 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 166 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 167 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 168 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 169 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 170 | esac 171 | fi 172 | 173 | # Escape application args 174 | save () { 175 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 176 | echo " " 177 | } 178 | APP_ARGS=$(save "$@") 179 | 180 | # Collect all arguments for the java command, following the shell quoting and substitution rules 181 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 182 | 183 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 184 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then 185 | cd "$(dirname "$0")" 186 | fi 187 | 188 | exec "$JAVACMD" "$@" 189 | -------------------------------------------------------------------------------- /android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 33 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 34 | 35 | @rem Find java.exe 36 | if defined JAVA_HOME goto findJavaFromJavaHome 37 | 38 | set JAVA_EXE=java.exe 39 | %JAVA_EXE% -version >NUL 2>&1 40 | if "%ERRORLEVEL%" == "0" goto init 41 | 42 | echo. 43 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 44 | echo. 45 | echo Please set the JAVA_HOME variable in your environment to match the 46 | echo location of your Java installation. 47 | 48 | goto fail 49 | 50 | :findJavaFromJavaHome 51 | set JAVA_HOME=%JAVA_HOME:"=% 52 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 53 | 54 | if exist "%JAVA_EXE%" goto init 55 | 56 | echo. 57 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 58 | echo. 59 | echo Please set the JAVA_HOME variable in your environment to match the 60 | echo location of your Java installation. 61 | 62 | goto fail 63 | 64 | :init 65 | @rem Get command-line arguments, handling Windows variants 66 | 67 | if not "%OS%" == "Windows_NT" goto win9xME_args 68 | 69 | :win9xME_args 70 | @rem Slurp the command line arguments. 71 | set CMD_LINE_ARGS= 72 | set _SKIP=2 73 | 74 | :win9xME_args_slurp 75 | if "x%~1" == "x" goto execute 76 | 77 | set CMD_LINE_ARGS=%* 78 | 79 | :execute 80 | @rem Setup the command line 81 | 82 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 83 | 84 | @rem Execute Gradle 85 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 86 | 87 | :end 88 | @rem End local scope for the variables with windows NT shell 89 | if "%ERRORLEVEL%"=="0" goto mainEnd 90 | 91 | :fail 92 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 93 | rem the _cmd.exe /c_ return code! 94 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 95 | exit /b 1 96 | 97 | :mainEnd 98 | if "%OS%"=="Windows_NT" endlocal 99 | 100 | :omega 101 | -------------------------------------------------------------------------------- /android/local.properties: -------------------------------------------------------------------------------- 1 | ## This file must *NOT* be checked into Version Control Systems, 2 | # as it contains information specific to your local configuration. 3 | # 4 | # Location of the SDK. This is only used by Gradle. 5 | # For customization when using a Version Control System, please read the 6 | # header note. 7 | #Thu Aug 20 23:22:07 IST 2020 8 | sdk.dir=/Users/hinddeep/Library/Android/sdk 9 | -------------------------------------------------------------------------------- /android/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':capacitor-android' 2 | project(':capacitor-android').projectDir = new File('../node_modules/@capacitor/android/capacitor') -------------------------------------------------------------------------------- /android/src/androidTest/java/com/getcapacitor/android/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.getcapacitor.android; 2 | 3 | import static org.junit.Assert.*; 4 | 5 | import android.content.Context; 6 | import androidx.test.ext.junit.runners.AndroidJUnit4; 7 | import androidx.test.platform.app.InstrumentationRegistry; 8 | import org.junit.Test; 9 | import org.junit.runner.RunWith; 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * @see Testing documentation 15 | */ 16 | @RunWith(AndroidJUnit4.class) 17 | public class ExampleInstrumentedTest { 18 | 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); 23 | 24 | assertEquals("com.getcapacitor.android", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | -------------------------------------------------------------------------------- /android/src/main/java/com/bkon/capacitor/DarkMode/DarkMode.java: -------------------------------------------------------------------------------- 1 | package com.bkon.capacitor.DarkMode; 2 | 3 | import android.content.Context; 4 | import android.content.res.Configuration; 5 | import android.util.Log; 6 | 7 | import com.bkon.capacitor.DarkMode.capacitordarkmode.R; 8 | import com.getcapacitor.JSObject; 9 | import com.getcapacitor.NativePlugin; 10 | import com.getcapacitor.Plugin; 11 | import com.getcapacitor.PluginCall; 12 | import com.getcapacitor.PluginMethod; 13 | 14 | import org.json.JSONException; 15 | 16 | @NativePlugin() 17 | public class DarkMode extends Plugin { 18 | 19 | private boolean isDarkModeOn = false; 20 | private static final String EVENT_DARK_MODE_CHANGE = "darkModeStateChanged"; 21 | 22 | @Override 23 | protected void handleOnRestart() { 24 | super.handleOnRestart(); 25 | Log.i("capacitor","restarted"); 26 | notifyWeb(); 27 | } 28 | 29 | @Override 30 | protected void handleOnResume() { 31 | super.handleOnResume(); 32 | Log.i("capacitor","resumed"); 33 | notifyWeb(); 34 | } 35 | 36 | public void notifyWeb() { 37 | JSObject data = checkMode(); 38 | try { 39 | if (data.getBoolean("isDarkModeOn")) { 40 | getBridge().getActivity().getWindow() 41 | .setNavigationBarColor(getBridge().getActivity().getResources().getColor(R.color.black)); 42 | } 43 | } catch (JSONException e) { 44 | e.printStackTrace(); 45 | } 46 | Log.i("capacitor",data.getString("isDarkModeOn")); 47 | notifyListeners(this.EVENT_DARK_MODE_CHANGE, data, true); 48 | } 49 | 50 | @PluginMethod() 51 | public void isDarkModeOn(PluginCall call) { 52 | JSObject data = checkMode(); 53 | call.success(data); 54 | } 55 | 56 | public JSObject checkMode() { 57 | Context ctx = getContext(); 58 | JSObject data = new JSObject(); 59 | 60 | int nightModeFlags = ctx.getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK; 61 | switch (nightModeFlags) { 62 | case Configuration.UI_MODE_NIGHT_YES: 63 | isDarkModeOn = true; 64 | data.put("isDarkModeOn", isDarkModeOn); 65 | break; 66 | 67 | case Configuration.UI_MODE_NIGHT_NO: 68 | isDarkModeOn = false; 69 | data = new JSObject(); 70 | data.put("isDarkModeOn", isDarkModeOn); 71 | break; 72 | 73 | case Configuration.UI_MODE_NIGHT_UNDEFINED: 74 | isDarkModeOn = false; 75 | data = new JSObject(); 76 | data.put("isDarkModeOn", isDarkModeOn); 77 | break; 78 | } 79 | return data; 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /android/src/main/res/layout/bridge_layout_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /android/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #000 4 | 5 | -------------------------------------------------------------------------------- /android/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Just a simple string 3 | 4 | -------------------------------------------------------------------------------- /android/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /android/src/test/java/com/getcapacitor/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.getcapacitor; 2 | 3 | import static org.junit.Assert.*; 4 | 5 | import org.junit.Test; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | 14 | @Test 15 | public void addition_isCorrect() throws Exception { 16 | assertEquals(4, 2 + 2); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /dist/esm/definitions.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginListenerHandle } from "@capacitor/core"; 2 | export interface DarkModePlugin { 3 | isDarkModeOn(): Promise; 4 | addListener(eventName: 'darkModeStateChanged', listenerFunc: (state: any) => void): PluginListenerHandle; 5 | registerDarkModeChangeListener(): void; 6 | } 7 | -------------------------------------------------------------------------------- /dist/esm/definitions.js: -------------------------------------------------------------------------------- 1 | //# sourceMappingURL=definitions.js.map -------------------------------------------------------------------------------- /dist/esm/definitions.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":""} -------------------------------------------------------------------------------- /dist/esm/index.d.ts: -------------------------------------------------------------------------------- 1 | export * from './definitions'; 2 | export * from './web'; 3 | -------------------------------------------------------------------------------- /dist/esm/index.js: -------------------------------------------------------------------------------- 1 | export * from './web'; 2 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /dist/esm/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,cAAc,OAAO,CAAC"} -------------------------------------------------------------------------------- /dist/esm/web.d.ts: -------------------------------------------------------------------------------- 1 | import { WebPlugin } from '@capacitor/core'; 2 | import { DarkModePlugin } from './definitions'; 3 | export declare class DarkModeWeb extends WebPlugin implements DarkModePlugin { 4 | darkMode: { 5 | isDarkModeOn: boolean; 6 | }; 7 | constructor(); 8 | isDarkModeOn(): Promise; 9 | registerDarkModeChangeListener(): void; 10 | } 11 | declare const DarkMode: DarkModeWeb; 12 | export { DarkMode }; 13 | -------------------------------------------------------------------------------- /dist/esm/web.js: -------------------------------------------------------------------------------- 1 | import { WebPlugin } from '@capacitor/core'; 2 | export class DarkModeWeb extends WebPlugin { 3 | constructor() { 4 | super({ 5 | name: 'DarkMode', 6 | platforms: ['web', 'android', 'ios'], 7 | }); 8 | this.darkMode = { "isDarkModeOn": false }; 9 | } 10 | isDarkModeOn() { 11 | var darkMode = { "isDarkModeOn": false }; 12 | if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) { 13 | darkMode.isDarkModeOn = true; 14 | } 15 | return Promise.resolve(darkMode); 16 | } 17 | registerDarkModeChangeListener() { 18 | var darkMode = { "isDarkModeOn": false }; 19 | window.matchMedia("(prefers-color-scheme: dark)").addListener((status) => { 20 | if (status.matches) { 21 | darkMode = { "isDarkModeOn": true }; 22 | } 23 | else { 24 | darkMode = { "isDarkModeOn": false }; 25 | } 26 | this.notifyListeners("darkModeStateChanged", darkMode); 27 | }); 28 | } 29 | } 30 | const DarkMode = new DarkModeWeb(); 31 | export { DarkMode }; 32 | import { registerWebPlugin } from '@capacitor/core'; 33 | registerWebPlugin(DarkMode); 34 | //# sourceMappingURL=web.js.map -------------------------------------------------------------------------------- /dist/esm/web.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,MAAM,OAAO,WAAY,SAAQ,SAAS;IAGxC;QACE,KAAK,CAAC;YACJ,IAAI,EAAE,UAAU;YAChB,SAAS,EAAE,CAAC,KAAK,EAAC,SAAS,EAAC,KAAK,CAAC;SACnC,CAAC,CAAC;QANL,aAAQ,GAAG,EAAC,cAAc,EAAC,KAAK,EAAC,CAAA;IAOjC,CAAC;IAED,YAAY;QACV,IAAI,QAAQ,GAAG,EAAC,cAAc,EAAC,KAAK,EAAC,CAAA;QACrC,IAAG,MAAM,CAAC,UAAU,IAAI,MAAM,CAAC,UAAU,CAAC,8BAA8B,CAAC,CAAC,OAAO,EACjF;YACE,QAAQ,CAAC,YAAY,GAAG,IAAI,CAAA;SAC7B;QACD,OAAQ,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACpC,CAAC;IAED,8BAA8B;QAE5B,IAAI,QAAQ,GAAG,EAAC,cAAc,EAAC,KAAK,EAAC,CAAA;QACnC,MAAM,CAAC,UAAU,CAAC,8BAA8B,CAAC,CAAC,WAAW,CAAC,CAAC,MAAM,EAAE,EAAE;YACvE,IAAG,MAAM,CAAC,OAAO,EACjB;gBACE,QAAQ,GAAG,EAAC,cAAc,EAAC,IAAI,EAAC,CAAA;aACjC;iBAED;gBACE,QAAQ,GAAG,EAAC,cAAc,EAAC,KAAK,EAAC,CAAA;aAClC;YACD,IAAI,CAAC,eAAe,CAAC,sBAAsB,EAAC,QAAQ,CAAC,CAAA;QACzD,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAED,MAAM,QAAQ,GAAG,IAAI,WAAW,EAAE,CAAC;AAEnC,OAAO,EAAE,QAAQ,EAAE,CAAC;AAEpB,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,iBAAiB,CAAC,QAAQ,CAAC,CAAC"} -------------------------------------------------------------------------------- /dist/plugin.js: -------------------------------------------------------------------------------- 1 | var capacitorPlugin = (function (exports, core) { 2 | 'use strict'; 3 | 4 | class DarkModeWeb extends core.WebPlugin { 5 | constructor() { 6 | super({ 7 | name: 'DarkMode', 8 | platforms: ['web', 'android', 'ios'], 9 | }); 10 | this.darkMode = { "isDarkModeOn": false }; 11 | } 12 | isDarkModeOn() { 13 | var darkMode = { "isDarkModeOn": false }; 14 | if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) { 15 | darkMode.isDarkModeOn = true; 16 | } 17 | return Promise.resolve(darkMode); 18 | } 19 | registerDarkModeChangeListener() { 20 | var darkMode = { "isDarkModeOn": false }; 21 | window.matchMedia("(prefers-color-scheme: dark)").addListener((status) => { 22 | if (status.matches) { 23 | darkMode = { "isDarkModeOn": true }; 24 | } 25 | else { 26 | darkMode = { "isDarkModeOn": false }; 27 | } 28 | this.notifyListeners("darkModeStateChanged", darkMode); 29 | }); 30 | } 31 | } 32 | const DarkMode = new DarkModeWeb(); 33 | core.registerWebPlugin(DarkMode); 34 | 35 | exports.DarkMode = DarkMode; 36 | exports.DarkModeWeb = DarkModeWeb; 37 | 38 | Object.defineProperty(exports, '__esModule', { value: true }); 39 | 40 | return exports; 41 | 42 | })({}, capacitorExports); 43 | //# sourceMappingURL=plugin.js.map 44 | -------------------------------------------------------------------------------- /dist/plugin.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"plugin.js","sources":["esm/web.js"],"sourcesContent":["import { WebPlugin } from '@capacitor/core';\nexport class DarkModeWeb extends WebPlugin {\n constructor() {\n super({\n name: 'DarkMode',\n platforms: ['web', 'android', 'ios'],\n });\n this.darkMode = { \"isDarkModeOn\": false };\n }\n isDarkModeOn() {\n var darkMode = { \"isDarkModeOn\": false };\n if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {\n darkMode.isDarkModeOn = true;\n }\n return Promise.resolve(darkMode);\n }\n registerDarkModeChangeListener() {\n var darkMode = { \"isDarkModeOn\": false };\n window.matchMedia(\"(prefers-color-scheme: dark)\").addListener((status) => {\n if (status.matches) {\n darkMode = { \"isDarkModeOn\": true };\n }\n else {\n darkMode = { \"isDarkModeOn\": false };\n }\n this.notifyListeners(\"darkModeStateChanged\", darkMode);\n });\n }\n}\nconst DarkMode = new DarkModeWeb();\nexport { DarkMode };\nimport { registerWebPlugin } from '@capacitor/core';\nregisterWebPlugin(DarkMode);\n//# sourceMappingURL=web.js.map"],"names":["WebPlugin","registerWebPlugin"],"mappings":";;;IACO,MAAM,WAAW,SAASA,cAAS,CAAC;IAC3C,IAAI,WAAW,GAAG;IAClB,QAAQ,KAAK,CAAC;IACd,YAAY,IAAI,EAAE,UAAU;IAC5B,YAAY,SAAS,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,CAAC;IAChD,SAAS,CAAC,CAAC;IACX,QAAQ,IAAI,CAAC,QAAQ,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC;IAClD,KAAK;IACL,IAAI,YAAY,GAAG;IACnB,QAAQ,IAAI,QAAQ,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC;IACjD,QAAQ,IAAI,MAAM,CAAC,UAAU,IAAI,MAAM,CAAC,UAAU,CAAC,8BAA8B,CAAC,CAAC,OAAO,EAAE;IAC5F,YAAY,QAAQ,CAAC,YAAY,GAAG,IAAI,CAAC;IACzC,SAAS;IACT,QAAQ,OAAO,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACzC,KAAK;IACL,IAAI,8BAA8B,GAAG;IACrC,QAAQ,IAAI,QAAQ,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC;IACjD,QAAQ,MAAM,CAAC,UAAU,CAAC,8BAA8B,CAAC,CAAC,WAAW,CAAC,CAAC,MAAM,KAAK;IAClF,YAAY,IAAI,MAAM,CAAC,OAAO,EAAE;IAChC,gBAAgB,QAAQ,GAAG,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC;IACpD,aAAa;IACb,iBAAiB;IACjB,gBAAgB,QAAQ,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC;IACrD,aAAa;IACb,YAAY,IAAI,CAAC,eAAe,CAAC,sBAAsB,EAAE,QAAQ,CAAC,CAAC;IACnE,SAAS,CAAC,CAAC;IACX,KAAK;IACL,CAAC;AACI,UAAC,QAAQ,GAAG,IAAI,WAAW,GAAG;AAGnCC,0BAAiB,CAAC,QAAQ,CAAC;;;;;;;;;;;;;"} -------------------------------------------------------------------------------- /ios/Plugin.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 48; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 03FC29A292ACC40490383A1F /* Pods_Plugin.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B2A61DA5A1F2DD4F959604D /* Pods_Plugin.framework */; }; 11 | 20C0B05DCFC8E3958A738AF2 /* Pods_PluginTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F6753A823D3815DB436415E3 /* Pods_PluginTests.framework */; }; 12 | 50ADFF92201F53D600D50D53 /* Plugin.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 50ADFF88201F53D600D50D53 /* Plugin.framework */; }; 13 | 50ADFF97201F53D600D50D53 /* PluginTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50ADFF96201F53D600D50D53 /* PluginTests.swift */; }; 14 | 50ADFF99201F53D600D50D53 /* Plugin.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ADFF8B201F53D600D50D53 /* Plugin.h */; settings = {ATTRIBUTES = (Public, ); }; }; 15 | 50ADFFA42020D75100D50D53 /* Capacitor.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 50ADFFA52020D75100D50D53 /* Capacitor.framework */; }; 16 | 50ADFFA82020EE4F00D50D53 /* Plugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 50ADFFA72020EE4F00D50D53 /* Plugin.m */; }; 17 | 50E1A94820377CB70090CE1A /* Plugin.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50E1A94720377CB70090CE1A /* Plugin.swift */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXContainerItemProxy section */ 21 | 50ADFF93201F53D600D50D53 /* PBXContainerItemProxy */ = { 22 | isa = PBXContainerItemProxy; 23 | containerPortal = 50ADFF7F201F53D600D50D53 /* Project object */; 24 | proxyType = 1; 25 | remoteGlobalIDString = 50ADFF87201F53D600D50D53; 26 | remoteInfo = Plugin; 27 | }; 28 | /* End PBXContainerItemProxy section */ 29 | 30 | /* Begin PBXFileReference section */ 31 | 3B2A61DA5A1F2DD4F959604D /* Pods_Plugin.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Plugin.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 32 | 50ADFF88201F53D600D50D53 /* Plugin.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Plugin.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 33 | 50ADFF8B201F53D600D50D53 /* Plugin.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Plugin.h; sourceTree = ""; }; 34 | 50ADFF8C201F53D600D50D53 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 35 | 50ADFF91201F53D600D50D53 /* PluginTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PluginTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 36 | 50ADFF96201F53D600D50D53 /* PluginTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PluginTests.swift; sourceTree = ""; }; 37 | 50ADFF98201F53D600D50D53 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 38 | 50ADFFA52020D75100D50D53 /* Capacitor.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Capacitor.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 39 | 50ADFFA72020EE4F00D50D53 /* Plugin.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Plugin.m; sourceTree = ""; }; 40 | 50E1A94720377CB70090CE1A /* Plugin.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Plugin.swift; sourceTree = ""; }; 41 | 5E23F77F099397094342571A /* Pods-Plugin.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Plugin.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Plugin/Pods-Plugin.debug.xcconfig"; sourceTree = ""; }; 42 | 91781294A431A2A7CC6EB714 /* Pods-Plugin.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Plugin.release.xcconfig"; path = "Pods/Target Support Files/Pods-Plugin/Pods-Plugin.release.xcconfig"; sourceTree = ""; }; 43 | 96ED1B6440D6672E406C8D19 /* Pods-PluginTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PluginTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests.debug.xcconfig"; sourceTree = ""; }; 44 | F65BB2953ECE002E1EF3E424 /* Pods-PluginTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PluginTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests.release.xcconfig"; sourceTree = ""; }; 45 | F6753A823D3815DB436415E3 /* Pods_PluginTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_PluginTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 46 | /* End PBXFileReference section */ 47 | 48 | /* Begin PBXFrameworksBuildPhase section */ 49 | 50ADFF84201F53D600D50D53 /* Frameworks */ = { 50 | isa = PBXFrameworksBuildPhase; 51 | buildActionMask = 2147483647; 52 | files = ( 53 | 50ADFFA42020D75100D50D53 /* Capacitor.framework in Frameworks */, 54 | 03FC29A292ACC40490383A1F /* Pods_Plugin.framework in Frameworks */, 55 | ); 56 | runOnlyForDeploymentPostprocessing = 0; 57 | }; 58 | 50ADFF8E201F53D600D50D53 /* Frameworks */ = { 59 | isa = PBXFrameworksBuildPhase; 60 | buildActionMask = 2147483647; 61 | files = ( 62 | 50ADFF92201F53D600D50D53 /* Plugin.framework in Frameworks */, 63 | 20C0B05DCFC8E3958A738AF2 /* Pods_PluginTests.framework in Frameworks */, 64 | ); 65 | runOnlyForDeploymentPostprocessing = 0; 66 | }; 67 | /* End PBXFrameworksBuildPhase section */ 68 | 69 | /* Begin PBXGroup section */ 70 | 50ADFF7E201F53D600D50D53 = { 71 | isa = PBXGroup; 72 | children = ( 73 | 50ADFF8A201F53D600D50D53 /* Plugin */, 74 | 50ADFF95201F53D600D50D53 /* PluginTests */, 75 | 50ADFF89201F53D600D50D53 /* Products */, 76 | 8C8E7744173064A9F6D438E3 /* Pods */, 77 | A797B9EFA3DCEFEA1FBB66A9 /* Frameworks */, 78 | ); 79 | sourceTree = ""; 80 | }; 81 | 50ADFF89201F53D600D50D53 /* Products */ = { 82 | isa = PBXGroup; 83 | children = ( 84 | 50ADFF88201F53D600D50D53 /* Plugin.framework */, 85 | 50ADFF91201F53D600D50D53 /* PluginTests.xctest */, 86 | ); 87 | name = Products; 88 | sourceTree = ""; 89 | }; 90 | 50ADFF8A201F53D600D50D53 /* Plugin */ = { 91 | isa = PBXGroup; 92 | children = ( 93 | 50E1A94720377CB70090CE1A /* Plugin.swift */, 94 | 50ADFF8B201F53D600D50D53 /* Plugin.h */, 95 | 50ADFFA72020EE4F00D50D53 /* Plugin.m */, 96 | 50ADFF8C201F53D600D50D53 /* Info.plist */, 97 | ); 98 | path = Plugin; 99 | sourceTree = ""; 100 | }; 101 | 50ADFF95201F53D600D50D53 /* PluginTests */ = { 102 | isa = PBXGroup; 103 | children = ( 104 | 50ADFF96201F53D600D50D53 /* PluginTests.swift */, 105 | 50ADFF98201F53D600D50D53 /* Info.plist */, 106 | ); 107 | path = PluginTests; 108 | sourceTree = ""; 109 | }; 110 | 8C8E7744173064A9F6D438E3 /* Pods */ = { 111 | isa = PBXGroup; 112 | children = ( 113 | 5E23F77F099397094342571A /* Pods-Plugin.debug.xcconfig */, 114 | 91781294A431A2A7CC6EB714 /* Pods-Plugin.release.xcconfig */, 115 | 96ED1B6440D6672E406C8D19 /* Pods-PluginTests.debug.xcconfig */, 116 | F65BB2953ECE002E1EF3E424 /* Pods-PluginTests.release.xcconfig */, 117 | ); 118 | name = Pods; 119 | sourceTree = ""; 120 | }; 121 | A797B9EFA3DCEFEA1FBB66A9 /* Frameworks */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | 50ADFFA52020D75100D50D53 /* Capacitor.framework */, 125 | 3B2A61DA5A1F2DD4F959604D /* Pods_Plugin.framework */, 126 | F6753A823D3815DB436415E3 /* Pods_PluginTests.framework */, 127 | ); 128 | name = Frameworks; 129 | sourceTree = ""; 130 | }; 131 | /* End PBXGroup section */ 132 | 133 | /* Begin PBXHeadersBuildPhase section */ 134 | 50ADFF85201F53D600D50D53 /* Headers */ = { 135 | isa = PBXHeadersBuildPhase; 136 | buildActionMask = 2147483647; 137 | files = ( 138 | 50ADFF99201F53D600D50D53 /* Plugin.h in Headers */, 139 | ); 140 | runOnlyForDeploymentPostprocessing = 0; 141 | }; 142 | /* End PBXHeadersBuildPhase section */ 143 | 144 | /* Begin PBXNativeTarget section */ 145 | 50ADFF87201F53D600D50D53 /* Plugin */ = { 146 | isa = PBXNativeTarget; 147 | buildConfigurationList = 50ADFF9C201F53D600D50D53 /* Build configuration list for PBXNativeTarget "Plugin" */; 148 | buildPhases = ( 149 | AB5B3E54B4E897F32C2279DA /* [CP] Check Pods Manifest.lock */, 150 | 50ADFF83201F53D600D50D53 /* Sources */, 151 | 50ADFF84201F53D600D50D53 /* Frameworks */, 152 | 50ADFF85201F53D600D50D53 /* Headers */, 153 | 50ADFF86201F53D600D50D53 /* Resources */, 154 | ); 155 | buildRules = ( 156 | ); 157 | dependencies = ( 158 | ); 159 | name = Plugin; 160 | productName = Plugin; 161 | productReference = 50ADFF88201F53D600D50D53 /* Plugin.framework */; 162 | productType = "com.apple.product-type.framework"; 163 | }; 164 | 50ADFF90201F53D600D50D53 /* PluginTests */ = { 165 | isa = PBXNativeTarget; 166 | buildConfigurationList = 50ADFF9F201F53D600D50D53 /* Build configuration list for PBXNativeTarget "PluginTests" */; 167 | buildPhases = ( 168 | 0596884F929ED6F1DE134961 /* [CP] Check Pods Manifest.lock */, 169 | 50ADFF8D201F53D600D50D53 /* Sources */, 170 | 50ADFF8E201F53D600D50D53 /* Frameworks */, 171 | 50ADFF8F201F53D600D50D53 /* Resources */, 172 | CCA81D3B7E26D0D727D24C84 /* [CP] Embed Pods Frameworks */, 173 | ); 174 | buildRules = ( 175 | ); 176 | dependencies = ( 177 | 50ADFF94201F53D600D50D53 /* PBXTargetDependency */, 178 | ); 179 | name = PluginTests; 180 | productName = PluginTests; 181 | productReference = 50ADFF91201F53D600D50D53 /* PluginTests.xctest */; 182 | productType = "com.apple.product-type.bundle.unit-test"; 183 | }; 184 | /* End PBXNativeTarget section */ 185 | 186 | /* Begin PBXProject section */ 187 | 50ADFF7F201F53D600D50D53 /* Project object */ = { 188 | isa = PBXProject; 189 | attributes = { 190 | LastSwiftUpdateCheck = 0920; 191 | LastUpgradeCheck = 0920; 192 | ORGANIZATIONNAME = "Max Lynch"; 193 | TargetAttributes = { 194 | 50ADFF87201F53D600D50D53 = { 195 | CreatedOnToolsVersion = 9.2; 196 | LastSwiftMigration = 1100; 197 | ProvisioningStyle = Automatic; 198 | }; 199 | 50ADFF90201F53D600D50D53 = { 200 | CreatedOnToolsVersion = 9.2; 201 | LastSwiftMigration = 1100; 202 | ProvisioningStyle = Automatic; 203 | }; 204 | }; 205 | }; 206 | buildConfigurationList = 50ADFF82201F53D600D50D53 /* Build configuration list for PBXProject "Plugin" */; 207 | compatibilityVersion = "Xcode 8.0"; 208 | developmentRegion = en; 209 | hasScannedForEncodings = 0; 210 | knownRegions = ( 211 | en, 212 | ); 213 | mainGroup = 50ADFF7E201F53D600D50D53; 214 | productRefGroup = 50ADFF89201F53D600D50D53 /* Products */; 215 | projectDirPath = ""; 216 | projectRoot = ""; 217 | targets = ( 218 | 50ADFF87201F53D600D50D53 /* Plugin */, 219 | 50ADFF90201F53D600D50D53 /* PluginTests */, 220 | ); 221 | }; 222 | /* End PBXProject section */ 223 | 224 | /* Begin PBXResourcesBuildPhase section */ 225 | 50ADFF86201F53D600D50D53 /* Resources */ = { 226 | isa = PBXResourcesBuildPhase; 227 | buildActionMask = 2147483647; 228 | files = ( 229 | ); 230 | runOnlyForDeploymentPostprocessing = 0; 231 | }; 232 | 50ADFF8F201F53D600D50D53 /* Resources */ = { 233 | isa = PBXResourcesBuildPhase; 234 | buildActionMask = 2147483647; 235 | files = ( 236 | ); 237 | runOnlyForDeploymentPostprocessing = 0; 238 | }; 239 | /* End PBXResourcesBuildPhase section */ 240 | 241 | /* Begin PBXShellScriptBuildPhase section */ 242 | 0596884F929ED6F1DE134961 /* [CP] Check Pods Manifest.lock */ = { 243 | isa = PBXShellScriptBuildPhase; 244 | buildActionMask = 2147483647; 245 | files = ( 246 | ); 247 | inputPaths = ( 248 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 249 | "${PODS_ROOT}/Manifest.lock", 250 | ); 251 | name = "[CP] Check Pods Manifest.lock"; 252 | outputPaths = ( 253 | "$(DERIVED_FILE_DIR)/Pods-PluginTests-checkManifestLockResult.txt", 254 | ); 255 | runOnlyForDeploymentPostprocessing = 0; 256 | shellPath = /bin/sh; 257 | 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"; 258 | showEnvVarsInLog = 0; 259 | }; 260 | AB5B3E54B4E897F32C2279DA /* [CP] Check Pods Manifest.lock */ = { 261 | isa = PBXShellScriptBuildPhase; 262 | buildActionMask = 2147483647; 263 | files = ( 264 | ); 265 | inputPaths = ( 266 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 267 | "${PODS_ROOT}/Manifest.lock", 268 | ); 269 | name = "[CP] Check Pods Manifest.lock"; 270 | outputPaths = ( 271 | "$(DERIVED_FILE_DIR)/Pods-Plugin-checkManifestLockResult.txt", 272 | ); 273 | runOnlyForDeploymentPostprocessing = 0; 274 | shellPath = /bin/sh; 275 | 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"; 276 | showEnvVarsInLog = 0; 277 | }; 278 | CCA81D3B7E26D0D727D24C84 /* [CP] Embed Pods Frameworks */ = { 279 | isa = PBXShellScriptBuildPhase; 280 | buildActionMask = 2147483647; 281 | files = ( 282 | ); 283 | inputPaths = ( 284 | "${PODS_ROOT}/Target Support Files/Pods-PluginTests/Pods-PluginTests-frameworks.sh", 285 | "${BUILT_PRODUCTS_DIR}/Capacitor/Capacitor.framework", 286 | "${BUILT_PRODUCTS_DIR}/CapacitorCordova/Cordova.framework", 287 | ); 288 | name = "[CP] Embed Pods Frameworks"; 289 | outputPaths = ( 290 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Capacitor.framework", 291 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Cordova.framework", 292 | ); 293 | runOnlyForDeploymentPostprocessing = 0; 294 | shellPath = /bin/sh; 295 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-PluginTests/Pods-PluginTests-frameworks.sh\"\n"; 296 | showEnvVarsInLog = 0; 297 | }; 298 | /* End PBXShellScriptBuildPhase section */ 299 | 300 | /* Begin PBXSourcesBuildPhase section */ 301 | 50ADFF83201F53D600D50D53 /* Sources */ = { 302 | isa = PBXSourcesBuildPhase; 303 | buildActionMask = 2147483647; 304 | files = ( 305 | 50E1A94820377CB70090CE1A /* Plugin.swift in Sources */, 306 | 50ADFFA82020EE4F00D50D53 /* Plugin.m in Sources */, 307 | ); 308 | runOnlyForDeploymentPostprocessing = 0; 309 | }; 310 | 50ADFF8D201F53D600D50D53 /* Sources */ = { 311 | isa = PBXSourcesBuildPhase; 312 | buildActionMask = 2147483647; 313 | files = ( 314 | 50ADFF97201F53D600D50D53 /* PluginTests.swift in Sources */, 315 | ); 316 | runOnlyForDeploymentPostprocessing = 0; 317 | }; 318 | /* End PBXSourcesBuildPhase section */ 319 | 320 | /* Begin PBXTargetDependency section */ 321 | 50ADFF94201F53D600D50D53 /* PBXTargetDependency */ = { 322 | isa = PBXTargetDependency; 323 | target = 50ADFF87201F53D600D50D53 /* Plugin */; 324 | targetProxy = 50ADFF93201F53D600D50D53 /* PBXContainerItemProxy */; 325 | }; 326 | /* End PBXTargetDependency section */ 327 | 328 | /* Begin XCBuildConfiguration section */ 329 | 50ADFF9A201F53D600D50D53 /* Debug */ = { 330 | isa = XCBuildConfiguration; 331 | buildSettings = { 332 | ALWAYS_SEARCH_USER_PATHS = NO; 333 | CLANG_ANALYZER_NONNULL = YES; 334 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 335 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 336 | CLANG_CXX_LIBRARY = "libc++"; 337 | CLANG_ENABLE_MODULES = YES; 338 | CLANG_ENABLE_OBJC_ARC = YES; 339 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 340 | CLANG_WARN_BOOL_CONVERSION = YES; 341 | CLANG_WARN_COMMA = YES; 342 | CLANG_WARN_CONSTANT_CONVERSION = YES; 343 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 344 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 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_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 356 | CLANG_WARN_UNREACHABLE_CODE = YES; 357 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 358 | CODE_SIGN_IDENTITY = "iPhone Developer"; 359 | COPY_PHASE_STRIP = NO; 360 | CURRENT_PROJECT_VERSION = 1; 361 | DEBUG_INFORMATION_FORMAT = dwarf; 362 | ENABLE_STRICT_OBJC_MSGSEND = YES; 363 | ENABLE_TESTABILITY = YES; 364 | GCC_C_LANGUAGE_STANDARD = gnu11; 365 | GCC_DYNAMIC_NO_PIC = NO; 366 | GCC_NO_COMMON_BLOCKS = YES; 367 | GCC_OPTIMIZATION_LEVEL = 0; 368 | GCC_PREPROCESSOR_DEFINITIONS = ( 369 | "DEBUG=1", 370 | "$(inherited)", 371 | ); 372 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 373 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 374 | GCC_WARN_UNDECLARED_SELECTOR = YES; 375 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 376 | GCC_WARN_UNUSED_FUNCTION = YES; 377 | GCC_WARN_UNUSED_VARIABLE = YES; 378 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 379 | MTL_ENABLE_DEBUG_INFO = YES; 380 | ONLY_ACTIVE_ARCH = YES; 381 | SDKROOT = iphoneos; 382 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 383 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 384 | VERSIONING_SYSTEM = "apple-generic"; 385 | VERSION_INFO_PREFIX = ""; 386 | }; 387 | name = Debug; 388 | }; 389 | 50ADFF9B201F53D600D50D53 /* Release */ = { 390 | isa = XCBuildConfiguration; 391 | buildSettings = { 392 | ALWAYS_SEARCH_USER_PATHS = NO; 393 | CLANG_ANALYZER_NONNULL = YES; 394 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 395 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 396 | CLANG_CXX_LIBRARY = "libc++"; 397 | CLANG_ENABLE_MODULES = YES; 398 | CLANG_ENABLE_OBJC_ARC = YES; 399 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 400 | CLANG_WARN_BOOL_CONVERSION = YES; 401 | CLANG_WARN_COMMA = YES; 402 | CLANG_WARN_CONSTANT_CONVERSION = YES; 403 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 404 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 405 | CLANG_WARN_EMPTY_BODY = YES; 406 | CLANG_WARN_ENUM_CONVERSION = YES; 407 | CLANG_WARN_INFINITE_RECURSION = YES; 408 | CLANG_WARN_INT_CONVERSION = YES; 409 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 410 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 411 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 412 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 413 | CLANG_WARN_STRICT_PROTOTYPES = YES; 414 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 415 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 416 | CLANG_WARN_UNREACHABLE_CODE = YES; 417 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 418 | CODE_SIGN_IDENTITY = "iPhone Developer"; 419 | COPY_PHASE_STRIP = NO; 420 | CURRENT_PROJECT_VERSION = 1; 421 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 422 | ENABLE_NS_ASSERTIONS = NO; 423 | ENABLE_STRICT_OBJC_MSGSEND = YES; 424 | GCC_C_LANGUAGE_STANDARD = gnu11; 425 | GCC_NO_COMMON_BLOCKS = YES; 426 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 427 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 428 | GCC_WARN_UNDECLARED_SELECTOR = YES; 429 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 430 | GCC_WARN_UNUSED_FUNCTION = YES; 431 | GCC_WARN_UNUSED_VARIABLE = YES; 432 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 433 | MTL_ENABLE_DEBUG_INFO = NO; 434 | SDKROOT = iphoneos; 435 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 436 | VALIDATE_PRODUCT = YES; 437 | VERSIONING_SYSTEM = "apple-generic"; 438 | VERSION_INFO_PREFIX = ""; 439 | }; 440 | name = Release; 441 | }; 442 | 50ADFF9D201F53D600D50D53 /* Debug */ = { 443 | isa = XCBuildConfiguration; 444 | baseConfigurationReference = 5E23F77F099397094342571A /* Pods-Plugin.debug.xcconfig */; 445 | buildSettings = { 446 | CLANG_ENABLE_MODULES = YES; 447 | CODE_SIGN_IDENTITY = ""; 448 | CODE_SIGN_STYLE = Automatic; 449 | DEFINES_MODULE = YES; 450 | DYLIB_COMPATIBILITY_VERSION = 1; 451 | DYLIB_CURRENT_VERSION = 1; 452 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 453 | INFOPLIST_FILE = Plugin/Info.plist; 454 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 455 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 456 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks $(FRAMEWORK_SEARCH_PATHS)\n$(FRAMEWORK_SEARCH_PATHS)\n$(FRAMEWORK_SEARCH_PATHS)"; 457 | ONLY_ACTIVE_ARCH = YES; 458 | PRODUCT_BUNDLE_IDENTIFIER = com.getcapacitor.Plugin; 459 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 460 | SKIP_INSTALL = YES; 461 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 462 | SWIFT_VERSION = 5.0; 463 | TARGETED_DEVICE_FAMILY = "1,2"; 464 | }; 465 | name = Debug; 466 | }; 467 | 50ADFF9E201F53D600D50D53 /* Release */ = { 468 | isa = XCBuildConfiguration; 469 | baseConfigurationReference = 91781294A431A2A7CC6EB714 /* Pods-Plugin.release.xcconfig */; 470 | buildSettings = { 471 | CLANG_ENABLE_MODULES = YES; 472 | CODE_SIGN_IDENTITY = ""; 473 | CODE_SIGN_STYLE = Automatic; 474 | DEFINES_MODULE = YES; 475 | DYLIB_COMPATIBILITY_VERSION = 1; 476 | DYLIB_CURRENT_VERSION = 1; 477 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 478 | INFOPLIST_FILE = Plugin/Info.plist; 479 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 480 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 481 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks $(FRAMEWORK_SEARCH_PATHS)"; 482 | ONLY_ACTIVE_ARCH = NO; 483 | PRODUCT_BUNDLE_IDENTIFIER = com.getcapacitor.Plugin; 484 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 485 | SKIP_INSTALL = YES; 486 | SWIFT_VERSION = 5.0; 487 | TARGETED_DEVICE_FAMILY = "1,2"; 488 | }; 489 | name = Release; 490 | }; 491 | 50ADFFA0201F53D600D50D53 /* Debug */ = { 492 | isa = XCBuildConfiguration; 493 | baseConfigurationReference = 96ED1B6440D6672E406C8D19 /* Pods-PluginTests.debug.xcconfig */; 494 | buildSettings = { 495 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 496 | CODE_SIGN_STYLE = Automatic; 497 | INFOPLIST_FILE = PluginTests/Info.plist; 498 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 499 | PRODUCT_BUNDLE_IDENTIFIER = com.getcapacitor.PluginTests; 500 | PRODUCT_NAME = "$(TARGET_NAME)"; 501 | SWIFT_VERSION = 5.0; 502 | TARGETED_DEVICE_FAMILY = "1,2"; 503 | }; 504 | name = Debug; 505 | }; 506 | 50ADFFA1201F53D600D50D53 /* Release */ = { 507 | isa = XCBuildConfiguration; 508 | baseConfigurationReference = F65BB2953ECE002E1EF3E424 /* Pods-PluginTests.release.xcconfig */; 509 | buildSettings = { 510 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 511 | CODE_SIGN_STYLE = Automatic; 512 | INFOPLIST_FILE = PluginTests/Info.plist; 513 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 514 | PRODUCT_BUNDLE_IDENTIFIER = com.getcapacitor.PluginTests; 515 | PRODUCT_NAME = "$(TARGET_NAME)"; 516 | SWIFT_VERSION = 5.0; 517 | TARGETED_DEVICE_FAMILY = "1,2"; 518 | }; 519 | name = Release; 520 | }; 521 | /* End XCBuildConfiguration section */ 522 | 523 | /* Begin XCConfigurationList section */ 524 | 50ADFF82201F53D600D50D53 /* Build configuration list for PBXProject "Plugin" */ = { 525 | isa = XCConfigurationList; 526 | buildConfigurations = ( 527 | 50ADFF9A201F53D600D50D53 /* Debug */, 528 | 50ADFF9B201F53D600D50D53 /* Release */, 529 | ); 530 | defaultConfigurationIsVisible = 0; 531 | defaultConfigurationName = Release; 532 | }; 533 | 50ADFF9C201F53D600D50D53 /* Build configuration list for PBXNativeTarget "Plugin" */ = { 534 | isa = XCConfigurationList; 535 | buildConfigurations = ( 536 | 50ADFF9D201F53D600D50D53 /* Debug */, 537 | 50ADFF9E201F53D600D50D53 /* Release */, 538 | ); 539 | defaultConfigurationIsVisible = 0; 540 | defaultConfigurationName = Release; 541 | }; 542 | 50ADFF9F201F53D600D50D53 /* Build configuration list for PBXNativeTarget "PluginTests" */ = { 543 | isa = XCConfigurationList; 544 | buildConfigurations = ( 545 | 50ADFFA0201F53D600D50D53 /* Debug */, 546 | 50ADFFA1201F53D600D50D53 /* Release */, 547 | ); 548 | defaultConfigurationIsVisible = 0; 549 | defaultConfigurationName = Release; 550 | }; 551 | /* End XCConfigurationList section */ 552 | }; 553 | rootObject = 50ADFF7F201F53D600D50D53 /* Project object */; 554 | } 555 | -------------------------------------------------------------------------------- /ios/Plugin.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Plugin.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Plugin.xcodeproj/project.xcworkspace/xcuserdata/hinddeep.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hinddeep/ionicCapacitorDarkMode/d8f0e3b86466234000c32597e2d9ba63e329446a/ios/Plugin.xcodeproj/project.xcworkspace/xcuserdata/hinddeep.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /ios/Plugin.xcodeproj/xcuserdata/hinddeep.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Plugin.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 4 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /ios/Plugin.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ios/Plugin.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Plugin.xcworkspace/xcuserdata/hinddeep.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hinddeep/ionicCapacitorDarkMode/d8f0e3b86466234000c32597e2d9ba63e329446a/ios/Plugin.xcworkspace/xcuserdata/hinddeep.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /ios/Plugin/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | NSPrincipalClass 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /ios/Plugin/Plugin.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | //! Project version number for Plugin. 4 | FOUNDATION_EXPORT double PluginVersionNumber; 5 | 6 | //! Project version string for Plugin. 7 | FOUNDATION_EXPORT const unsigned char PluginVersionString[]; 8 | 9 | // In this header, you should import all the public headers of your framework using statements like #import 10 | 11 | -------------------------------------------------------------------------------- /ios/Plugin/Plugin.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | // Define the plugin using the CAP_PLUGIN Macro, and 5 | // each method the plugin supports using the CAP_PLUGIN_METHOD macro. 6 | CAP_PLUGIN(DarkMode, "DarkMode", 7 | CAP_PLUGIN_METHOD(isDarkModeOn, CAPPluginReturnPromise); 8 | ) 9 | -------------------------------------------------------------------------------- /ios/Plugin/Plugin.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import Capacitor 3 | 4 | /** 5 | * Please read the Capacitor iOS Plugin Development Guide 6 | * here: https://capacitor.ionicframework.com/docs/plugins/ios 7 | */ 8 | @objc(DarkMode) 9 | public class DarkMode: CAPPlugin { 10 | 11 | override public func load() { 12 | NotificationCenter.default.addObserver(self, selector: #selector(self.darkModeChanged), name: NSNotification.Name(rawValue: "CAPDarkModeDidChange"), object: nil) 13 | 14 | } 15 | 16 | @objc func darkModeChanged(_ notification: Notification) 17 | { 18 | if let data = notification.userInfo as? [String: Bool] 19 | { 20 | notifyListeners("darkModeStateChanged", data: data, retainUntilConsumed: true) 21 | // for (darkmode, status) in data 22 | // { 23 | // print("\(darkmode) : \(status)") 24 | // } 25 | } 26 | } 27 | 28 | @available(iOS 13.0, *) 29 | @objc func isDarkModeOn(_ call: CAPPluginCall) { 30 | var isDarkModeOn = false 31 | DispatchQueue.main.async { 32 | if self.bridge?.viewController?.traitCollection.userInterfaceStyle.rawValue == 2 33 | { 34 | isDarkModeOn = true 35 | } 36 | call.success([ 37 | "isDarkModeOn": isDarkModeOn 38 | ]) 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /ios/PluginTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /ios/PluginTests/PluginTests.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | import Capacitor 3 | @testable import Plugin 4 | 5 | class PluginTests: XCTestCase { 6 | 7 | override func setUp() { 8 | super.setUp() 9 | // Put setup code here. This method is called before the invocation of each test method in the class. 10 | } 11 | 12 | override func tearDown() { 13 | // Put teardown code here. This method is called after the invocation of each test method in the class. 14 | super.tearDown() 15 | } 16 | 17 | func testEcho() { 18 | // This is an example of a functional test case for a plugin. 19 | // Use XCTAssert and related functions to verify your tests produce the correct results. 20 | 21 | let value = "Hello, World!" 22 | let plugin = MyPlugin() 23 | 24 | let call = CAPPluginCall(callbackId: "test", options: [ 25 | "value": value 26 | ], success: { (result, _) in 27 | let resultValue = result!.data["value"] as? String 28 | XCTAssertEqual(value, resultValue) 29 | }, error: { (_) in 30 | XCTFail("Error shouldn't have been called") 31 | }) 32 | 33 | plugin.echo(call!) 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /ios/Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '12.0' 2 | 3 | def capacitor_pods 4 | # Comment the next line if you're not using Swift and don't want to use dynamic frameworks 5 | use_frameworks! 6 | pod 'Capacitor', :path => '../node_modules/@capacitor/ios' 7 | pod 'CapacitorCordova', :path => '../node_modules/@capacitor/ios' 8 | end 9 | 10 | target 'Plugin' do 11 | capacitor_pods 12 | end 13 | 14 | target 'PluginTests' do 15 | capacitor_pods 16 | end 17 | -------------------------------------------------------------------------------- /ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Capacitor (2.4.0): 3 | - CapacitorCordova 4 | - CapacitorCordova (2.4.0) 5 | 6 | DEPENDENCIES: 7 | - "Capacitor (from `../node_modules/@capacitor/ios`)" 8 | - "CapacitorCordova (from `../node_modules/@capacitor/ios`)" 9 | 10 | EXTERNAL SOURCES: 11 | Capacitor: 12 | :path: "../node_modules/@capacitor/ios" 13 | CapacitorCordova: 14 | :path: "../node_modules/@capacitor/ios" 15 | 16 | SPEC CHECKSUMS: 17 | Capacitor: 0bc38985fc7744924a8e1d72a53b11e93f53adb5 18 | CapacitorCordova: ffb86bd6630220cf94a63306a72f13c653fb43aa 19 | 20 | PODFILE CHECKSUM: e66d6fa04b0daaf06d8498d39637adf77139c716 21 | 22 | COCOAPODS: 1.9.3 23 | -------------------------------------------------------------------------------- /ios/Pods/Local Podspecs/Capacitor.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Capacitor", 3 | "version": "2.4.0", 4 | "summary": "Capacitor for iOS", 5 | "social_media_url": "https://twitter.com/capacitorjs", 6 | "license": "MIT", 7 | "homepage": "https://capacitorjs.com/", 8 | "platforms": { 9 | "ios": "11.0" 10 | }, 11 | "authors": { 12 | "Ionic Team": "hi@ionicframework.com" 13 | }, 14 | "source": { 15 | "git": "https://github.com/ionic-team/capacitor.git", 16 | "tag": "2.4.0" 17 | }, 18 | "source_files": [ 19 | "Capacitor/Capacitor/*.{swift,h,m}", 20 | "Capacitor/Capacitor/Plugins/*.{swift,h,m}", 21 | "Capacitor/Capacitor/Plugins/**/*.{swift,h,m}" 22 | ], 23 | "dependencies": { 24 | "CapacitorCordova": [ 25 | 26 | ] 27 | }, 28 | "swift_versions": "5.0", 29 | "swift_version": "5.0" 30 | } 31 | -------------------------------------------------------------------------------- /ios/Pods/Local Podspecs/CapacitorCordova.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "CapacitorCordova", 3 | "module_name": "Cordova", 4 | "version": "2.4.0", 5 | "summary": "Capacitor Cordova Compatibility Layer", 6 | "homepage": "https://capacitorjs.com", 7 | "license": "MIT", 8 | "authors": { 9 | "Ionic Team": "hi@ionicframework.com" 10 | }, 11 | "source": { 12 | "git": "https://github.com/ionic-team/capacitor", 13 | "tag": "2.4.0" 14 | }, 15 | "platforms": { 16 | "ios": "11.0" 17 | }, 18 | "source_files": "CapacitorCordova/**/*.{h,m}", 19 | "public_header_files": "CapacitorCordova/CapacitorCordova/Classes/Public/*.h", 20 | "requires_arc": true, 21 | "frameworks": "WebKit" 22 | } 23 | -------------------------------------------------------------------------------- /ios/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Capacitor (2.4.0): 3 | - CapacitorCordova 4 | - CapacitorCordova (2.4.0) 5 | 6 | DEPENDENCIES: 7 | - "Capacitor (from `../node_modules/@capacitor/ios`)" 8 | - "CapacitorCordova (from `../node_modules/@capacitor/ios`)" 9 | 10 | EXTERNAL SOURCES: 11 | Capacitor: 12 | :path: "../node_modules/@capacitor/ios" 13 | CapacitorCordova: 14 | :path: "../node_modules/@capacitor/ios" 15 | 16 | SPEC CHECKSUMS: 17 | Capacitor: 0bc38985fc7744924a8e1d72a53b11e93f53adb5 18 | CapacitorCordova: ffb86bd6630220cf94a63306a72f13c653fb43aa 19 | 20 | PODFILE CHECKSUM: e66d6fa04b0daaf06d8498d39637adf77139c716 21 | 22 | COCOAPODS: 1.9.3 23 | -------------------------------------------------------------------------------- /ios/Pods/Pods.xcodeproj/xcuserdata/hinddeep.xcuserdatad/xcschemes/Capacitor.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /ios/Pods/Pods.xcodeproj/xcuserdata/hinddeep.xcuserdatad/xcschemes/CapacitorCordova.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 50 | 51 | 53 | 54 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /ios/Pods/Pods.xcodeproj/xcuserdata/hinddeep.xcuserdatad/xcschemes/Pods-Plugin.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 50 | 51 | 53 | 54 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /ios/Pods/Pods.xcodeproj/xcuserdata/hinddeep.xcuserdatad/xcschemes/Pods-PluginTests.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 50 | 51 | 53 | 54 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /ios/Pods/Pods.xcodeproj/xcuserdata/hinddeep.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Capacitor.xcscheme 8 | 9 | isShown 10 | 11 | orderHint 12 | 0 13 | 14 | CapacitorCordova.xcscheme 15 | 16 | isShown 17 | 18 | orderHint 19 | 1 20 | 21 | Pods-Plugin.xcscheme 22 | 23 | isShown 24 | 25 | orderHint 26 | 2 27 | 28 | Pods-PluginTests.xcscheme 29 | 30 | isShown 31 | 32 | orderHint 33 | 3 34 | 35 | 36 | SuppressBuildableAutocreation 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /ios/Pods/Target Support Files/Capacitor/Capacitor-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 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 2.4.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Pods/Target Support Files/Capacitor/Capacitor-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Capacitor : NSObject 3 | @end 4 | @implementation PodsDummy_Capacitor 5 | @end 6 | -------------------------------------------------------------------------------- /ios/Pods/Target Support Files/Capacitor/Capacitor-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /ios/Pods/Target Support Files/Capacitor/Capacitor-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #import "Capacitor.h" 14 | #import "CAPBridgedPlugin.h" 15 | #import "CAPPlugin.h" 16 | #import "CAPPluginCall.h" 17 | #import "CAPPluginMethod.h" 18 | #import "DefaultPlugins.h" 19 | #import "Keyboard.h" 20 | 21 | FOUNDATION_EXPORT double CapacitorVersionNumber; 22 | FOUNDATION_EXPORT const unsigned char CapacitorVersionString[]; 23 | 24 | -------------------------------------------------------------------------------- /ios/Pods/Target Support Files/Capacitor/Capacitor.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Capacitor 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/CapacitorCordova" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../../node_modules/@capacitor/ios 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 12 | -------------------------------------------------------------------------------- /ios/Pods/Target Support Files/Capacitor/Capacitor.modulemap: -------------------------------------------------------------------------------- 1 | framework module Capacitor { 2 | umbrella header "Capacitor-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /ios/Pods/Target Support Files/Capacitor/Capacitor.release.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Capacitor 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/CapacitorCordova" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../../node_modules/@capacitor/ios 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 12 | -------------------------------------------------------------------------------- /ios/Pods/Target Support Files/CapacitorCordova/CapacitorCordova-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 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 2.4.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Pods/Target Support Files/CapacitorCordova/CapacitorCordova-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_CapacitorCordova : NSObject 3 | @end 4 | @implementation PodsDummy_CapacitorCordova 5 | @end 6 | -------------------------------------------------------------------------------- /ios/Pods/Target Support Files/CapacitorCordova/CapacitorCordova-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /ios/Pods/Target Support Files/CapacitorCordova/CapacitorCordova-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #import "AppDelegate.h" 14 | #import "CDV.h" 15 | #import "CDVAvailability.h" 16 | #import "CDVCommandDelegate.h" 17 | #import "CDVCommandDelegateImpl.h" 18 | #import "CDVConfigParser.h" 19 | #import "CDVInvokedUrlCommand.h" 20 | #import "CDVPlugin.h" 21 | #import "CDVPluginManager.h" 22 | #import "CDVPluginResult.h" 23 | #import "CDVScreenOrientationDelegate.h" 24 | #import "CDVUIWebViewDelegate.h" 25 | #import "CDVURLProtocol.h" 26 | #import "CDVUserAgentUtil.h" 27 | #import "CDVViewController.h" 28 | #import "NSDictionary+CordovaPreferences.h" 29 | 30 | FOUNDATION_EXPORT double CordovaVersionNumber; 31 | FOUNDATION_EXPORT const unsigned char CordovaVersionString[]; 32 | 33 | -------------------------------------------------------------------------------- /ios/Pods/Target Support Files/CapacitorCordova/CapacitorCordova.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/CapacitorCordova 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | OTHER_LDFLAGS = $(inherited) -framework "WebKit" 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../../node_modules/@capacitor/ios 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 11 | -------------------------------------------------------------------------------- /ios/Pods/Target Support Files/CapacitorCordova/CapacitorCordova.modulemap: -------------------------------------------------------------------------------- 1 | framework module Cordova { 2 | umbrella header "CapacitorCordova-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /ios/Pods/Target Support Files/CapacitorCordova/CapacitorCordova.release.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/CapacitorCordova 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | OTHER_LDFLAGS = $(inherited) -framework "WebKit" 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../../node_modules/@capacitor/ios 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 11 | -------------------------------------------------------------------------------- /ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin-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 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | Generated by CocoaPods - https://cocoapods.org 4 | -------------------------------------------------------------------------------- /ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Generated by CocoaPods - https://cocoapods.org 18 | Title 19 | 20 | Type 21 | PSGroupSpecifier 22 | 23 | 24 | StringsTable 25 | Acknowledgements 26 | Title 27 | Acknowledgements 28 | 29 | 30 | -------------------------------------------------------------------------------- /ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_Plugin : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_Plugin 5 | @end 6 | -------------------------------------------------------------------------------- /ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_PluginVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_PluginVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin.debug.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Capacitor" "${PODS_CONFIGURATION_BUILD_DIR}/CapacitorCordova" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Capacitor/Capacitor.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/CapacitorCordova/Cordova.framework/Headers" 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' '@executable_path/../../Frameworks' 5 | OTHER_LDFLAGS = $(inherited) -framework "Capacitor" -framework "Cordova" -framework "WebKit" 6 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 7 | PODS_BUILD_DIR = ${BUILD_DIR} 8 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 9 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 10 | PODS_ROOT = ${SRCROOT}/Pods 11 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 12 | -------------------------------------------------------------------------------- /ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_Plugin { 2 | umbrella header "Pods-Plugin-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin.release.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Capacitor" "${PODS_CONFIGURATION_BUILD_DIR}/CapacitorCordova" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Capacitor/Capacitor.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/CapacitorCordova/Cordova.framework/Headers" 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' '@executable_path/../../Frameworks' 5 | OTHER_LDFLAGS = $(inherited) -framework "Capacitor" -framework "Cordova" -framework "WebKit" 6 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 7 | PODS_BUILD_DIR = ${BUILD_DIR} 8 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 9 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 10 | PODS_ROOT = ${SRCROOT}/Pods 11 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 12 | -------------------------------------------------------------------------------- /ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests-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 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | Generated by CocoaPods - https://cocoapods.org 4 | -------------------------------------------------------------------------------- /ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Generated by CocoaPods - https://cocoapods.org 18 | Title 19 | 20 | Type 21 | PSGroupSpecifier 22 | 23 | 24 | StringsTable 25 | Acknowledgements 26 | Title 27 | Acknowledgements 28 | 29 | 30 | -------------------------------------------------------------------------------- /ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_PluginTests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_PluginTests 5 | @end 6 | -------------------------------------------------------------------------------- /ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | function on_error { 7 | echo "$(realpath -mq "${0}"):$1: error: Unexpected failure" 8 | } 9 | trap 'on_error $LINENO' ERR 10 | 11 | if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then 12 | # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy 13 | # frameworks to, so exit 0 (signalling the script phase was successful). 14 | exit 0 15 | fi 16 | 17 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 18 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 19 | 20 | COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}" 21 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 22 | 23 | # Used as a return value for each invocation of `strip_invalid_archs` function. 24 | STRIP_BINARY_RETVAL=0 25 | 26 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 27 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 28 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 29 | 30 | # Copies and strips a vendored framework 31 | install_framework() 32 | { 33 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 34 | local source="${BUILT_PRODUCTS_DIR}/$1" 35 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 36 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 37 | elif [ -r "$1" ]; then 38 | local source="$1" 39 | fi 40 | 41 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 42 | 43 | if [ -L "${source}" ]; then 44 | echo "Symlinked..." 45 | source="$(readlink "${source}")" 46 | fi 47 | 48 | # Use filter instead of exclude so missing patterns don't throw errors. 49 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 50 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 51 | 52 | local basename 53 | basename="$(basename -s .framework "$1")" 54 | binary="${destination}/${basename}.framework/${basename}" 55 | 56 | if ! [ -r "$binary" ]; then 57 | binary="${destination}/${basename}" 58 | elif [ -L "${binary}" ]; then 59 | echo "Destination binary is symlinked..." 60 | dirname="$(dirname "${binary}")" 61 | binary="${dirname}/$(readlink "${binary}")" 62 | fi 63 | 64 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 65 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 66 | strip_invalid_archs "$binary" 67 | fi 68 | 69 | # Resign the code if required by the build settings to avoid unstable apps 70 | code_sign_if_enabled "${destination}/$(basename "$1")" 71 | 72 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 73 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 74 | local swift_runtime_libs 75 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u) 76 | for lib in $swift_runtime_libs; do 77 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 78 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 79 | code_sign_if_enabled "${destination}/${lib}" 80 | done 81 | fi 82 | } 83 | 84 | # Copies and strips a vendored dSYM 85 | install_dsym() { 86 | local source="$1" 87 | warn_missing_arch=${2:-true} 88 | if [ -r "$source" ]; then 89 | # Copy the dSYM into the targets temp dir. 90 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\"" 91 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}" 92 | 93 | local basename 94 | basename="$(basename -s .dSYM "$source")" 95 | binary_name="$(ls "$source/Contents/Resources/DWARF")" 96 | binary="${DERIVED_FILES_DIR}/${basename}.dSYM/Contents/Resources/DWARF/${binary_name}" 97 | 98 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 99 | if [[ "$(file "$binary")" == *"Mach-O "*"dSYM companion"* ]]; then 100 | strip_invalid_archs "$binary" "$warn_missing_arch" 101 | fi 102 | 103 | if [[ $STRIP_BINARY_RETVAL == 1 ]]; then 104 | # Move the stripped file into its final destination. 105 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\"" 106 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.dSYM" "${DWARF_DSYM_FOLDER_PATH}" 107 | else 108 | # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing. 109 | touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.dSYM" 110 | fi 111 | fi 112 | } 113 | 114 | # Copies the bcsymbolmap files of a vendored framework 115 | install_bcsymbolmap() { 116 | local bcsymbolmap_path="$1" 117 | local destination="${BUILT_PRODUCTS_DIR}" 118 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${bcsymbolmap_path}" "${destination}"" 119 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${bcsymbolmap_path}" "${destination}" 120 | } 121 | 122 | # Signs a framework with the provided identity 123 | code_sign_if_enabled() { 124 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY:-}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 125 | # Use the current code_sign_identity 126 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 127 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'" 128 | 129 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 130 | code_sign_cmd="$code_sign_cmd &" 131 | fi 132 | echo "$code_sign_cmd" 133 | eval "$code_sign_cmd" 134 | fi 135 | } 136 | 137 | # Strip invalid architectures 138 | strip_invalid_archs() { 139 | binary="$1" 140 | warn_missing_arch=${2:-true} 141 | # Get architectures for current target binary 142 | binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" 143 | # Intersect them with the architectures we are building for 144 | intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" 145 | # If there are no archs supported by this binary then warn the user 146 | if [[ -z "$intersected_archs" ]]; then 147 | if [[ "$warn_missing_arch" == "true" ]]; then 148 | echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." 149 | fi 150 | STRIP_BINARY_RETVAL=0 151 | return 152 | fi 153 | stripped="" 154 | for arch in $binary_archs; do 155 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then 156 | # Strip non-valid architectures in-place 157 | lipo -remove "$arch" -output "$binary" "$binary" 158 | stripped="$stripped $arch" 159 | fi 160 | done 161 | if [[ "$stripped" ]]; then 162 | echo "Stripped $binary of architectures:$stripped" 163 | fi 164 | STRIP_BINARY_RETVAL=1 165 | } 166 | 167 | install_artifact() { 168 | artifact="$1" 169 | base="$(basename "$artifact")" 170 | case $base in 171 | *.framework) 172 | install_framework "$artifact" 173 | ;; 174 | *.dSYM) 175 | # Suppress arch warnings since XCFrameworks will include many dSYM files 176 | install_dsym "$artifact" "false" 177 | ;; 178 | *.bcsymbolmap) 179 | install_bcsymbolmap "$artifact" 180 | ;; 181 | *) 182 | echo "error: Unrecognized artifact "$artifact"" 183 | ;; 184 | esac 185 | } 186 | 187 | copy_artifacts() { 188 | file_list="$1" 189 | while read artifact; do 190 | install_artifact "$artifact" 191 | done <$file_list 192 | } 193 | 194 | ARTIFACT_LIST_FILE="${BUILT_PRODUCTS_DIR}/cocoapods-artifacts-${CONFIGURATION}.txt" 195 | if [ -r "${ARTIFACT_LIST_FILE}" ]; then 196 | copy_artifacts "${ARTIFACT_LIST_FILE}" 197 | fi 198 | 199 | if [[ "$CONFIGURATION" == "Debug" ]]; then 200 | install_framework "${BUILT_PRODUCTS_DIR}/Capacitor/Capacitor.framework" 201 | install_framework "${BUILT_PRODUCTS_DIR}/CapacitorCordova/Cordova.framework" 202 | fi 203 | if [[ "$CONFIGURATION" == "Release" ]]; then 204 | install_framework "${BUILT_PRODUCTS_DIR}/Capacitor/Capacitor.framework" 205 | install_framework "${BUILT_PRODUCTS_DIR}/CapacitorCordova/Cordova.framework" 206 | fi 207 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 208 | wait 209 | fi 210 | -------------------------------------------------------------------------------- /ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_PluginTestsVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_PluginTestsVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Capacitor" "${PODS_CONFIGURATION_BUILD_DIR}/CapacitorCordova" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Capacitor/Capacitor.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/CapacitorCordova/Cordova.framework/Headers" 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 6 | OTHER_LDFLAGS = $(inherited) -framework "Capacitor" -framework "Cordova" -framework "WebKit" 7 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 13 | -------------------------------------------------------------------------------- /ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_PluginTests { 2 | umbrella header "Pods-PluginTests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Capacitor" "${PODS_CONFIGURATION_BUILD_DIR}/CapacitorCordova" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Capacitor/Capacitor.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/CapacitorCordova/Cordova.framework/Headers" 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 6 | OTHER_LDFLAGS = $(inherited) -framework "Capacitor" -framework "Cordova" -framework "WebKit" 7 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 13 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "capacitor-dark-mode", 3 | "version": "2.0.2", 4 | "description": "Handle dark mode changes on android and iOS", 5 | "main": "dist/plugin.js", 6 | "module": "dist/esm/index.js", 7 | "types": "dist/esm/index.d.ts", 8 | "scripts": { 9 | "lint": "npm run prettier -- --check && npm run swiftlint -- lint", 10 | "prettier": "prettier \"**/*.{css,html,ts,js,java}\"", 11 | "swiftlint": "node-swiftlint", 12 | "build": "npm run clean && tsc && rollup -c rollup.config.js", 13 | "clean": "rimraf ./dist", 14 | "watch": "tsc --watch", 15 | "prepublishOnly": "npm run build" 16 | }, 17 | "author": "Hinddeep Shailesh Purohit", 18 | "license": "MIT", 19 | "devDependencies": { 20 | "@capacitor/android": "^3.0.0", 21 | "@capacitor/core": "^3.0.0", 22 | "@capacitor/ios": "^3.0.0", 23 | "@ionic/prettier-config": "^1.0.1", 24 | "@ionic/swiftlint-config": "^1.1.2", 25 | "@rollup/plugin-node-resolve": "^8.4.0", 26 | "prettier": "^2.6.2", 27 | "prettier-plugin-java": "^1.6.2", 28 | "rimraf": "^3.0.2", 29 | "rollup": "^2.75.6", 30 | "swiftlint": "^1.0.1", 31 | "typescript": "~3.8.3" 32 | }, 33 | "peerDependencies": { 34 | "@capacitor/core": "^3.0.0" 35 | }, 36 | "files": [ 37 | "dist/", 38 | "ios/", 39 | "android/", 40 | "CapacitorDarkMode.podspec" 41 | ], 42 | "keywords": [ 43 | "capacitor", 44 | "plugin", 45 | "native" 46 | ], 47 | "capacitor": { 48 | "ios": { 49 | "src": "ios" 50 | }, 51 | "android": { 52 | "src": "android" 53 | } 54 | }, 55 | "prettier": "@ionic/prettier-config", 56 | "swiftlint": "@ionic/swiftlint-config", 57 | "repository": { 58 | "type": "git", 59 | "url": "https://github.com/hinddeep/ionicCapacitorDarkMode" 60 | }, 61 | "bugs": { 62 | "url": "https://github.com/hinddeep/ionicCapacitorDarkMode/issues" 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /rollup.config.js: -------------------------------------------------------------------------------- 1 | import nodeResolve from '@rollup/plugin-node-resolve'; 2 | 3 | export default { 4 | input: 'dist/esm/index.js', 5 | output: { 6 | file: 'dist/plugin.js', 7 | format: 'iife', 8 | name: 'capacitorPlugin', // TODO: change this 9 | globals: { 10 | '@capacitor/core': 'capacitorExports', 11 | }, 12 | sourcemap: true, 13 | }, 14 | plugins: [ 15 | nodeResolve({ 16 | // allowlist of dependencies to bundle in 17 | // @see https://github.com/rollup/plugins/tree/master/packages/node-resolve#resolveonly 18 | resolveOnly: ['lodash'], 19 | }), 20 | ], 21 | }; 22 | -------------------------------------------------------------------------------- /src/definitions.ts: -------------------------------------------------------------------------------- 1 | import { PluginListenerHandle } from "@capacitor/core"; 2 | 3 | export interface DarkModePlugin { 4 | isDarkModeOn(): Promise; 5 | addListener( 6 | eventName: 'darkModeStateChanged', 7 | listenerFunc: (state: any) => void, 8 | ): PluginListenerHandle; 9 | registerDarkModeChangeListener():void; 10 | } 11 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './definitions'; 2 | export * from './web'; 3 | -------------------------------------------------------------------------------- /src/web.ts: -------------------------------------------------------------------------------- 1 | import { WebPlugin } from '@capacitor/core'; 2 | import { DarkModePlugin } from './definitions'; 3 | 4 | export class DarkModeWeb extends WebPlugin implements DarkModePlugin { 5 | darkMode = {"isDarkModeOn":false} 6 | 7 | constructor() { 8 | super({ 9 | name: 'DarkMode', 10 | platforms: ['web','android','ios'], 11 | }); 12 | } 13 | 14 | isDarkModeOn(): Promise { 15 | var darkMode = {"isDarkModeOn":false} 16 | if(window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) 17 | { 18 | darkMode.isDarkModeOn = true 19 | } 20 | return Promise.resolve(darkMode); 21 | } 22 | 23 | registerDarkModeChangeListener():void 24 | { 25 | var darkMode = {"isDarkModeOn":false} 26 | window.matchMedia("(prefers-color-scheme: dark)").addListener((status) => { 27 | if(status.matches) 28 | { 29 | darkMode = {"isDarkModeOn":true} 30 | } 31 | else 32 | { 33 | darkMode = {"isDarkModeOn":false} 34 | } 35 | this.notifyListeners("darkModeStateChanged",darkMode) 36 | }); 37 | } 38 | } 39 | 40 | const DarkMode = new DarkModeWeb(); 41 | 42 | export { DarkMode }; 43 | 44 | import { registerWebPlugin } from '@capacitor/core'; 45 | registerWebPlugin(DarkMode); 46 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "allowUnreachableCode": false, 4 | "declaration": true, 5 | "esModuleInterop": true, 6 | "lib": [ 7 | "dom", 8 | "es2015" 9 | ], 10 | "module": "es2015", 11 | "moduleResolution": "node", 12 | "noFallthroughCasesInSwitch": true, 13 | "noUnusedLocals": true, 14 | "noUnusedParameters": true, 15 | "outDir": "dist/esm", 16 | "pretty": true, 17 | "sourceMap": true, 18 | "strict": true, 19 | "target": "es2015" 20 | }, 21 | "files": [ 22 | "src/index.ts" 23 | ] 24 | } 25 | --------------------------------------------------------------------------------