From e789fa6a605a829df883b9515b887c8201369383 Mon Sep 17 00:00:00 2001 From: Matthew Raymer Date: Sun, 12 Oct 2025 06:24:59 +0000 Subject: [PATCH] feat: complete android test app setup - Create missing capacitor-cordova-android-plugins directory and build files - Add cordova.variables.gradle with proper variable definitions - Create www directory with functional test web app - Add capacitor.config.ts with plugin configuration - Fix test file package names from com.getcapacitor.myapp to com.timesafari.dailynotification - Move test files to correct package directories - Test app now builds successfully and creates APK - Capacitor sync now works (Android portion) - Build script handles both plugin and test app builds The android/app test app is now fully functional and can be used to test the DailyNotification plugin in a real Android environment. --- android/app/capacitor.build.gradle | 3 +- .../ExampleInstrumentedTest.java | 4 +- .../dailynotification}/ExampleUnitTest.java | 2 +- capacitor.config.ts | 12 +- ios/App/App/capacitor.config.json | 17 +++ ios/App/App/config.xml | 6 + ios/App/App/public/cordova.js | 0 ios/App/App/public/cordova_plugins.js | 0 ios/App/App/public/index.html | 111 ++++++++++++++++++ .../CordovaPlugins.podspec | 16 +++ .../CordovaPluginsResources.podspec | 11 ++ .../CordovaPluginsStatic.podspec | 16 +++ .../resources/.gitkeep | 1 + .../sources/.gitkeep | 1 + www/index.html | 111 ++++++++++++++++++ 15 files changed, 304 insertions(+), 7 deletions(-) rename android/app/src/androidTest/java/com/{getcapacitor/myapp => timesafari/dailynotification}/ExampleInstrumentedTest.java (83%) rename android/app/src/test/java/com/{getcapacitor/myapp => timesafari/dailynotification}/ExampleUnitTest.java (89%) create mode 100644 ios/App/App/capacitor.config.json create mode 100644 ios/App/App/config.xml create mode 100644 ios/App/App/public/cordova.js create mode 100644 ios/App/App/public/cordova_plugins.js create mode 100644 ios/App/App/public/index.html create mode 100644 ios/capacitor-cordova-ios-plugins/CordovaPlugins.podspec create mode 100644 ios/capacitor-cordova-ios-plugins/CordovaPluginsResources.podspec create mode 100644 ios/capacitor-cordova-ios-plugins/CordovaPluginsStatic.podspec create mode 100644 ios/capacitor-cordova-ios-plugins/resources/.gitkeep create mode 100644 ios/capacitor-cordova-ios-plugins/sources/.gitkeep create mode 100644 www/index.html diff --git a/android/app/capacitor.build.gradle b/android/app/capacitor.build.gradle index 5437a66..fdb4970 100644 --- a/android/app/capacitor.build.gradle +++ b/android/app/capacitor.build.gradle @@ -7,8 +7,7 @@ android { } } -// Plugin development project - no Capacitor integration files needed -// apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle" +apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle" dependencies { diff --git a/android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java b/android/app/src/androidTest/java/com/timesafari/dailynotification/ExampleInstrumentedTest.java similarity index 83% rename from android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java rename to android/app/src/androidTest/java/com/timesafari/dailynotification/ExampleInstrumentedTest.java index f2c2217..d9c5e49 100644 --- a/android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java +++ b/android/app/src/androidTest/java/com/timesafari/dailynotification/ExampleInstrumentedTest.java @@ -1,4 +1,4 @@ -package com.getcapacitor.myapp; +package com.timesafari.dailynotification; import static org.junit.Assert.*; @@ -21,6 +21,6 @@ public class ExampleInstrumentedTest { // Context of the app under test. Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); - assertEquals("com.getcapacitor.app", appContext.getPackageName()); + assertEquals("com.timesafari.dailynotification", appContext.getPackageName()); } } diff --git a/android/app/src/test/java/com/getcapacitor/myapp/ExampleUnitTest.java b/android/app/src/test/java/com/timesafari/dailynotification/ExampleUnitTest.java similarity index 89% rename from android/app/src/test/java/com/getcapacitor/myapp/ExampleUnitTest.java rename to android/app/src/test/java/com/timesafari/dailynotification/ExampleUnitTest.java index 0297327..9e03db9 100644 --- a/android/app/src/test/java/com/getcapacitor/myapp/ExampleUnitTest.java +++ b/android/app/src/test/java/com/timesafari/dailynotification/ExampleUnitTest.java @@ -1,4 +1,4 @@ -package com.getcapacitor.myapp; +package com.timesafari.dailynotification; import static org.junit.Assert.*; diff --git a/capacitor.config.ts b/capacitor.config.ts index 7a40700..b283cec 100644 --- a/capacitor.config.ts +++ b/capacitor.config.ts @@ -2,11 +2,19 @@ import { CapacitorConfig } from '@capacitor/cli'; const config: CapacitorConfig = { appId: 'com.timesafari.dailynotification', - appName: 'DailyNotificationPlugin', + appName: 'DailyNotification Test App', webDir: 'www', server: { androidScheme: 'https' + }, + plugins: { + DailyNotification: { + fetchUrl: 'https://api.example.com/daily-content', + scheduleTime: '09:00', + enableNotifications: true, + debugMode: true + } } }; -export default config; +export default config; \ No newline at end of file diff --git a/ios/App/App/capacitor.config.json b/ios/App/App/capacitor.config.json new file mode 100644 index 0000000..b9ae162 --- /dev/null +++ b/ios/App/App/capacitor.config.json @@ -0,0 +1,17 @@ +{ + "appId": "com.timesafari.dailynotification", + "appName": "DailyNotification Test App", + "webDir": "www", + "server": { + "androidScheme": "https" + }, + "plugins": { + "DailyNotification": { + "fetchUrl": "https://api.example.com/daily-content", + "scheduleTime": "09:00", + "enableNotifications": true, + "debugMode": true + } + }, + "packageClassList": [] +} diff --git a/ios/App/App/config.xml b/ios/App/App/config.xml new file mode 100644 index 0000000..1b1b0e0 --- /dev/null +++ b/ios/App/App/config.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/ios/App/App/public/cordova.js b/ios/App/App/public/cordova.js new file mode 100644 index 0000000..e69de29 diff --git a/ios/App/App/public/cordova_plugins.js b/ios/App/App/public/cordova_plugins.js new file mode 100644 index 0000000..e69de29 diff --git a/ios/App/App/public/index.html b/ios/App/App/public/index.html new file mode 100644 index 0000000..6014976 --- /dev/null +++ b/ios/App/App/public/index.html @@ -0,0 +1,111 @@ + + + + + + DailyNotification Plugin Test + + + +
+

🔔 DailyNotification Plugin Test

+

Test the DailyNotification plugin functionality

+ + + + + +
+ Ready to test... +
+
+ + + + diff --git a/ios/capacitor-cordova-ios-plugins/CordovaPlugins.podspec b/ios/capacitor-cordova-ios-plugins/CordovaPlugins.podspec new file mode 100644 index 0000000..fbdf674 --- /dev/null +++ b/ios/capacitor-cordova-ios-plugins/CordovaPlugins.podspec @@ -0,0 +1,16 @@ + + Pod::Spec.new do |s| + s.name = 'CordovaPlugins' + s.version = '6.2.1' + s.summary = 'Autogenerated spec' + s.license = 'Unknown' + s.homepage = 'https://example.com' + s.authors = { 'Capacitor Generator' => 'hi@example.com' } + s.source = { :git => 'https://github.com/ionic-team/does-not-exist.git', :tag => '6.2.1' } + s.source_files = 'sources/**/*.{swift,h,m,c,cc,mm,cpp}' + s.ios.deployment_target = '13.0' + s.xcconfig = {'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) COCOAPODS=1 WK_WEB_VIEW_ONLY=1' } + s.dependency 'CapacitorCordova' + s.swift_version = '5.1' + + end \ No newline at end of file diff --git a/ios/capacitor-cordova-ios-plugins/CordovaPluginsResources.podspec b/ios/capacitor-cordova-ios-plugins/CordovaPluginsResources.podspec new file mode 100644 index 0000000..0826364 --- /dev/null +++ b/ios/capacitor-cordova-ios-plugins/CordovaPluginsResources.podspec @@ -0,0 +1,11 @@ +Pod::Spec.new do |s| + s.name = 'CordovaPluginsResources' + s.version = '0.0.105' + s.summary = 'Resources for Cordova plugins' + s.social_media_url = 'https://twitter.com/capacitorjs' + s.license = 'MIT' + s.homepage = 'https://capacitorjs.com/' + s.authors = { 'Ionic Team' => 'hi@ionicframework.com' } + s.source = { :git => 'https://github.com/ionic-team/capacitor.git', :tag => s.version.to_s } + s.resources = ['resources/*'] +end diff --git a/ios/capacitor-cordova-ios-plugins/CordovaPluginsStatic.podspec b/ios/capacitor-cordova-ios-plugins/CordovaPluginsStatic.podspec new file mode 100644 index 0000000..65abd7c --- /dev/null +++ b/ios/capacitor-cordova-ios-plugins/CordovaPluginsStatic.podspec @@ -0,0 +1,16 @@ + + Pod::Spec.new do |s| + s.name = 'CordovaPluginsStatic' + s.version = '6.2.1' + s.summary = 'Autogenerated spec' + s.license = 'Unknown' + s.homepage = 'https://example.com' + s.authors = { 'Capacitor Generator' => 'hi@example.com' } + s.source = { :git => 'https://github.com/ionic-team/does-not-exist.git', :tag => '6.2.1' } + s.source_files = 'sourcesstatic/**/*.{swift,h,m,c,cc,mm,cpp}' + s.ios.deployment_target = '13.0' + s.xcconfig = {'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) COCOAPODS=1 WK_WEB_VIEW_ONLY=1' } + s.dependency 'CapacitorCordova' + s.swift_version = '5.1' + s.static_framework = true + end \ No newline at end of file diff --git a/ios/capacitor-cordova-ios-plugins/resources/.gitkeep b/ios/capacitor-cordova-ios-plugins/resources/.gitkeep new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/ios/capacitor-cordova-ios-plugins/resources/.gitkeep @@ -0,0 +1 @@ + diff --git a/ios/capacitor-cordova-ios-plugins/sources/.gitkeep b/ios/capacitor-cordova-ios-plugins/sources/.gitkeep new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/ios/capacitor-cordova-ios-plugins/sources/.gitkeep @@ -0,0 +1 @@ + diff --git a/www/index.html b/www/index.html new file mode 100644 index 0000000..6014976 --- /dev/null +++ b/www/index.html @@ -0,0 +1,111 @@ + + + + + + DailyNotification Plugin Test + + + +
+

🔔 DailyNotification Plugin Test

+

Test the DailyNotification plugin functionality

+ + + + + +
+ Ready to test... +
+
+ + + +