From b44fb7282bf97f05e89927233ae14438b835e24d Mon Sep 17 00:00:00 2001 From: Son Nguyen Date: Sun, 1 Sep 2024 10:23:52 -0400 Subject: [PATCH] Fix: Fixed responsive design styling errors (#1) --- .github/README.md | 6 +- .../.gitignore | 0 .../.idea/.gitignore | 0 .../.idea/RecipeGenie.iml | 0 .../.idea/misc.xml | 0 .../.idea/modules.xml | 0 .../.idea/swift/AboutViewController.swift | 0 .../.idea/swift/ChatbotViewController.swift | 0 .../.idea/swift/FavoritesManager.swift | 0 .../.idea/swift/FeaturesViewController.swift | 0 .../.idea/swift/FlavorPairingGuide.swift | 0 .../.idea/swift/MainActivity.swift | 0 .../swift/RandomRecipesViewController.swift | 0 .../swift/RecipeGenieViewController.swift | 0 .../swift/RecipeListViewController.swift | 0 .../.idea/swift/SearchViewController.swift | 0 .../.idea/swift/SettingsViewController.swift | 0 .../.idea/vcs.xml | 0 {RecipeGenie => RecipeGenie-Mobile}/README.md | 0 .../app/android/CookingConversionActivity.kt | 0 .../app/android/CookingTipsActivity.kt | 0 .../app/android/FlavorPairingActivity.kt | 0 .../app/android/MainActivity.java | 0 .../app/android/NutritionalTipsActivity.kt | 0 .../app/android/RecipeDetailActivity.java | 0 .../app/android/RecipeManager.java | 0 .../android/SeasonalIngredientsActivity.kt | 0 .../app/ios/AboutViewController.swift | 0 .../app/ios/ChatbotViewController.swift | 0 .../app/ios/FavoritesManager.swift | 0 .../app/ios/FeaturesViewController.swift | 0 .../app/ios/FlavorPairingGuide.swift | 0 .../app/ios/MainActivity.swift | 0 .../app/ios/RandomRecipesViewController.swift | 0 .../app/ios/RecipeGenieViewController.swift | 0 .../app/ios/RecipeListViewController.swift | 0 .../app/ios/SearchViewController.swift | 0 .../app/ios/SettingsViewController.swift | 0 .../config.xml | 0 .../package-lock.json | 0 .../package.json | 0 .../www/about.html | 0 .../www/css/index.css | 0 .../www/favicon.ico | Bin .../www/icons/AndroidAppIcon.png | Bin .../www/icons/iOSAppIcon.png | Bin .../www/img/logo.png | Bin .../www/index.html | 0 .../www/js/index.js | 0 .../www/recipegenie-logo.png | Bin .../www/script.js | 64 +- .../www/style.css | 0 .../www/swift/AboutViewController.swift | 0 .../www/swift/ChatbotViewController.swift | 0 .../www/swift/FavoritesManager.swift | 0 .../www/swift/FeaturesViewController.swift | 0 .../www/swift/FlavorPairingGuide.swift | 0 .../www/swift/MainActivity.swift | 0 .../swift/RandomRecipesViewController.swift | 0 .../www/swift/RecipeGenieViewController.swift | 0 .../www/swift/RecipeListViewController.swift | 0 .../www/swift/SearchViewController.swift | 0 .../www/swift/SettingsViewController.swift | 0 .../CONTRIBUTING.md | 37 - .../cordova-plugin-geolocation/LICENSE | 202 ----- .../plugins/cordova-plugin-geolocation/NOTICE | 5 - .../cordova-plugin-geolocation/README.md | 778 ------------------ .../RELEASENOTES.md | 254 ------ .../cordova-plugin-geolocation/package.json | 42 - .../cordova-plugin-geolocation/plugin.xml | 96 --- .../src/android/Geolocation.java | 132 --- .../src/ios/CDVLocation.h | 70 -- .../src/ios/CDVLocation.m | 379 --------- .../www/Coordinates.js | 69 -- .../www/Position.js | 41 - .../www/PositionError.js | 38 - .../www/android/geolocation.js | 79 -- .../www/geolocation.js | 216 ----- RecipeGenie/plugins/fetch.json | 10 - 79 files changed, 35 insertions(+), 2483 deletions(-) rename {RecipeGenie => RecipeGenie-Mobile}/.gitignore (100%) rename {RecipeGenie => RecipeGenie-Mobile}/.idea/.gitignore (100%) rename {RecipeGenie => RecipeGenie-Mobile}/.idea/RecipeGenie.iml (100%) rename {RecipeGenie => RecipeGenie-Mobile}/.idea/misc.xml (100%) rename {RecipeGenie => RecipeGenie-Mobile}/.idea/modules.xml (100%) rename {RecipeGenie => RecipeGenie-Mobile}/.idea/swift/AboutViewController.swift (100%) rename {RecipeGenie => RecipeGenie-Mobile}/.idea/swift/ChatbotViewController.swift (100%) rename {RecipeGenie => RecipeGenie-Mobile}/.idea/swift/FavoritesManager.swift (100%) rename {RecipeGenie => RecipeGenie-Mobile}/.idea/swift/FeaturesViewController.swift (100%) rename {RecipeGenie => RecipeGenie-Mobile}/.idea/swift/FlavorPairingGuide.swift (100%) rename {RecipeGenie => RecipeGenie-Mobile}/.idea/swift/MainActivity.swift (100%) rename {RecipeGenie => RecipeGenie-Mobile}/.idea/swift/RandomRecipesViewController.swift (100%) rename {RecipeGenie => RecipeGenie-Mobile}/.idea/swift/RecipeGenieViewController.swift (100%) rename {RecipeGenie => RecipeGenie-Mobile}/.idea/swift/RecipeListViewController.swift (100%) rename {RecipeGenie => RecipeGenie-Mobile}/.idea/swift/SearchViewController.swift (100%) rename {RecipeGenie => RecipeGenie-Mobile}/.idea/swift/SettingsViewController.swift (100%) rename {RecipeGenie => RecipeGenie-Mobile}/.idea/vcs.xml (100%) rename {RecipeGenie => RecipeGenie-Mobile}/README.md (100%) rename {RecipeGenie => RecipeGenie-Mobile}/app/android/CookingConversionActivity.kt (100%) rename {RecipeGenie => RecipeGenie-Mobile}/app/android/CookingTipsActivity.kt (100%) rename {RecipeGenie => RecipeGenie-Mobile}/app/android/FlavorPairingActivity.kt (100%) rename {RecipeGenie => RecipeGenie-Mobile}/app/android/MainActivity.java (100%) rename {RecipeGenie => RecipeGenie-Mobile}/app/android/NutritionalTipsActivity.kt (100%) rename {RecipeGenie => RecipeGenie-Mobile}/app/android/RecipeDetailActivity.java (100%) rename {RecipeGenie => RecipeGenie-Mobile}/app/android/RecipeManager.java (100%) rename {RecipeGenie => RecipeGenie-Mobile}/app/android/SeasonalIngredientsActivity.kt (100%) rename {RecipeGenie => RecipeGenie-Mobile}/app/ios/AboutViewController.swift (100%) rename {RecipeGenie => RecipeGenie-Mobile}/app/ios/ChatbotViewController.swift (100%) rename {RecipeGenie => RecipeGenie-Mobile}/app/ios/FavoritesManager.swift (100%) rename {RecipeGenie => RecipeGenie-Mobile}/app/ios/FeaturesViewController.swift (100%) rename {RecipeGenie => RecipeGenie-Mobile}/app/ios/FlavorPairingGuide.swift (100%) rename {RecipeGenie => RecipeGenie-Mobile}/app/ios/MainActivity.swift (100%) rename {RecipeGenie => RecipeGenie-Mobile}/app/ios/RandomRecipesViewController.swift (100%) rename {RecipeGenie => RecipeGenie-Mobile}/app/ios/RecipeGenieViewController.swift (100%) rename {RecipeGenie => RecipeGenie-Mobile}/app/ios/RecipeListViewController.swift (100%) rename {RecipeGenie => RecipeGenie-Mobile}/app/ios/SearchViewController.swift (100%) rename {RecipeGenie => RecipeGenie-Mobile}/app/ios/SettingsViewController.swift (100%) rename {RecipeGenie => RecipeGenie-Mobile}/config.xml (100%) rename {RecipeGenie => RecipeGenie-Mobile}/package-lock.json (100%) rename {RecipeGenie => RecipeGenie-Mobile}/package.json (100%) rename {RecipeGenie => RecipeGenie-Mobile}/www/about.html (100%) rename {RecipeGenie => RecipeGenie-Mobile}/www/css/index.css (100%) rename {RecipeGenie => RecipeGenie-Mobile}/www/favicon.ico (100%) rename {RecipeGenie => RecipeGenie-Mobile}/www/icons/AndroidAppIcon.png (100%) rename {RecipeGenie => RecipeGenie-Mobile}/www/icons/iOSAppIcon.png (100%) rename {RecipeGenie => RecipeGenie-Mobile}/www/img/logo.png (100%) rename {RecipeGenie => RecipeGenie-Mobile}/www/index.html (100%) rename {RecipeGenie => RecipeGenie-Mobile}/www/js/index.js (100%) rename {RecipeGenie => RecipeGenie-Mobile}/www/recipegenie-logo.png (100%) rename {RecipeGenie => RecipeGenie-Mobile}/www/script.js (84%) rename {RecipeGenie => RecipeGenie-Mobile}/www/style.css (100%) rename {RecipeGenie => RecipeGenie-Mobile}/www/swift/AboutViewController.swift (100%) rename {RecipeGenie => RecipeGenie-Mobile}/www/swift/ChatbotViewController.swift (100%) rename {RecipeGenie => RecipeGenie-Mobile}/www/swift/FavoritesManager.swift (100%) rename {RecipeGenie => RecipeGenie-Mobile}/www/swift/FeaturesViewController.swift (100%) rename {RecipeGenie => RecipeGenie-Mobile}/www/swift/FlavorPairingGuide.swift (100%) rename {RecipeGenie => RecipeGenie-Mobile}/www/swift/MainActivity.swift (100%) rename {RecipeGenie => RecipeGenie-Mobile}/www/swift/RandomRecipesViewController.swift (100%) rename {RecipeGenie => RecipeGenie-Mobile}/www/swift/RecipeGenieViewController.swift (100%) rename {RecipeGenie => RecipeGenie-Mobile}/www/swift/RecipeListViewController.swift (100%) rename {RecipeGenie => RecipeGenie-Mobile}/www/swift/SearchViewController.swift (100%) rename {RecipeGenie => RecipeGenie-Mobile}/www/swift/SettingsViewController.swift (100%) delete mode 100644 RecipeGenie/plugins/cordova-plugin-geolocation/CONTRIBUTING.md delete mode 100644 RecipeGenie/plugins/cordova-plugin-geolocation/LICENSE delete mode 100644 RecipeGenie/plugins/cordova-plugin-geolocation/NOTICE delete mode 100644 RecipeGenie/plugins/cordova-plugin-geolocation/README.md delete mode 100644 RecipeGenie/plugins/cordova-plugin-geolocation/RELEASENOTES.md delete mode 100644 RecipeGenie/plugins/cordova-plugin-geolocation/package.json delete mode 100644 RecipeGenie/plugins/cordova-plugin-geolocation/plugin.xml delete mode 100644 RecipeGenie/plugins/cordova-plugin-geolocation/src/android/Geolocation.java delete mode 100644 RecipeGenie/plugins/cordova-plugin-geolocation/src/ios/CDVLocation.h delete mode 100644 RecipeGenie/plugins/cordova-plugin-geolocation/src/ios/CDVLocation.m delete mode 100644 RecipeGenie/plugins/cordova-plugin-geolocation/www/Coordinates.js delete mode 100644 RecipeGenie/plugins/cordova-plugin-geolocation/www/Position.js delete mode 100644 RecipeGenie/plugins/cordova-plugin-geolocation/www/PositionError.js delete mode 100644 RecipeGenie/plugins/cordova-plugin-geolocation/www/android/geolocation.js delete mode 100644 RecipeGenie/plugins/cordova-plugin-geolocation/www/geolocation.js delete mode 100644 RecipeGenie/plugins/fetch.json diff --git a/.github/README.md b/.github/README.md index e4d0811..522c62c 100644 --- a/.github/README.md +++ b/.github/README.md @@ -33,7 +33,7 @@ To get started with **RecipeGenie**: ``` 2. Navigate to the project directory: ```bash - cd RecipeGenie + cd RecipeGenie-Mobile ``` 3. Simply open the `index.html` file in your preferred web browser. @@ -72,7 +72,7 @@ To get started with the mobile app: 4. For the Android app, open the project in Android Studio and then run the following commands (with an AVD up and running): ```bash -cd RecipeGenie +cd RecipeGenie-Mobile-Mobile cordova build android @@ -81,7 +81,7 @@ cordova emulate android Note that if you have changed any part of code for the iOS app, you might have to run the following code and then re-run the app for the changes to take effect: ```bash -cd RecipeGenie +cd RecipeGenie-Mobile-Mobile cordova platform rm ios diff --git a/RecipeGenie/.gitignore b/RecipeGenie-Mobile/.gitignore similarity index 100% rename from RecipeGenie/.gitignore rename to RecipeGenie-Mobile/.gitignore diff --git a/RecipeGenie/.idea/.gitignore b/RecipeGenie-Mobile/.idea/.gitignore similarity index 100% rename from RecipeGenie/.idea/.gitignore rename to RecipeGenie-Mobile/.idea/.gitignore diff --git a/RecipeGenie/.idea/RecipeGenie.iml b/RecipeGenie-Mobile/.idea/RecipeGenie.iml similarity index 100% rename from RecipeGenie/.idea/RecipeGenie.iml rename to RecipeGenie-Mobile/.idea/RecipeGenie.iml diff --git a/RecipeGenie/.idea/misc.xml b/RecipeGenie-Mobile/.idea/misc.xml similarity index 100% rename from RecipeGenie/.idea/misc.xml rename to RecipeGenie-Mobile/.idea/misc.xml diff --git a/RecipeGenie/.idea/modules.xml b/RecipeGenie-Mobile/.idea/modules.xml similarity index 100% rename from RecipeGenie/.idea/modules.xml rename to RecipeGenie-Mobile/.idea/modules.xml diff --git a/RecipeGenie/.idea/swift/AboutViewController.swift b/RecipeGenie-Mobile/.idea/swift/AboutViewController.swift similarity index 100% rename from RecipeGenie/.idea/swift/AboutViewController.swift rename to RecipeGenie-Mobile/.idea/swift/AboutViewController.swift diff --git a/RecipeGenie/.idea/swift/ChatbotViewController.swift b/RecipeGenie-Mobile/.idea/swift/ChatbotViewController.swift similarity index 100% rename from RecipeGenie/.idea/swift/ChatbotViewController.swift rename to RecipeGenie-Mobile/.idea/swift/ChatbotViewController.swift diff --git a/RecipeGenie/.idea/swift/FavoritesManager.swift b/RecipeGenie-Mobile/.idea/swift/FavoritesManager.swift similarity index 100% rename from RecipeGenie/.idea/swift/FavoritesManager.swift rename to RecipeGenie-Mobile/.idea/swift/FavoritesManager.swift diff --git a/RecipeGenie/.idea/swift/FeaturesViewController.swift b/RecipeGenie-Mobile/.idea/swift/FeaturesViewController.swift similarity index 100% rename from RecipeGenie/.idea/swift/FeaturesViewController.swift rename to RecipeGenie-Mobile/.idea/swift/FeaturesViewController.swift diff --git a/RecipeGenie/.idea/swift/FlavorPairingGuide.swift b/RecipeGenie-Mobile/.idea/swift/FlavorPairingGuide.swift similarity index 100% rename from RecipeGenie/.idea/swift/FlavorPairingGuide.swift rename to RecipeGenie-Mobile/.idea/swift/FlavorPairingGuide.swift diff --git a/RecipeGenie/.idea/swift/MainActivity.swift b/RecipeGenie-Mobile/.idea/swift/MainActivity.swift similarity index 100% rename from RecipeGenie/.idea/swift/MainActivity.swift rename to RecipeGenie-Mobile/.idea/swift/MainActivity.swift diff --git a/RecipeGenie/.idea/swift/RandomRecipesViewController.swift b/RecipeGenie-Mobile/.idea/swift/RandomRecipesViewController.swift similarity index 100% rename from RecipeGenie/.idea/swift/RandomRecipesViewController.swift rename to RecipeGenie-Mobile/.idea/swift/RandomRecipesViewController.swift diff --git a/RecipeGenie/.idea/swift/RecipeGenieViewController.swift b/RecipeGenie-Mobile/.idea/swift/RecipeGenieViewController.swift similarity index 100% rename from RecipeGenie/.idea/swift/RecipeGenieViewController.swift rename to RecipeGenie-Mobile/.idea/swift/RecipeGenieViewController.swift diff --git a/RecipeGenie/.idea/swift/RecipeListViewController.swift b/RecipeGenie-Mobile/.idea/swift/RecipeListViewController.swift similarity index 100% rename from RecipeGenie/.idea/swift/RecipeListViewController.swift rename to RecipeGenie-Mobile/.idea/swift/RecipeListViewController.swift diff --git a/RecipeGenie/.idea/swift/SearchViewController.swift b/RecipeGenie-Mobile/.idea/swift/SearchViewController.swift similarity index 100% rename from RecipeGenie/.idea/swift/SearchViewController.swift rename to RecipeGenie-Mobile/.idea/swift/SearchViewController.swift diff --git a/RecipeGenie/.idea/swift/SettingsViewController.swift b/RecipeGenie-Mobile/.idea/swift/SettingsViewController.swift similarity index 100% rename from RecipeGenie/.idea/swift/SettingsViewController.swift rename to RecipeGenie-Mobile/.idea/swift/SettingsViewController.swift diff --git a/RecipeGenie/.idea/vcs.xml b/RecipeGenie-Mobile/.idea/vcs.xml similarity index 100% rename from RecipeGenie/.idea/vcs.xml rename to RecipeGenie-Mobile/.idea/vcs.xml diff --git a/RecipeGenie/README.md b/RecipeGenie-Mobile/README.md similarity index 100% rename from RecipeGenie/README.md rename to RecipeGenie-Mobile/README.md diff --git a/RecipeGenie/app/android/CookingConversionActivity.kt b/RecipeGenie-Mobile/app/android/CookingConversionActivity.kt similarity index 100% rename from RecipeGenie/app/android/CookingConversionActivity.kt rename to RecipeGenie-Mobile/app/android/CookingConversionActivity.kt diff --git a/RecipeGenie/app/android/CookingTipsActivity.kt b/RecipeGenie-Mobile/app/android/CookingTipsActivity.kt similarity index 100% rename from RecipeGenie/app/android/CookingTipsActivity.kt rename to RecipeGenie-Mobile/app/android/CookingTipsActivity.kt diff --git a/RecipeGenie/app/android/FlavorPairingActivity.kt b/RecipeGenie-Mobile/app/android/FlavorPairingActivity.kt similarity index 100% rename from RecipeGenie/app/android/FlavorPairingActivity.kt rename to RecipeGenie-Mobile/app/android/FlavorPairingActivity.kt diff --git a/RecipeGenie/app/android/MainActivity.java b/RecipeGenie-Mobile/app/android/MainActivity.java similarity index 100% rename from RecipeGenie/app/android/MainActivity.java rename to RecipeGenie-Mobile/app/android/MainActivity.java diff --git a/RecipeGenie/app/android/NutritionalTipsActivity.kt b/RecipeGenie-Mobile/app/android/NutritionalTipsActivity.kt similarity index 100% rename from RecipeGenie/app/android/NutritionalTipsActivity.kt rename to RecipeGenie-Mobile/app/android/NutritionalTipsActivity.kt diff --git a/RecipeGenie/app/android/RecipeDetailActivity.java b/RecipeGenie-Mobile/app/android/RecipeDetailActivity.java similarity index 100% rename from RecipeGenie/app/android/RecipeDetailActivity.java rename to RecipeGenie-Mobile/app/android/RecipeDetailActivity.java diff --git a/RecipeGenie/app/android/RecipeManager.java b/RecipeGenie-Mobile/app/android/RecipeManager.java similarity index 100% rename from RecipeGenie/app/android/RecipeManager.java rename to RecipeGenie-Mobile/app/android/RecipeManager.java diff --git a/RecipeGenie/app/android/SeasonalIngredientsActivity.kt b/RecipeGenie-Mobile/app/android/SeasonalIngredientsActivity.kt similarity index 100% rename from RecipeGenie/app/android/SeasonalIngredientsActivity.kt rename to RecipeGenie-Mobile/app/android/SeasonalIngredientsActivity.kt diff --git a/RecipeGenie/app/ios/AboutViewController.swift b/RecipeGenie-Mobile/app/ios/AboutViewController.swift similarity index 100% rename from RecipeGenie/app/ios/AboutViewController.swift rename to RecipeGenie-Mobile/app/ios/AboutViewController.swift diff --git a/RecipeGenie/app/ios/ChatbotViewController.swift b/RecipeGenie-Mobile/app/ios/ChatbotViewController.swift similarity index 100% rename from RecipeGenie/app/ios/ChatbotViewController.swift rename to RecipeGenie-Mobile/app/ios/ChatbotViewController.swift diff --git a/RecipeGenie/app/ios/FavoritesManager.swift b/RecipeGenie-Mobile/app/ios/FavoritesManager.swift similarity index 100% rename from RecipeGenie/app/ios/FavoritesManager.swift rename to RecipeGenie-Mobile/app/ios/FavoritesManager.swift diff --git a/RecipeGenie/app/ios/FeaturesViewController.swift b/RecipeGenie-Mobile/app/ios/FeaturesViewController.swift similarity index 100% rename from RecipeGenie/app/ios/FeaturesViewController.swift rename to RecipeGenie-Mobile/app/ios/FeaturesViewController.swift diff --git a/RecipeGenie/app/ios/FlavorPairingGuide.swift b/RecipeGenie-Mobile/app/ios/FlavorPairingGuide.swift similarity index 100% rename from RecipeGenie/app/ios/FlavorPairingGuide.swift rename to RecipeGenie-Mobile/app/ios/FlavorPairingGuide.swift diff --git a/RecipeGenie/app/ios/MainActivity.swift b/RecipeGenie-Mobile/app/ios/MainActivity.swift similarity index 100% rename from RecipeGenie/app/ios/MainActivity.swift rename to RecipeGenie-Mobile/app/ios/MainActivity.swift diff --git a/RecipeGenie/app/ios/RandomRecipesViewController.swift b/RecipeGenie-Mobile/app/ios/RandomRecipesViewController.swift similarity index 100% rename from RecipeGenie/app/ios/RandomRecipesViewController.swift rename to RecipeGenie-Mobile/app/ios/RandomRecipesViewController.swift diff --git a/RecipeGenie/app/ios/RecipeGenieViewController.swift b/RecipeGenie-Mobile/app/ios/RecipeGenieViewController.swift similarity index 100% rename from RecipeGenie/app/ios/RecipeGenieViewController.swift rename to RecipeGenie-Mobile/app/ios/RecipeGenieViewController.swift diff --git a/RecipeGenie/app/ios/RecipeListViewController.swift b/RecipeGenie-Mobile/app/ios/RecipeListViewController.swift similarity index 100% rename from RecipeGenie/app/ios/RecipeListViewController.swift rename to RecipeGenie-Mobile/app/ios/RecipeListViewController.swift diff --git a/RecipeGenie/app/ios/SearchViewController.swift b/RecipeGenie-Mobile/app/ios/SearchViewController.swift similarity index 100% rename from RecipeGenie/app/ios/SearchViewController.swift rename to RecipeGenie-Mobile/app/ios/SearchViewController.swift diff --git a/RecipeGenie/app/ios/SettingsViewController.swift b/RecipeGenie-Mobile/app/ios/SettingsViewController.swift similarity index 100% rename from RecipeGenie/app/ios/SettingsViewController.swift rename to RecipeGenie-Mobile/app/ios/SettingsViewController.swift diff --git a/RecipeGenie/config.xml b/RecipeGenie-Mobile/config.xml similarity index 100% rename from RecipeGenie/config.xml rename to RecipeGenie-Mobile/config.xml diff --git a/RecipeGenie/package-lock.json b/RecipeGenie-Mobile/package-lock.json similarity index 100% rename from RecipeGenie/package-lock.json rename to RecipeGenie-Mobile/package-lock.json diff --git a/RecipeGenie/package.json b/RecipeGenie-Mobile/package.json similarity index 100% rename from RecipeGenie/package.json rename to RecipeGenie-Mobile/package.json diff --git a/RecipeGenie/www/about.html b/RecipeGenie-Mobile/www/about.html similarity index 100% rename from RecipeGenie/www/about.html rename to RecipeGenie-Mobile/www/about.html diff --git a/RecipeGenie/www/css/index.css b/RecipeGenie-Mobile/www/css/index.css similarity index 100% rename from RecipeGenie/www/css/index.css rename to RecipeGenie-Mobile/www/css/index.css diff --git a/RecipeGenie/www/favicon.ico b/RecipeGenie-Mobile/www/favicon.ico similarity index 100% rename from RecipeGenie/www/favicon.ico rename to RecipeGenie-Mobile/www/favicon.ico diff --git a/RecipeGenie/www/icons/AndroidAppIcon.png b/RecipeGenie-Mobile/www/icons/AndroidAppIcon.png similarity index 100% rename from RecipeGenie/www/icons/AndroidAppIcon.png rename to RecipeGenie-Mobile/www/icons/AndroidAppIcon.png diff --git a/RecipeGenie/www/icons/iOSAppIcon.png b/RecipeGenie-Mobile/www/icons/iOSAppIcon.png similarity index 100% rename from RecipeGenie/www/icons/iOSAppIcon.png rename to RecipeGenie-Mobile/www/icons/iOSAppIcon.png diff --git a/RecipeGenie/www/img/logo.png b/RecipeGenie-Mobile/www/img/logo.png similarity index 100% rename from RecipeGenie/www/img/logo.png rename to RecipeGenie-Mobile/www/img/logo.png diff --git a/RecipeGenie/www/index.html b/RecipeGenie-Mobile/www/index.html similarity index 100% rename from RecipeGenie/www/index.html rename to RecipeGenie-Mobile/www/index.html diff --git a/RecipeGenie/www/js/index.js b/RecipeGenie-Mobile/www/js/index.js similarity index 100% rename from RecipeGenie/www/js/index.js rename to RecipeGenie-Mobile/www/js/index.js diff --git a/RecipeGenie/www/recipegenie-logo.png b/RecipeGenie-Mobile/www/recipegenie-logo.png similarity index 100% rename from RecipeGenie/www/recipegenie-logo.png rename to RecipeGenie-Mobile/www/recipegenie-logo.png diff --git a/RecipeGenie/www/script.js b/RecipeGenie-Mobile/www/script.js similarity index 84% rename from RecipeGenie/www/script.js rename to RecipeGenie-Mobile/www/script.js index 45effe4..140178b 100644 --- a/RecipeGenie/www/script.js +++ b/RecipeGenie-Mobile/www/script.js @@ -266,91 +266,91 @@ function shareOnTwitter() { function elizaResponse(message) { const lowerMessage = message.toLowerCase(); if (lowerMessage.includes("hello") || lowerMessage.includes("hi") || lowerMessage.includes("hey")) { - return "Hello! Ready to cook something delicious with RecipeGenie?"; + return "Hello! Ready to cook something delicious with RecipeGenie-Mobile?"; } else if (lowerMessage.includes("how are you")) { return "I'm excited to explore tasty recipes with you! What are you in the mood for?"; } else if (lowerMessage.includes("recipegenie")) { - return "RecipeGenie is your culinary companion, offering a plethora of recipes tailored to your taste, dietary preferences, and cooking time!"; + return "RecipeGenie-Mobile is your culinary companion, offering a plethora of recipes tailored to your taste, dietary preferences, and cooking time!"; } else if (lowerMessage.includes("ingredient")) { return "You can search for recipes based on the ingredients you have on hand! Just type them in, and I'll suggest a variety of dishes."; } else if (lowerMessage.includes("dietary preference")) { - return "Whether you’re vegan, vegetarian, gluten-free, or have other dietary requirements, RecipeGenie has a diverse collection of recipes for you!"; + return "Whether you’re vegan, vegetarian, gluten-free, or have other dietary requirements, RecipeGenie-Mobile has a diverse collection of recipes for you!"; } else if (lowerMessage.includes("shopping list")) { return "Every recipe comes with a detailed list of ingredients you can easily turn into a shopping list. Making grocery shopping a breeze!"; } else if (lowerMessage.includes("meal planning")) { - return "RecipeGenie is perfect for meal planning! Save your favorite recipes, and you’ll always have inspiration at your fingertips."; + return "RecipeGenie-Mobile is perfect for meal planning! Save your favorite recipes, and you’ll always have inspiration at your fingertips."; } else if (lowerMessage.includes("dinner ideas")) { - return "Absolutely! Whether you're looking for something quick and easy or a gourmet meal, RecipeGenie has a variety of dinner ideas to explore."; + return "Absolutely! Whether you're looking for something quick and easy or a gourmet meal, RecipeGenie-Mobile has a variety of dinner ideas to explore."; } else if (lowerMessage.includes("breakfast options")) { return "From smoothie bowls to classic pancakes, explore a wide range of breakfast recipes to start your day right!"; } else if (lowerMessage.includes("lunch ideas")) { return "Discover a selection of lunch recipes that are both delicious and quick to prepare. Perfect for busy afternoons!"; } else if (lowerMessage.includes("dessert")) { - return "Indulge in sweet treats from chocolate cakes to fruit tarts. RecipeGenie offers a variety of desserts to satisfy your cravings!"; + return "Indulge in sweet treats from chocolate cakes to fruit tarts. RecipeGenie-Mobile offers a variety of desserts to satisfy your cravings!"; } else if (lowerMessage.includes("snacks")) { return "Looking for something to munch on? Explore our snack recipes for quick bites that are both tasty and satisfying!"; } else if (lowerMessage.includes("healthy recipes")) { return "Discover a range of nutritious recipes that don't compromise on flavor. Healthy eating has never been so exciting!"; } else if (lowerMessage.includes("international cuisine")) { - return "Travel the world from your kitchen with RecipeGenie! Explore dishes from various cuisines globally."; + return "Travel the world from your kitchen with RecipeGenie-Mobile! Explore dishes from various cuisines globally."; } else if (lowerMessage.includes("thank")) { return "You're welcome! If you have more questions or need recipe inspiration, feel free to ask."; } else if (lowerMessage.includes("who are you")) { - return "I'm your RecipeGenie Assistant, ready to guide you to your next delicious meal!"; + return "I'm your RecipeGenie-Mobile Assistant, ready to guide you to your next delicious meal!"; } else if (lowerMessage.includes("help")) { - return "Absolutely! Tell me what you need, whether it’s recipe ideas, cooking tips, or navigating the RecipeGenie app."; + return "Absolutely! Tell me what you need, whether it’s recipe ideas, cooking tips, or navigating the RecipeGenie-Mobile app."; } else if (lowerMessage.includes("vegan")) { - return "Absolutely! RecipeGenie has a multitude of vegan recipes that are both delicious and satisfying. Just search 'vegan' to explore them!"; + return "Absolutely! RecipeGenie-Mobile has a multitude of vegan recipes that are both delicious and satisfying. Just search 'vegan' to explore them!"; } else if (lowerMessage.includes("save recipe")) { - return "Using RecipeGenie, you can save your favorite recipes for easy access later. Just click on the 'Save' option on any recipe you love!"; + return "Using RecipeGenie-Mobile, you can save your favorite recipes for easy access later. Just click on the 'Save' option on any recipe you love!"; } else if (lowerMessage.includes("share recipe")) { return "Found a recipe you love? You can easily share it with friends and family using the 'Share' option!"; } else if (lowerMessage.includes("drink") || lowerMessage.includes("beverage")) { - return "While RecipeGenie focuses on delicious meals, we also have a selection of drink recipes to complement your meals!"; + return "While RecipeGenie-Mobile focuses on delicious meals, we also have a selection of drink recipes to complement your meals!"; } else if (lowerMessage.includes("allergies") || lowerMessage.includes("allergic")) { return "Safety first! Always review the ingredients in recipes to ensure they don’t contain allergens specific to you or anyone you're cooking for."; } else if (lowerMessage.includes("kids") || lowerMessage.includes("children")) { - return "Cooking for the little ones? RecipeGenie has kid-friendly recipes that are both nutritious and appealing to younger taste buds!"; + return "Cooking for the little ones? RecipeGenie-Mobile has kid-friendly recipes that are both nutritious and appealing to younger taste buds!"; } else if (lowerMessage.includes("quick meals") || lowerMessage.includes("fast recipes")) { - return "In a rush? RecipeGenie offers a variety of recipes that can be made in 30 minutes or less. Perfect for those busy days!"; + return "In a rush? RecipeGenie-Mobile offers a variety of recipes that can be made in 30 minutes or less. Perfect for those busy days!"; } else if (lowerMessage.includes("seasonal recipes") || lowerMessage.includes("holidays")) { - return "RecipeGenie also provides seasonal recipes perfect for holidays and special occasions. Check out our 'Seasonal' section!"; + return "RecipeGenie-Mobile also provides seasonal recipes perfect for holidays and special occasions. Check out our 'Seasonal' section!"; } else if (lowerMessage.includes("baking")) { return "Got a sweet tooth? Dive into our baking section for cakes, pies, cookies, and more. Perfect for all your dessert desires!"; } else if (lowerMessage.includes("cooking tips") || lowerMessage.includes("kitchen hacks")) { - return "Need some help in the kitchen? Alongside our recipes, RecipeGenie offers cooking tips and tricks to enhance your culinary skills!"; + return "Need some help in the kitchen? Alongside our recipes, RecipeGenie-Mobile offers cooking tips and tricks to enhance your culinary skills!"; } else if (lowerMessage.includes("nutrition") || lowerMessage.includes("healthy")) { - return "RecipeGenie not only focuses on taste but also on nutrition. We aim to provide balanced recipes to ensure you're nourishing your body right!"; + return "RecipeGenie-Mobile not only focuses on taste but also on nutrition. We aim to provide balanced recipes to ensure you're nourishing your body right!"; } else if (lowerMessage.includes("how does it work") || lowerMessage.includes("how to use")) { - return "Simply enter what you're craving or the ingredients you have on hand into the search bar. RecipeGenie will then suggest recipes tailored just for you!"; + return "Simply enter what you're craving or the ingredients you have on hand into the search bar. RecipeGenie-Mobile will then suggest recipes tailored just for you!"; } else if (lowerMessage.includes("breakfast")) { - return "Looking for a morning treat? RecipeGenie has a wide range of breakfast recipes to kickstart your day. From pancakes to omelettes, we've got you covered!"; + return "Looking for a morning treat? RecipeGenie-Mobile has a wide range of breakfast recipes to kickstart your day. From pancakes to omelettes, we've got you covered!"; } else if (lowerMessage.includes("lunch")) { - return "Lunchtime cravings? RecipeGenie offers a plethora of lunch options from quick sandwiches to hearty salads!"; + return "Lunchtime cravings? RecipeGenie-Mobile offers a plethora of lunch options from quick sandwiches to hearty salads!"; } else if (lowerMessage.includes("dinner")) { - return "Planning dinner? RecipeGenie can suggest a myriad of dinner recipes, from pasta dishes to grilled entrees. Bon appétit!"; + return "Planning dinner? RecipeGenie-Mobile can suggest a myriad of dinner recipes, from pasta dishes to grilled entrees. Bon appétit!"; } else if (lowerMessage.includes("dessert")) { - return "Sweet cravings are no match for RecipeGenie! Dive into our collection of delectable desserts, from brownies to cheesecakes!"; + return "Sweet cravings are no match for RecipeGenie-Mobile! Dive into our collection of delectable desserts, from brownies to cheesecakes!"; } else if (lowerMessage.includes("snacks") || lowerMessage.includes("appetizers")) { - return "Need a bite to snack on or appetizers for your party? RecipeGenie has a selection of tasty tidbits to keep hunger at bay!"; + return "Need a bite to snack on or appetizers for your party? RecipeGenie-Mobile has a selection of tasty tidbits to keep hunger at bay!"; } else if (lowerMessage.includes("vegetarian")) { - return "Yes! RecipeGenie has an extensive range of vegetarian recipes. Just input 'vegetarian' in the search to discover them!"; + return "Yes! RecipeGenie-Mobile has an extensive range of vegetarian recipes. Just input 'vegetarian' in the search to discover them!"; } else if (lowerMessage.includes("ingredient")) { - return "If you have a specific ingredient on hand, just type it into the search. RecipeGenie will show recipes that feature it!"; + return "If you have a specific ingredient on hand, just type it into the search. RecipeGenie-Mobile will show recipes that feature it!"; } else if (lowerMessage.includes("shopping list")) { - return "Found a recipe you like? RecipeGenie can automatically generate a shopping list for you. Making grocery shopping a breeze!"; + return "Found a recipe you like? RecipeGenie-Mobile can automatically generate a shopping list for you. Making grocery shopping a breeze!"; } else if (lowerMessage.includes("meal planning")) { - return "With RecipeGenie, meal planning is effortless. You can plan your weekly meals and generate a consolidated shopping list in no time!"; + return "With RecipeGenie-Mobile, meal planning is effortless. You can plan your weekly meals and generate a consolidated shopping list in no time!"; } else if (lowerMessage.includes("world cuisine") || lowerMessage.includes("international dishes")) { - return "Explore world cuisines with RecipeGenie! Whether you're craving Italian pasta, Japanese sushi, or Indian curry, we have recipes from every corner of the globe."; + return "Explore world cuisines with RecipeGenie-Mobile! Whether you're craving Italian pasta, Japanese sushi, or Indian curry, we have recipes from every corner of the globe."; } else if (lowerMessage.includes("spices") || lowerMessage.includes("herbs")) { - return "Spices and herbs can elevate any dish! RecipeGenie offers tips on how to use them to bring out the best flavors in your meals."; + return "Spices and herbs can elevate any dish! RecipeGenie-Mobile offers tips on how to use them to bring out the best flavors in your meals."; } else if (lowerMessage.includes("cooking for one") || lowerMessage.includes("single serving")) { - return "Cooking for just yourself? RecipeGenie has single-serving recipes, ensuring no wastage and just the right portion!"; + return "Cooking for just yourself? RecipeGenie-Mobile has single-serving recipes, ensuring no wastage and just the right portion!"; } else if (lowerMessage.includes("large group") || lowerMessage.includes("party")) { - return "Hosting a party or cooking for a large group? RecipeGenie can suggest recipes perfect for feeding a crowd."; + return "Hosting a party or cooking for a large group? RecipeGenie-Mobile can suggest recipes perfect for feeding a crowd."; } else { - return "I'm here to help with any questions or needs related to RecipeGenie. Could you please provide more details or try a different question?"; + return "I'm here to help with any questions or needs related to RecipeGenie-Mobile. Could you please provide more details or try a different question?"; } } diff --git a/RecipeGenie/www/style.css b/RecipeGenie-Mobile/www/style.css similarity index 100% rename from RecipeGenie/www/style.css rename to RecipeGenie-Mobile/www/style.css diff --git a/RecipeGenie/www/swift/AboutViewController.swift b/RecipeGenie-Mobile/www/swift/AboutViewController.swift similarity index 100% rename from RecipeGenie/www/swift/AboutViewController.swift rename to RecipeGenie-Mobile/www/swift/AboutViewController.swift diff --git a/RecipeGenie/www/swift/ChatbotViewController.swift b/RecipeGenie-Mobile/www/swift/ChatbotViewController.swift similarity index 100% rename from RecipeGenie/www/swift/ChatbotViewController.swift rename to RecipeGenie-Mobile/www/swift/ChatbotViewController.swift diff --git a/RecipeGenie/www/swift/FavoritesManager.swift b/RecipeGenie-Mobile/www/swift/FavoritesManager.swift similarity index 100% rename from RecipeGenie/www/swift/FavoritesManager.swift rename to RecipeGenie-Mobile/www/swift/FavoritesManager.swift diff --git a/RecipeGenie/www/swift/FeaturesViewController.swift b/RecipeGenie-Mobile/www/swift/FeaturesViewController.swift similarity index 100% rename from RecipeGenie/www/swift/FeaturesViewController.swift rename to RecipeGenie-Mobile/www/swift/FeaturesViewController.swift diff --git a/RecipeGenie/www/swift/FlavorPairingGuide.swift b/RecipeGenie-Mobile/www/swift/FlavorPairingGuide.swift similarity index 100% rename from RecipeGenie/www/swift/FlavorPairingGuide.swift rename to RecipeGenie-Mobile/www/swift/FlavorPairingGuide.swift diff --git a/RecipeGenie/www/swift/MainActivity.swift b/RecipeGenie-Mobile/www/swift/MainActivity.swift similarity index 100% rename from RecipeGenie/www/swift/MainActivity.swift rename to RecipeGenie-Mobile/www/swift/MainActivity.swift diff --git a/RecipeGenie/www/swift/RandomRecipesViewController.swift b/RecipeGenie-Mobile/www/swift/RandomRecipesViewController.swift similarity index 100% rename from RecipeGenie/www/swift/RandomRecipesViewController.swift rename to RecipeGenie-Mobile/www/swift/RandomRecipesViewController.swift diff --git a/RecipeGenie/www/swift/RecipeGenieViewController.swift b/RecipeGenie-Mobile/www/swift/RecipeGenieViewController.swift similarity index 100% rename from RecipeGenie/www/swift/RecipeGenieViewController.swift rename to RecipeGenie-Mobile/www/swift/RecipeGenieViewController.swift diff --git a/RecipeGenie/www/swift/RecipeListViewController.swift b/RecipeGenie-Mobile/www/swift/RecipeListViewController.swift similarity index 100% rename from RecipeGenie/www/swift/RecipeListViewController.swift rename to RecipeGenie-Mobile/www/swift/RecipeListViewController.swift diff --git a/RecipeGenie/www/swift/SearchViewController.swift b/RecipeGenie-Mobile/www/swift/SearchViewController.swift similarity index 100% rename from RecipeGenie/www/swift/SearchViewController.swift rename to RecipeGenie-Mobile/www/swift/SearchViewController.swift diff --git a/RecipeGenie/www/swift/SettingsViewController.swift b/RecipeGenie-Mobile/www/swift/SettingsViewController.swift similarity index 100% rename from RecipeGenie/www/swift/SettingsViewController.swift rename to RecipeGenie-Mobile/www/swift/SettingsViewController.swift diff --git a/RecipeGenie/plugins/cordova-plugin-geolocation/CONTRIBUTING.md b/RecipeGenie/plugins/cordova-plugin-geolocation/CONTRIBUTING.md deleted file mode 100644 index 21a93d7..0000000 --- a/RecipeGenie/plugins/cordova-plugin-geolocation/CONTRIBUTING.md +++ /dev/null @@ -1,37 +0,0 @@ - - -# Contributing to Apache Cordova - -Anyone can contribute to Cordova. And we need your contributions. - -There are multiple ways to contribute: report bugs, improve the docs, and -contribute code. - -For instructions on this, start with the -[contribution overview](http://cordova.apache.org/contribute/). - -The details are explained there, but the important items are: - - Check for Github issues that corresponds to your contribution and link or create them if necessary. - - Run the tests so your patch doesn't break existing functionality. - -We look forward to your contributions! - diff --git a/RecipeGenie/plugins/cordova-plugin-geolocation/LICENSE b/RecipeGenie/plugins/cordova-plugin-geolocation/LICENSE deleted file mode 100644 index 7a4a3ea..0000000 --- a/RecipeGenie/plugins/cordova-plugin-geolocation/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. \ No newline at end of file diff --git a/RecipeGenie/plugins/cordova-plugin-geolocation/NOTICE b/RecipeGenie/plugins/cordova-plugin-geolocation/NOTICE deleted file mode 100644 index 8ec56a5..0000000 --- a/RecipeGenie/plugins/cordova-plugin-geolocation/NOTICE +++ /dev/null @@ -1,5 +0,0 @@ -Apache Cordova -Copyright 2012 The Apache Software Foundation - -This product includes software developed at -The Apache Software Foundation (http://www.apache.org/). diff --git a/RecipeGenie/plugins/cordova-plugin-geolocation/README.md b/RecipeGenie/plugins/cordova-plugin-geolocation/README.md deleted file mode 100644 index 7957eeb..0000000 --- a/RecipeGenie/plugins/cordova-plugin-geolocation/README.md +++ /dev/null @@ -1,778 +0,0 @@ ---- -title: Geolocation -description: Access GPS data. ---- - - -# cordova-plugin-geolocation - -[![Android Testsuite](https://github.com/apache/cordova-plugin-geolocation/actions/workflows/android.yml/badge.svg)](https://github.com/apache/cordova-plugin-geolocation/actions/workflows/android.yml) [![Chrome Testsuite](https://github.com/apache/cordova-plugin-geolocation/actions/workflows/chrome.yml/badge.svg)](https://github.com/apache/cordova-plugin-geolocation/actions/workflows/chrome.yml) [![iOS Testsuite](https://github.com/apache/cordova-plugin-geolocation/actions/workflows/ios.yml/badge.svg)](https://github.com/apache/cordova-plugin-geolocation/actions/workflows/ios.yml) [![Lint Test](https://github.com/apache/cordova-plugin-geolocation/actions/workflows/lint.yml/badge.svg)](https://github.com/apache/cordova-plugin-geolocation/actions/workflows/lint.yml) - -This plugin provides information about the device's location, such as -latitude and longitude. - -Common sources of location information include -Global Positioning System (GPS) and location inferred from network -signals such as IP address, RFID, WiFi and Bluetooth MAC addresses, -and GSM/CDMA cell IDs. There is no guarantee that the API returns the -device's actual location. - -> To get a few ideas, check out the [sample](#sample) at the bottom of this page or go straight to the [reference](#reference) content. - -This API is based on the -[W3C Geolocation API Specification](http://dev.w3.org/geo/api/spec-source.html). - -__WARNING__: Collection and use of geolocation data -raises important privacy issues. Your app's privacy policy should -discuss how the app uses geolocation data, whether it is shared with -any other parties, and the level of precision of the data (for -example, coarse, fine, ZIP code level, etc.). Geolocation data is -generally considered sensitive because it can reveal user's -whereabouts and, if stored, the history of their travels. -Therefore, in addition to the app's privacy policy, you should -strongly consider providing a just-in-time notice before the app -accesses geolocation data (if the device operating system doesn't do -so already). That notice should provide the same information noted -above, as well as obtaining the user's permission (e.g., by presenting -choices for __OK__ and __No Thanks__). For more information, please -see the [Privacy Guide](http://cordova.apache.org/docs/en/latest/guide/appdev/privacy/index.html). - -This plugin defines a global `navigator.geolocation` object (for platforms -where it is otherwise missing). - -Although the object is in the global scope, features provided by this plugin -are not available until after the `deviceready` event. - -```javascript - - document.addEventListener("deviceready", onDeviceReady, false); - function onDeviceReady() { - console.log("navigator.geolocation works well"); - } - -``` - -## Installation - -This requires cordova 5.0+ ( current stable 1.0.0 ) - - cordova plugin add cordova-plugin-geolocation - -Older versions of cordova can still install via the deprecated id ( stale 0.3.12 ) - - cordova plugin add org.apache.cordova.geolocation - -It is also possible to install via repo url directly ( unstable ) - - cordova plugin add https://github.com/apache/cordova-plugin-geolocation.git - -## Supported Platforms - -- Android -- iOS - -## Methods - -- navigator.geolocation.getCurrentPosition -- navigator.geolocation.watchPosition -- navigator.geolocation.clearWatch - -## Objects (Read-Only) - -- Position -- PositionError -- Coordinates - -## navigator.geolocation.getCurrentPosition - -Returns the device's current position to the `geolocationSuccess` -callback with a `Position` object as the parameter. If there is an -error, the `geolocationError` callback is passed a -`PositionError` object. - - navigator.geolocation.getCurrentPosition(geolocationSuccess, - [geolocationError], - [geolocationOptions]); - -### Parameters - -- __geolocationSuccess__: The callback that is passed the current position. - -- __geolocationError__: _(Optional)_ The callback that executes if an error occurs. - -- __geolocationOptions__: _(Optional)_ The geolocation options. - - -### Example - -```javascript - - // onSuccess Callback - // This method accepts a Position object, which contains the - // current GPS coordinates - // - var onSuccess = function(position) { - alert('Latitude: ' + position.coords.latitude + '\n' + - 'Longitude: ' + position.coords.longitude + '\n' + - 'Altitude: ' + position.coords.altitude + '\n' + - 'Accuracy: ' + position.coords.accuracy + '\n' + - 'Altitude Accuracy: ' + position.coords.altitudeAccuracy + '\n' + - 'Heading: ' + position.coords.heading + '\n' + - 'Speed: ' + position.coords.speed + '\n' + - 'Timestamp: ' + position.timestamp + '\n'); - }; - - // onError Callback receives a PositionError object - // - function onError(error) { - alert('code: ' + error.code + '\n' + - 'message: ' + error.message + '\n'); - } - - navigator.geolocation.getCurrentPosition(onSuccess, onError); - -``` - -### iOS Quirks - - Since iOS 10 it's mandatory to provide an usage description in the `info.plist` if trying to access privacy-sensitive data. When the system prompts the user to allow access, this usage description string will displayed as part of the permission dialog box, but if you didn't provide the usage description, the app will crash before showing the dialog. Also, Apple will reject apps that access private data but don't provide an usage description. - - This plugins requires the following usage description: - - * `NSLocationWhenInUseUsageDescription` describes the reason that the app accesses the user's location, this is used while the app is running in the foreground. - * `NSLocationAlwaysAndWhenInUseUsageDescription` describes the reason that the app is requesting access to the user’s location information at all times. Use this key if your iOS app accesses location information while running in the background and foreground. - * `NSLocationAlwaysUsageDescription` describes the reason that the app is requesting access to the user's location at all times. Use this key if your app accesses location information in the background and you deploy to a target earlier than iOS 11. For iOS 11 and later, add both `NSLocationAlwaysUsageDescription` and `NSLocationAlwaysAndWhenInUseUsageDescription` to your app’s `Info.plist` file with the same message. - - To add these entries into the `info.plist`, you can use the `edit-config` tag in the `config.xml` like this: - -``` - - need location access to find things nearby - -``` -``` - - need location access to find things nearby - -``` -``` - - need location access to find things nearby - -``` - -### Android Quirks - -For historic reasons, this plugin requires GPS Hardware on Android devices, so your app will not be able to run on devices without. -If you want to use this plugin in your app, but you do not require actual GPS Hardware on the device, install the plugin using the variable *GPS_REQUIRED* set to false: - - cordova plugin add cordova-plugin-geolocation --variable GPS_REQUIRED="false" - -If Geolocation service is turned off the `onError` callback is invoked after `timeout` interval (if specified). -If `timeout` parameter is not specified then no callback is called. - -## navigator.geolocation.watchPosition - -Returns the device's current position when a change in position is detected. -When the device retrieves a new location, the `geolocationSuccess` -callback executes with a `Position` object as the parameter. If -there is an error, the `geolocationError` callback executes with a -`PositionError` object as the parameter. - - var watchId = navigator.geolocation.watchPosition(geolocationSuccess, - [geolocationError], - [geolocationOptions]); - -### Parameters - -- __geolocationSuccess__: The callback that is passed the current position. - -- __geolocationError__: (Optional) The callback that executes if an error occurs. - -- __geolocationOptions__: (Optional) The geolocation options. - -### Returns - -- __String__: returns a watch id that references the watch position interval. The watch id should be used with `navigator.geolocation.clearWatch` to stop watching for changes in position. - -### Example - -```javascript - - // onSuccess Callback - // This method accepts a `Position` object, which contains - // the current GPS coordinates - // - function onSuccess(position) { - var element = document.getElementById('geolocation'); - element.innerHTML = 'Latitude: ' + position.coords.latitude + '
' + - 'Longitude: ' + position.coords.longitude + '
' + - '
' + element.innerHTML; - } - - // onError Callback receives a PositionError object - // - function onError(error) { - alert('code: ' + error.code + '\n' + - 'message: ' + error.message + '\n'); - } - - // Options: throw an error if no update is received every 30 seconds. - // - var watchID = navigator.geolocation.watchPosition(onSuccess, onError, { timeout: 30000 }); - -``` - -## geolocationOptions - -Optional parameters to customize the retrieval of the geolocation -`Position`. - - { maximumAge: 3000, timeout: 5000, enableHighAccuracy: true }; - -### Options - -- __enableHighAccuracy__: Provides a hint that the application needs the best possible results. By default, the device attempts to retrieve a `Position` using network-based methods. Setting this property to `true` tells the framework to use more accurate methods, such as satellite positioning. _(Boolean)_ - -- __timeout__: The maximum length of time (milliseconds) that is allowed to pass from the call to `navigator.geolocation.getCurrentPosition` or `geolocation.watchPosition` until the corresponding `geolocationSuccess` callback executes. If the `geolocationSuccess` callback is not invoked within this time, the `geolocationError` callback is passed a `PositionError.TIMEOUT` error code. (Note that when used in conjunction with `geolocation.watchPosition`, the `geolocationError` callback could be called on an interval every `timeout` milliseconds!) _(Number)_ - -- __maximumAge__: Accept a cached position whose age is no greater than the specified time in milliseconds. _(Number)_ - -### Android Quirks - -If Geolocation service is turned off the `onError` callback is invoked after `timeout` interval (if specified). -If `timeout` parameter is not specified then no callback is called. - -## navigator.geolocation.clearWatch - -Stop watching for changes to the device's location referenced by the -`watchID` parameter. - - navigator.geolocation.clearWatch(watchID); - -### Parameters - -- __watchID__: The id of the `watchPosition` interval to clear. (String) - -### Example - -```javascript - - // Options: watch for changes in position, and use the most - // accurate position acquisition method available. - // - var watchID = navigator.geolocation.watchPosition(onSuccess, onError, { enableHighAccuracy: true }); - - // ...later on... - - navigator.geolocation.clearWatch(watchID); - -``` - -## Position - -Contains `Position` coordinates and timestamp, created by the geolocation API. - -### Properties - -- __coords__: A set of geographic coordinates. _(Coordinates)_ - -- __timestamp__: Creation timestamp for `coords`. _(DOMTimeStamp)_ - -## Coordinates - -A `Coordinates` object is attached to a `Position` object that is -available to callback functions in requests for the current position. -It contains a set of properties that describe the geographic coordinates of a position. - -### Properties - -* __latitude__: Latitude in decimal degrees. _(Number)_ - -* __longitude__: Longitude in decimal degrees. _(Number)_ - -* __altitude__: Height of the position in meters above the ellipsoid. _(Number)_ - -* __accuracy__: Accuracy level of the latitude and longitude coordinates in meters. _(Number)_ - -* __altitudeAccuracy__: Accuracy level of the altitude coordinate in meters. _(Number)_ - -* __heading__: Direction of travel, specified in degrees counting clockwise relative to the true north. _(Number)_ - -* __speed__: Current ground speed of the device, specified in meters per second. _(Number)_ - -### Android Quirks - -__altitudeAccuracy__: Not supported by Android devices, returning `null`. - -## PositionError - -The `PositionError` object is passed to the `geolocationError` -callback function when an error occurs with navigator.geolocation. - -### Properties - -- __code__: One of the predefined error codes listed below. - -- __message__: Error message describing the details of the error encountered. - -### Constants - -- `PositionError.PERMISSION_DENIED` - - Returned when users do not allow the app to retrieve position information. This is dependent on the platform. -- `PositionError.POSITION_UNAVAILABLE` - - Returned when the device is unable to retrieve a position. In general, this means the device is not connected to a network or can't get a satellite fix. -- `PositionError.TIMEOUT` - - Returned when the device is unable to retrieve a position within the time specified by the `timeout` included in `geolocationOptions`. When used with `navigator.geolocation.watchPosition`, this error could be repeatedly passed to the `geolocationError` callback every `timeout` milliseconds. - - -## Sample: Get the weather, find stores, and see photos of things nearby with Geolocation ## - -Use this plugin to help users find things near them such as Groupon deals, houses for sale, movies playing, sports and entertainment events and more. - -Here's a "cookbook" of ideas to get you started. In the snippets below, we'll show you some basic ways to add these features to your app. - -* [Get your coordinates](#coords). -* [Get the weather forecast](#weather). -* [Receive updated weather forecasts as you drive around](#receive). -* [See where you are on a map](#see). -* [Find stores near you](#find). -* [See pictures of things around you](#see). - -## Get your geolocation coordinates - -```javascript - -function getWeatherLocation() { - - navigator.geolocation.getCurrentPosition - (onWeatherSuccess, onWeatherError, { enableHighAccuracy: true }); -} - -``` -## Get the weather forecast - -```javascript - -// Success callback for get geo coordinates - -var onWeatherSuccess = function (position) { - - Latitude = position.coords.latitude; - Longitude = position.coords.longitude; - - getWeather(Latitude, Longitude); -} - -// Get weather by using coordinates - -function getWeather(latitude, longitude) { - - // Get a free key at http://openweathermap.org/. Replace the "Your_Key_Here" string with that key. - var OpenWeatherAppKey = "Your_Key_Here"; - - var queryString = - 'http://api.openweathermap.org/data/2.5/weather?lat=' - + latitude + '&lon=' + longitude + '&appid=' + OpenWeatherAppKey + '&units=imperial'; - - $.getJSON(queryString, function (results) { - - if (results.weather.length) { - - $.getJSON(queryString, function (results) { - - if (results.weather.length) { - - $('#description').text(results.name); - $('#temp').text(results.main.temp); - $('#wind').text(results.wind.speed); - $('#humidity').text(results.main.humidity); - $('#visibility').text(results.weather[0].main); - - var sunriseDate = new Date(results.sys.sunrise); - $('#sunrise').text(sunriseDate.toLocaleTimeString()); - - var sunsetDate = new Date(results.sys.sunrise); - $('#sunset').text(sunsetDate.toLocaleTimeString()); - } - - }); - } - }).fail(function () { - console.log("error getting location"); - }); -} - -// Error callback - -function onWeatherError(error) { - console.log('code: ' + error.code + '\n' + - 'message: ' + error.message + '\n'); -} - -``` - -## Receive updated weather forecasts as you drive around - -```javascript - -// Watch your changing position - -function watchWeatherPosition() { - - return navigator.geolocation.watchPosition - (onWeatherWatchSuccess, onWeatherError, { enableHighAccuracy: true }); -} - -// Success callback for watching your changing position - -var onWeatherWatchSuccess = function (position) { - - var updatedLatitude = position.coords.latitude; - var updatedLongitude = position.coords.longitude; - - if (updatedLatitude != Latitude && updatedLongitude != Longitude) { - - Latitude = updatedLatitude; - Longitude = updatedLongitude; - - // Calls function we defined earlier. - getWeather(updatedLatitude, updatedLongitude); - } -} - -``` - -## See where you are on a map - -Both Bing and Google have map services. We'll use Google's. You'll need a key but it's free if you're just trying things out. - -Add a reference to the **maps** service. - -```HTML - - - -``` -Then, add code to use it. - -```javascript - -var Latitude = undefined; -var Longitude = undefined; - -// Get geo coordinates - -function getMapLocation() { - - navigator.geolocation.getCurrentPosition - (onMapSuccess, onMapError, { enableHighAccuracy: true }); -} - -// Success callback for get geo coordinates - -var onMapSuccess = function (position) { - - Latitude = position.coords.latitude; - Longitude = position.coords.longitude; - - getMap(Latitude, Longitude); - -} - -// Get map by using coordinates - -function getMap(latitude, longitude) { - - var mapOptions = { - center: new google.maps.LatLng(0, 0), - zoom: 1, - mapTypeId: google.maps.MapTypeId.ROADMAP - }; - - map = new google.maps.Map - (document.getElementById("map"), mapOptions); - - - var latLong = new google.maps.LatLng(latitude, longitude); - - var marker = new google.maps.Marker({ - position: latLong - }); - - marker.setMap(map); - map.setZoom(15); - map.setCenter(marker.getPosition()); -} - -// Success callback for watching your changing position - -var onMapWatchSuccess = function (position) { - - var updatedLatitude = position.coords.latitude; - var updatedLongitude = position.coords.longitude; - - if (updatedLatitude != Latitude && updatedLongitude != Longitude) { - - Latitude = updatedLatitude; - Longitude = updatedLongitude; - - getMap(updatedLatitude, updatedLongitude); - } -} - -// Error callback - -function onMapError(error) { - console.log('code: ' + error.code + '\n' + - 'message: ' + error.message + '\n'); -} - -// Watch your changing position - -function watchMapPosition() { - - return navigator.geolocation.watchPosition - (onMapWatchSuccess, onMapError, { enableHighAccuracy: true }); -} - -``` - -## Find stores near you - -You can use the same Google key for this. - -Add a reference to the **places** service. - -```HTML - - - -``` - -Then, add code to use it. - -```javascript - -var Map; -var Infowindow; -var Latitude = undefined; -var Longitude = undefined; - -// Get geo coordinates - -function getPlacesLocation() { - navigator.geolocation.getCurrentPosition - (onPlacesSuccess, onPlacesError, { enableHighAccuracy: true }); -} - -// Success callback for get geo coordinates - -var onPlacesSuccess = function (position) { - - Latitude = position.coords.latitude; - Longitude = position.coords.longitude; - - getPlaces(Latitude, Longitude); - -} - -// Get places by using coordinates - -function getPlaces(latitude, longitude) { - - var latLong = new google.maps.LatLng(latitude, longitude); - - var mapOptions = { - - center: new google.maps.LatLng(latitude, longitude), - zoom: 15, - mapTypeId: google.maps.MapTypeId.ROADMAP - - }; - - Map = new google.maps.Map(document.getElementById("places"), mapOptions); - - Infowindow = new google.maps.InfoWindow(); - - var service = new google.maps.places.PlacesService(Map); - service.nearbySearch({ - - location: latLong, - radius: 500, - type: ['store'] - }, foundStoresCallback); - -} - -// Success callback for watching your changing position - -var onPlacesWatchSuccess = function (position) { - - var updatedLatitude = position.coords.latitude; - var updatedLongitude = position.coords.longitude; - - if (updatedLatitude != Latitude && updatedLongitude != Longitude) { - - Latitude = updatedLatitude; - Longitude = updatedLongitude; - - getPlaces(updatedLatitude, updatedLongitude); - } -} - -// Success callback for locating stores in the area - -function foundStoresCallback(results, status) { - - if (status === google.maps.places.PlacesServiceStatus.OK) { - - for (var i = 0; i < results.length; i++) { - - createMarker(results[i]); - - } - } -} - -// Place a pin for each store on the map - -function createMarker(place) { - - var placeLoc = place.geometry.location; - - var marker = new google.maps.Marker({ - map: Map, - position: place.geometry.location - }); - - google.maps.event.addListener(marker, 'click', function () { - - Infowindow.setContent(place.name); - Infowindow.open(Map, this); - - }); -} - -// Error callback - -function onPlacesError(error) { - console.log('code: ' + error.code + '\n' + - 'message: ' + error.message + '\n'); -} - -// Watch your changing position - -function watchPlacesPosition() { - - return navigator.geolocation.watchPosition - (onPlacesWatchSuccess, onPlacesError, { enableHighAccuracy: true }); -} - -``` - -## See pictures of things around you - -Digital photos can contain geo coordinates that identify where the picture was taken. - -Use Flickr API's to find pictures that folks have taken near you. Like Google services, you'll need a key, but it's free if you just want to try things out. - -```javascript - -var Latitude = undefined; -var Longitude = undefined; - -// Get geo coordinates - -function getPicturesLocation() { - - navigator.geolocation.getCurrentPosition - (onPicturesSuccess, onPicturesError, { enableHighAccuracy: true }); - -} - -// Success callback for get geo coordinates - -var onPicturesSuccess = function (position) { - - Latitude = position.coords.latitude; - Longitude = position.coords.longitude; - - getPictures(Latitude, Longitude); -} - -// Get pictures by using coordinates - -function getPictures(latitude, longitude) { - - $('#pictures').empty(); - - var queryString = - "https://api.flickr.com/services/rest/?method=flickr.photos.search&api_key=Your_API_Key&lat=" - + latitude + "&lon=" + longitude + "&format=json&jsoncallback=?"; - - $.getJSON(queryString, function (results) { - $.each(results.photos.photo, function (index, item) { - - var photoURL = "http://farm" + item.farm + ".static.flickr.com/" + - item.server + "/" + item.id + "_" + item.secret + "_m.jpg"; - - $('#pictures').append($("").attr("src", photoURL)); - - }); - } - ); -} - -// Success callback for watching your changing position - -var onPicturesWatchSuccess = function (position) { - - var updatedLatitude = position.coords.latitude; - var updatedLongitude = position.coords.longitude; - - if (updatedLatitude != Latitude && updatedLongitude != Longitude) { - - Latitude = updatedLatitude; - Longitude = updatedLongitude; - - getPictures(updatedLatitude, updatedLongitude); - } -} - -// Error callback - -function onPicturesError(error) { - - console.log('code: ' + error.code + '\n' + - 'message: ' + error.message + '\n'); -} - -// Watch your changing position - -function watchPicturePosition() { - - return navigator.geolocation.watchPosition - (onPicturesWatchSuccess, onPicturesError, { enableHighAccuracy: true }); -} - -``` diff --git a/RecipeGenie/plugins/cordova-plugin-geolocation/RELEASENOTES.md b/RecipeGenie/plugins/cordova-plugin-geolocation/RELEASENOTES.md deleted file mode 100644 index 1eaf0e4..0000000 --- a/RecipeGenie/plugins/cordova-plugin-geolocation/RELEASENOTES.md +++ /dev/null @@ -1,254 +0,0 @@ - -# Release Notes - -### 5.0.0 (Sep 16, 2023) -* [GH-270](https://github.com/apache/cordova-plugin-geolocation/pull/270) fix: heading speed w3c spec (#270) -* [GH-269](https://github.com/apache/cordova-plugin-geolocation/pull/269) test(windows): Remove window platform references from tests (#269) -* [GH-265](https://github.com/apache/cordova-plugin-geolocation/pull/265) chore: package-lock (#265) -* [GH-267](https://github.com/apache/cordova-plugin-geolocation/pull/267) chore(windows)!: Remove **Windows** platform (#267) -* [GH-268](https://github.com/apache/cordova-plugin-geolocation/pull/268) ci(gh-action): Sync with paramedic configs (#268) -* [GH-261](https://github.com/apache/cordova-plugin-geolocation/pull/261) ci: Sync with paramedic. Removed API 22 & 31, added API 24 & API 33 (#261) -* [GH-260](https://github.com/apache/cordova-plugin-geolocation/pull/260) chore(eslint): config upgrade to 5.0.0 (#260) -* [GH-250](https://github.com/apache/cordova-plugin-geolocation/pull/250) (android) fix: respect requested location accuracy when checking/requesting permissions on **Android** 12+ Handle bug on API < 32 when requesting COARSE permission results in TIMEOUT error. -* [GH-251](https://github.com/apache/cordova-plugin-geolocation/pull/251) ci: sync workflow with paramedic (#251) -* [GH-249](https://github.com/apache/cordova-plugin-geolocation/pull/249) dep(npm): bump package-lock v2 w/ rebuild (#249) -* [GH-231](https://github.com/apache/cordova-plugin-geolocation/pull/231) (ios) fix: Check NSDictionary constructed from native CLLocation data is valid for conversion to JSON before attempting conversion. Prevents crashes due to values invalid for JSON conversion such as INFINITY. -* [GH-247](https://github.com/apache/cordova-plugin-geolocation/pull/247) ci(android): update java requirement for `cordova-android`@11 (#247) -* [GH-241](https://github.com/apache/cordova-plugin-geolocation/pull/241) ci(ios): update workflow w/ **iOS** 15 (#241) -* [GH-239](https://github.com/apache/cordova-plugin-geolocation/pull/239) ci: add action-badge (#239) -* [GH-238](https://github.com/apache/cordova-plugin-geolocation/pull/238) ci: remove travis & appveyor (#238) -* [GH-236](https://github.com/apache/cordova-plugin-geolocation/pull/236) chore: npmrc (#236) -* [GH-234](https://github.com/apache/cordova-plugin-geolocation/pull/234) ci: add gh-actions workflows (#234) -* [GH-217](https://github.com/apache/cordova-plugin-geolocation/pull/217) ci: add node-14.x to workflow (#217) - -### 4.1.0 (Nov 06, 2020) - -* [GH-214](https://github.com/apache/cordova-plugin-geolocation/pull/214) chore(npm): rebuild `package-lock.json` -* [GH-209](https://github.com/apache/cordova-plugin-geolocation/pull/209) ci(travis): update osx xcode image -* ci(travis): updates **Android** API level -* [GH-202](https://github.com/apache/cordova-plugin-geolocation/pull/202) chore: adds `package-lock` file -* [GH-200](https://github.com/apache/cordova-plugin-geolocation/pull/200) refactor(`eslint`): use `cordova-eslint` /w fix -* [GH-201](https://github.com/apache/cordova-plugin-geolocation/pull/201) chore(npm): use short notation in `package.json` -* chore(asf): update git notification settings -* chore: update `CONTRIBUTING.md` -* [GH-194](https://github.com/apache/cordova-plugin-geolocation/pull/194) docs: Removed misleading text -* [GH-181](https://github.com/apache/cordova-plugin-geolocation/pull/181) Add missing information for **iOS** -* [GH-193](https://github.com/apache/cordova-plugin-geolocation/pull/193) ci: updates Node.js versions -* [GH-192](https://github.com/apache/cordova-plugin-geolocation/pull/192) chore(npm): improve ignore list -* [GH-189](https://github.com/apache/cordova-plugin-geolocation/pull/189) Variable for Require GPS Hardware -* ci(travis): upgrade to node8 - -### 4.0.2 (Jun 27, 2019) - -- chore: fix repo and issue urls and license in package.json and plugin.xml ([`4d2e901`](https://github.com/apache/cordova-plugin-geolocation/commit/4d2e901)) -- build: add `.gitattributes` to force LF (instead of possible CRLF on Windows) ([`74417bb`](https://github.com/apache/cordova-plugin-geolocation/commit/74417bb)) -- build: add `.npmignore` to remove unneeded files from npm package ([`d4a1ac5`](https://github.com/apache/cordova-plugin-geolocation/commit/d4a1ac5)) -- ci(travis): Update Travis CI configuration for new paramedic ([#154](https://github.com/apache/cordova-plugin-geolocation/issues/154)) ([`1636d98`](https://github.com/apache/cordova-plugin-geolocation/commit/1636d98)) -- chore(github): Add or update GitHub pull request and issue template ([`6fd7847`](https://github.com/apache/cordova-plugin-geolocation/commit/6fd7847)) -- docs: remove JIRA link ([`2fc992b`](https://github.com/apache/cordova-plugin-geolocation/commit/2fc992b)) -- docs: Remove outdated docs translations ([#117](https://github.com/apache/cordova-plugin-geolocation/issues/117)) ([`9408fdd`](https://github.com/apache/cordova-plugin-geolocation/commit/9408fdd)) -- ci(travis): add android-27 to `android update sdk -u --filter` ([`3b1f63a`](https://github.com/apache/cordova-plugin-geolocation/commit/3b1f63a)) -- fix(ios): [CB-14020](https://issues.apache.org/jira/browse/CB-14020) (ios) Fix "Collection was mutated while being enumerated" crash ([#104](https://github.com/apache/cordova-plugin-geolocation/issues/104)) ([`ba45595`](https://github.com/apache/cordova-plugin-geolocation/commit/ba45595)) -- docs: Add Apache Cordova issue tracker link to Readme ([#107](https://github.com/apache/cordova-plugin-geolocation/issues/107)) ([`91c7313`](https://github.com/apache/cordova-plugin-geolocation/commit/91c7313)) -- ci(travis): [CB-13748](https://issues.apache.org/jira/browse/CB-13748) Add build-tools-26.0.2 to travis ([#103](https://github.com/apache/cordova-plugin-geolocation/issues/103)) ([`a6cbe40`](https://github.com/apache/cordova-plugin-geolocation/commit/a6cbe40), [`e74c87a`](https://github.com/apache/cordova-plugin-geolocation/commit/e74c87a)) -- docs: Fix release notes ([#102](https://github.com/apache/cordova-plugin-geolocation/issues/102)) ([`e679a5d`](https://github.com/apache/cordova-plugin-geolocation/commit/e679a5d)) - - -### 4.0.1 (Dec 27, 2017) -* [CB-13705](https://issues.apache.org/jira/browse/CB-13705) Fix to allow 4.0.0 version install - -### 4.0.0 (Dec 15, 2017) -* [CB-13664](https://issues.apache.org/jira/browse/CB-13664) remove deprecated platforms - -### 3.0.0 (Nov 06, 2017) -* [CB-13267](https://issues.apache.org/jira/browse/CB-13267) (iOS): Remove **iOS** usage descriptions -* [CB-13516](https://issues.apache.org/jira/browse/CB-13516) (all): Add 'protective' entry to `cordovaDependencies` -* [CB-13472](https://issues.apache.org/jira/browse/CB-13472) (CI) Fixed Travis **Android** builds again -* [CB-13294](https://issues.apache.org/jira/browse/CB-13294) Remove `cordova-plugin-compat` -* [CB-13299](https://issues.apache.org/jira/browse/CB-13299) (CI) Fix **Android** builds -* [CB-12895](https://issues.apache.org/jira/browse/CB-12895) added `eslint` and removed `jshint` -* [CB-12847](https://issues.apache.org/jira/browse/CB-12847) added `bugs` entry to `package.json`. - -### 2.4.3 (Apr 27, 2017) -* [CB-12622](https://issues.apache.org/jira/browse/CB-12622) Added **Android 6.0** build badge to `README` -* [CB-12685](https://issues.apache.org/jira/browse/CB-12685) added `package.json` to tests folder - -### 2.4.2 (Feb 28, 2017) -* [CB-12363](https://issues.apache.org/jira/browse/CB-12363) Added build badges for **iOS 9.3** and **iOS 10.0** -* [CB-12230](https://issues.apache.org/jira/browse/CB-12230) Removed **Windows 8.1** build badges - -### 2.4.1 (Dec 07, 2016) -* [CB-12224](https://issues.apache.org/jira/browse/CB-12224) Updated version and RELEASENOTES.md for release 2.4.1 -* corrected KCLAuthorizationStatus error, changed to always removed user of [manager locationServicesEnabled]. Must return [CLLocationManager locationServicesEnabled] or 'none' -* [CB-11962](https://issues.apache.org/jira/browse/CB-11962) (ios) Added variable for setting NSLocationWhenInUseUsageDescription -* [CB-11917](https://issues.apache.org/jira/browse/CB-11917) - Remove pull request template checklist item: "iCLA has been submitted…" -* [CB-11904](https://issues.apache.org/jira/browse/CB-11904) Incremented plugin version. - -### 2.4.0 (Sep 26, 2016) -* **Ubuntu** Fix altitude & accuracies retrieval -* [CB-11875](https://issues.apache.org/jira/browse/CB-11875) added `android.hardware.location.gps` `uses-feature`. - -### 2.3.0 (Sep 08, 2016) -* [CB-11795](https://issues.apache.org/jira/browse/CB-11795) Add 'protective' entry to cordovaDependencies -* Plugin uses `Android Log class` and not `Cordova LOG class` -* Add badges for paramedic builds on Jenkins -* Add pull request template. -* Adding links to reference content and sample content to the top of the readme file -* Update **iOS** geolocation plugin to avoid `THREAD WARNING: ['Geolocation']`, operation occurs in new Thread -* [CB-10996](https://issues.apache.org/jira/browse/CB-10996) Adding front matter to README.md - -### 2.2.0 (Apr 15, 2016) -* Replace `PermissionHelper.java` with `cordova-plugin-compat` -* [CB-10691](https://issues.apache.org/jira/browse/CB-10691) Check the context to avoid null errors -* [CB-10636](https://issues.apache.org/jira/browse/CB-10636) Add `JSHint` for plugins -* Using a fallback epsilon in case `Number.EPSILON` is not defined. -* [CB-10574](https://issues.apache.org/jira/browse/CB-10574) MobileSpec can't get results for **WP8.1** Builds - -### 2.1.0 (Jan 15, 2016) -* [CB-10319](https://issues.apache.org/jira/browse/CB-10319) **Android** Adding reflective helper methods for permission requests -* [CB-8523](https://issues.apache.org/jira/browse/CB-8523) Fixed accuracy when `enableHighAccuracy: false` on **iOS**. -* [CB-10286](https://issues.apache.org/jira/browse/CB-10286) Don't skip automatic tests on **Android** devices -* [CB-10277](https://issues.apache.org/jira/browse/CB-10277) Error callback should be called w/ `PositionError` when location access is denied -* [CB-10285](https://issues.apache.org/jira/browse/CB-10285) Added tests for `PositionError` constants -* [CB-10278](https://issues.apache.org/jira/browse/CB-10278) geolocation `watchPosition` doesn't return `watchID` string -* [CB-8443](https://issues.apache.org/jira/browse/CB-8443) **Android** nothing happens if `GPS` is turned off -* [CB-10204](https://issues.apache.org/jira/browse/CB-10204) Fix `getCurrentPosition` options on **Android** -* [CB-7146](https://issues.apache.org/jira/browse/CB-7146) Remove built-in `WebView navigator.geolocation` manual tests -* [CB-2845](https://issues.apache.org/jira/browse/CB-2845) `PositionError` constants not attached to prototype as specified in W3C document - -### 2.0.0 (Nov 18, 2015) -* [CB-10035](https://issues.apache.org/jira/browse/CB-10035) Updated `RELEASENOTES` to be newest to oldest -* [CB-9907](https://issues.apache.org/jira/browse/CB-9907) Handle **iOS** tests that fail when ios simulator does not have a location -* [CB-8826](https://issues.apache.org/jira/browse/CB-8826) Check for `NSLocationWhenInUseUsageDescription` first -* [CB-9105](https://issues.apache.org/jira/browse/CB-9105): Fixing `JS` errors in the shim -* Added support for new permissions model for **Android 6.0** aka **Marshmallow** -* Expect `lastPosition` to have a `timestamp` that is already in `msecs` -* [CB-4596](https://issues.apache.org/jira/browse/CB-4596) Date objects are supposed to be `DOMTimeStamp` -* Fixing contribute link. -* [CB-9355](https://issues.apache.org/jira/browse/CB-9355) Fix Geolocation plugin start watch fail related to unset `MovementThreshold` on **Windows 10** - -### 1.0.1 (Jun 17, 2015) -* [CB-9128](https://issues.apache.org/jira/browse/CB-9128) cordova-plugin-geolocation documentation translation: cordova-plugin-geolocation -* fix npm md issue -* [CB-8845](https://issues.apache.org/jira/browse/CB-8845) Updated comment why Android tests are currently pended -* [CB-8845](https://issues.apache.org/jira/browse/CB-8845) Pended tests for Android -* Add more install text for legacy versions of cordova tools. This closes #36 - -### 1.0.0 (Apr 15, 2015) -* [CB-8746](https://issues.apache.org/jira/browse/CB-8746) gave plugin major version bump -* [CB-8683](https://issues.apache.org/jira/browse/CB-8683) changed plugin-id to pacakge-name -* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) properly updated translated docs to use new id -* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) updated translated docs to use new id -* Use TRAVIS_BUILD_DIR, install paramedic by npm -* [CB-8681](https://issues.apache.org/jira/browse/CB-8681) Fixed occasional test failures -* docs: added Windows to supported platforms -* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) Updated Readme -* [CB-8659](https://issues.apache.org/jira/browse/CB-8659): ios: 4.0.x Compatibility: Remove use of initWebView method -* [CB-8659](https://issues.apache.org/jira/browse/CB-8659): ios: 4.0.x Compatibility: Remove use of deprecated headers -* Wrong parameter in Firefox OS plugin -* [CB-8568](https://issues.apache.org/jira/browse/CB-8568) Integrate TravisCI -* [CB-8438](https://issues.apache.org/jira/browse/CB-8438) cordova-plugin-geolocation documentation translation: cordova-plugin-geolocation -* [CB-8538](https://issues.apache.org/jira/browse/CB-8538) Added package.json file -* [CB-8443](https://issues.apache.org/jira/browse/CB-8443) Geolocation tests fail on Windows due to done is called multiple times - -### 0.3.12 (Feb 04, 2015) -* [CB-8351](https://issues.apache.org/jira/browse/CB-8351) ios: Use argumentForIndex rather than NSArray extension - -### 0.3.11 (Dec 02, 2014) -* Do not stop updating location when the error is `kCLErrorLocationUnknown` -* [CB-8094](https://issues.apache.org/jira/browse/CB-8094) Pended auto tests for **Windows** Store since they require user interaction -* [CB-8085](https://issues.apache.org/jira/browse/CB-8085) Fix geolocation plugin on **Windows** -* [CB-7977](https://issues.apache.org/jira/browse/CB-7977) Mention `deviceready` in plugin docs -* [CB-7700](https://issues.apache.org/jira/browse/CB-7700) cordova-plugin-geolocation documentation translation: cordova-plugin-geolocation - -### 0.3.10 (Sep 17, 2014) -* [CB-7556](https://issues.apache.org/jira/browse/CB-7556) iOS: Clearing all Watches does not stop Location Services -* [CB-7158](https://issues.apache.org/jira/browse/CB-7158) Fix geolocation for ios 8 -* Revert [CB-6911](https://issues.apache.org/jira/browse/CB-6911) partially (keeping Info.plist key installation for iOS 8) -* [CB-6911](https://issues.apache.org/jira/browse/CB-6911) Geolocation fails in iOS 8 -* [CB-5114](https://issues.apache.org/jira/browse/CB-5114) **Windows 8.1** - Use a new proxy as old geolocation methods is deprecated -* [CB-5114](https://issues.apache.org/jira/browse/CB-5114) Append **Windows 8.1** into plugin.xml + Optimize Windows 8 Geolocation proxy -* Renamed test dir, added nested plugin.xml -* added documentation for manual tests -* [CB-7146](https://issues.apache.org/jira/browse/CB-7146) Added manual tests -* Removed js-module for tests from plugin.xml -* Changing cdvtest format to use module exports -* register tests using new style -* Convert tests to new style -* Removed amazon-fireos code for geolocation. -* [CB-7571](https://issues.apache.org/jira/browse/CB-7571) Bump version of nested plugin to match parent plugin - -### 0.3.9 (Aug 06, 2014) -* **FFOS** update GeolocationProxy.js -* [CB-7187](https://issues.apache.org/jira/browse/CB-7187) ios: Add explicit dependency on CoreLocation.framework -* [CB-7187](https://issues.apache.org/jira/browse/CB-7187) Delete unused #import of CDVShared.h -* [CB-6127](https://issues.apache.org/jira/browse/CB-6127) Updated translations for docs -* ios: Changed distanceFilter from none to 5 meters, prevents it from spamming the callback even though nothing changed. - -### 0.3.8 (Jun 05, 2014) -* [CB-6127](https://issues.apache.org/jira/browse/CB-6127) Spanish and French Translations added. Github close #14 -* [CB-6804](https://issues.apache.org/jira/browse/CB-6804) Add license -* [CB-5416](https://issues.apache.org/jira/browse/CB-5416) - Adding support for auto-managing permissions -* [CB-6491](https://issues.apache.org/jira/browse/CB-6491) add CONTRIBUTING.md -* pass by only coords -* proper implementation for firefoxos -* call FxOS's getCurrentProxy added - -### 0.3.7 (Apr 17, 2014) -* [CB-6422](https://issues.apache.org/jira/browse/CB-6422): [windows8] use cordova/exec/proxy -* [CB-6212](https://issues.apache.org/jira/browse/CB-6212): [iOS] fix warnings compiled under arm64 64-bit -* [CB-5977](https://issues.apache.org/jira/browse/CB-5977): [android] Removing the Android Geolocation Code. Mission Accomplished. -* [CB-6460](https://issues.apache.org/jira/browse/CB-6460): Update license headers -* Add NOTICE file - -### 0.3.6 (Feb 05, 2014) -* add ubuntu platform support -* [CB-5326](https://issues.apache.org/jira/browse/CB-5326) adding FFOS permission and updating supported platforms -* [CB-5729](https://issues.apache.org/jira/browse/CB-5729) [BlackBerry10] Update GeolocationProxy to return collapsed object - -### 0.3.5 (Jan 02, 2014) -* [CB-5658](https://issues.apache.org/jira/browse/CB-5658) Add doc/index.md for Geolocation plugin -* windows8: adds missing reference to PositionError (w/o it the app crashes) -* Removing incorrectly added closing comments for wp7 platform in plugin.xml - -### 0.3.4 (Dec 4, 2013) -* Append proxy to platform definition in plugin.xml -* Append windows 8 Geolocation proxy -* Code clean-up for android src. -* Updated amazon-fireos platform + reverting some of the fixes in android code. -* Added amazon-fireos platform + some of the fixes in android code. -* [CB-5334](https://issues.apache.org/jira/browse/CB-5334) [BlackBerry10] Use command proxy -* call FxOS's getCurrentProxy added -* pass by only coords -* proper implementation for firefoxos - -### 0.3.3 (Oct 28, 2013) -* [CB-5128](https://issues.apache.org/jira/browse/CB-5128): add repo + issue tag to plugin.xml for geolocation plugin -* [CB-4915](https://issues.apache.org/jira/browse/CB-4915) Incremented plugin version on dev branch. - -### 0.3.2 (Sept 25, 2013) -* [CB-4889](https://issues.apache.org/jira/browse/CB-4889) bumping&resetting version -* [BlackBerry10] removed uneeded permission tags in plugin.xml -* [CB-4889](https://issues.apache.org/jira/browse/CB-4889) renaming org.apache.cordova.core.geolocation to org.apache.cordova.geolocation - -### 0.3.0 (Sept 5, 2013) -* Added support for windows 8 (Adds required permission) diff --git a/RecipeGenie/plugins/cordova-plugin-geolocation/package.json b/RecipeGenie/plugins/cordova-plugin-geolocation/package.json deleted file mode 100644 index eb64258..0000000 --- a/RecipeGenie/plugins/cordova-plugin-geolocation/package.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "cordova-plugin-geolocation", - "version": "5.0.0", - "description": "Cordova Geolocation Plugin", - "cordova": { - "id": "cordova-plugin-geolocation", - "platforms": [ - "android", - "ios", - "windows" - ] - }, - "repository": "github:apache/cordova-plugin-geolocation", - "bugs": "https://github.com/apache/cordova-plugin-geolocation/issues", - "keywords": [ - "cordova", - "geolocation", - "ecosystem:cordova", - "cordova-android", - "cordova-ios", - "cordova-windows" - ], - "scripts": { - "test": "npm run lint", - "lint": "eslint ." - }, - "author": "Apache Software Foundation", - "license": "Apache-2.0", - "engines": { - "cordovaDependencies": { - "3.0.0": { - "cordova-android": ">=6.3.0" - }, - "6.0.0": { - "cordova": ">100" - } - } - }, - "devDependencies": { - "@cordova/eslint-config": "^5.0.0" - } -} diff --git a/RecipeGenie/plugins/cordova-plugin-geolocation/plugin.xml b/RecipeGenie/plugins/cordova-plugin-geolocation/plugin.xml deleted file mode 100644 index e8830f2..0000000 --- a/RecipeGenie/plugins/cordova-plugin-geolocation/plugin.xml +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - Geolocation - Cordova Geolocation Plugin - Apache 2.0 - cordova,geolocation - https://github.com/apache/cordova-plugin-geolocation - https://github.com/apache/cordova-plugin-geolocation/issues - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/RecipeGenie/plugins/cordova-plugin-geolocation/src/android/Geolocation.java b/RecipeGenie/plugins/cordova-plugin-geolocation/src/android/Geolocation.java deleted file mode 100644 index d8cae0e..0000000 --- a/RecipeGenie/plugins/cordova-plugin-geolocation/src/android/Geolocation.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - - -package org.apache.cordova.geolocation; - -import android.content.pm.PackageManager; -import android.Manifest; -import android.os.Build; - -import org.apache.cordova.CallbackContext; -import org.apache.cordova.CordovaPlugin; -import org.apache.cordova.PermissionHelper; -import org.apache.cordova.PluginResult; -import org.apache.cordova.LOG; -import org.json.JSONArray; -import org.json.JSONException; - - -public class Geolocation extends CordovaPlugin { - - String TAG = "GeolocationPlugin"; - CallbackContext context; - - - String [] highAccuracyPermissions = { Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION }; - String [] lowAccuracyPermissions = { Manifest.permission.ACCESS_COARSE_LOCATION }; - String [] permissionsToRequest; - String[] permissionsToCheck; - - - public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException { - LOG.d(TAG, "We are entering execute"); - context = callbackContext; - if(action.equals("getPermission")) - { - boolean highAccuracy = args.getBoolean(0); - permissionsToCheck = highAccuracy ? highAccuracyPermissions : lowAccuracyPermissions; - - // Always request both FINE & COARSE permissions on API <= 31 due to bug in WebView that manifests on these versions - // See https://bugs.chromium.org/p/chromium/issues/detail?id=1269362 - permissionsToRequest = Build.VERSION.SDK_INT <= 31 ? highAccuracyPermissions : permissionsToCheck; - - if(hasPermisssion(permissionsToCheck)) - { - PluginResult r = new PluginResult(PluginResult.Status.OK, Build.VERSION.SDK_INT); - context.sendPluginResult(r); - return true; - } - else { - PermissionHelper.requestPermissions(this, 0, permissionsToRequest); - } - return true; - } - return false; - } - - - public void onRequestPermissionResult(int requestCode, String[] permissions, - int[] grantResults) throws JSONException - { - PluginResult result; - //This is important if we're using Cordova without using Cordova, but we have the geolocation plugin installed - if(context != null) { - for (int i=0; i boolean arrayContains(final T[] array, final T v) { - if (v == null) { - for (final T e : array) - if (e == null) - return true; - } - else { - for (final T e : array) - if (e == v || v.equals(e)) - return true; - } - - return false; - } - -} diff --git a/RecipeGenie/plugins/cordova-plugin-geolocation/src/ios/CDVLocation.h b/RecipeGenie/plugins/cordova-plugin-geolocation/src/ios/CDVLocation.h deleted file mode 100644 index cce2738..0000000 --- a/RecipeGenie/plugins/cordova-plugin-geolocation/src/ios/CDVLocation.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import -#import -#import - -enum CDVLocationStatus { - PERMISSIONDENIED = 1, - POSITIONUNAVAILABLE, - TIMEOUT -}; -typedef NSUInteger CDVLocationStatus; - -// simple object to keep track of location information -@interface CDVLocationData : NSObject { - CDVLocationStatus locationStatus; - NSMutableArray* locationCallbacks; - NSMutableDictionary* watchCallbacks; - CLLocation* locationInfo; -} - -@property (nonatomic, assign) CDVLocationStatus locationStatus; -@property (nonatomic, strong) CLLocation* locationInfo; -@property (nonatomic, strong) NSMutableArray* locationCallbacks; -@property (nonatomic, strong) NSMutableDictionary* watchCallbacks; - -@end - -@interface CDVLocation : CDVPlugin { - @private BOOL __locationStarted; - @private BOOL __highAccuracyEnabled; - CDVLocationData* locationData; -} - -@property (nonatomic, strong) CLLocationManager* locationManager; -@property (nonatomic, strong) CDVLocationData* locationData; - -- (void)getLocation:(CDVInvokedUrlCommand*)command; -- (void)addWatch:(CDVInvokedUrlCommand*)command; -- (void)clearWatch:(CDVInvokedUrlCommand*)command; -- (void)returnLocationInfo:(NSString*)callbackId andKeepCallback:(BOOL)keepCallback; -- (void)returnLocationError:(NSUInteger)errorCode withMessage:(NSString*)message; -- (void)startLocation:(BOOL)enableHighAccuracy; - -- (void)locationManager:(CLLocationManager*)manager - didUpdateToLocation:(CLLocation*)newLocation - fromLocation:(CLLocation*)oldLocation; - -- (void)locationManager:(CLLocationManager*)manager - didFailWithError:(NSError*)error; - -- (BOOL)isLocationServicesEnabled; -@end diff --git a/RecipeGenie/plugins/cordova-plugin-geolocation/src/ios/CDVLocation.m b/RecipeGenie/plugins/cordova-plugin-geolocation/src/ios/CDVLocation.m deleted file mode 100644 index 84bdf15..0000000 --- a/RecipeGenie/plugins/cordova-plugin-geolocation/src/ios/CDVLocation.m +++ /dev/null @@ -1,379 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import "CDVLocation.h" - -#pragma mark Constants - -#define kPGLocationErrorDomain @"kPGLocationErrorDomain" -#define kPGLocationDesiredAccuracyKey @"desiredAccuracy" -#define kPGLocationForcePromptKey @"forcePrompt" -#define kPGLocationDistanceFilterKey @"distanceFilter" -#define kPGLocationFrequencyKey @"frequency" - -#pragma mark - -#pragma mark Categories - -@implementation CDVLocationData - -@synthesize locationStatus, locationInfo, locationCallbacks, watchCallbacks; -- (CDVLocationData*)init -{ - self = (CDVLocationData*)[super init]; - if (self) { - self.locationInfo = nil; - self.locationCallbacks = nil; - self.watchCallbacks = nil; - } - return self; -} - -@end - -#pragma mark - -#pragma mark CDVLocation - -@implementation CDVLocation - -@synthesize locationManager, locationData; - -- (void)pluginInitialize -{ - self.locationManager = [[CLLocationManager alloc] init]; - self.locationManager.delegate = self; // Tells the location manager to send updates to this object - __locationStarted = NO; - __highAccuracyEnabled = NO; - self.locationData = nil; -} - -- (BOOL)isAuthorized -{ - BOOL authorizationStatusClassPropertyAvailable = [CLLocationManager respondsToSelector:@selector(authorizationStatus)]; // iOS 4.2+ - - if (authorizationStatusClassPropertyAvailable) { - NSUInteger authStatus = [CLLocationManager authorizationStatus]; -#ifdef __IPHONE_8_0 - if ([self.locationManager respondsToSelector:@selector(requestWhenInUseAuthorization)]) { //iOS 8.0+ - return (authStatus == kCLAuthorizationStatusAuthorizedWhenInUse) || (authStatus == kCLAuthorizationStatusAuthorizedAlways) || (authStatus == kCLAuthorizationStatusNotDetermined); - } -#endif - return (authStatus == kCLAuthorizationStatusAuthorizedAlways) || (authStatus == kCLAuthorizationStatusNotDetermined); - } - - // by default, assume YES (for iOS < 4.2) - return YES; -} - -- (BOOL)isLocationServicesEnabled -{ - BOOL locationServicesEnabledInstancePropertyAvailable = [self.locationManager respondsToSelector:@selector(locationServicesEnabled)]; // iOS 3.x - BOOL locationServicesEnabledClassPropertyAvailable = [CLLocationManager respondsToSelector:@selector(locationServicesEnabled)]; // iOS 4.x - - if (locationServicesEnabledClassPropertyAvailable) { // iOS 4.x - return [CLLocationManager locationServicesEnabled]; - } else { - return NO; - } -} - -- (void)startLocation:(BOOL)enableHighAccuracy -{ - if (![self isLocationServicesEnabled]) { - [self returnLocationError:PERMISSIONDENIED withMessage:@"Location services are not enabled."]; - return; - } - if (![self isAuthorized]) { - NSString* message = nil; - BOOL authStatusAvailable = [CLLocationManager respondsToSelector:@selector(authorizationStatus)]; // iOS 4.2+ - if (authStatusAvailable) { - NSUInteger code = [CLLocationManager authorizationStatus]; - if (code == kCLAuthorizationStatusNotDetermined) { - // could return POSITION_UNAVAILABLE but need to coordinate with other platforms - message = @"User undecided on application's use of location services."; - } else if (code == kCLAuthorizationStatusRestricted) { - message = @"Application's use of location services is restricted."; - } - } - // PERMISSIONDENIED is only PositionError that makes sense when authorization denied - [self returnLocationError:PERMISSIONDENIED withMessage:message]; - - return; - } - -#ifdef __IPHONE_8_0 - NSUInteger code = [CLLocationManager authorizationStatus]; - if (code == kCLAuthorizationStatusNotDetermined && ([self.locationManager respondsToSelector:@selector(requestAlwaysAuthorization)] || [self.locationManager respondsToSelector:@selector(requestWhenInUseAuthorization)])) { //iOS8+ - __highAccuracyEnabled = enableHighAccuracy; - if([[NSBundle mainBundle] objectForInfoDictionaryKey:@"NSLocationWhenInUseUsageDescription"]){ - [self.locationManager requestWhenInUseAuthorization]; - } else if([[NSBundle mainBundle] objectForInfoDictionaryKey:@"NSLocationAlwaysUsageDescription"]) { - [self.locationManager requestAlwaysAuthorization]; - } else { - NSLog(@"[Warning] No NSLocationAlwaysUsageDescription or NSLocationWhenInUseUsageDescription key is defined in the Info.plist file."); - } - return; - } -#endif - - // Tell the location manager to start notifying us of location updates. We - // first stop, and then start the updating to ensure we get at least one - // update, even if our location did not change. - [self.locationManager stopUpdatingLocation]; - [self.locationManager startUpdatingLocation]; - __locationStarted = YES; - if (enableHighAccuracy) { - __highAccuracyEnabled = YES; - // Set distance filter to 5 for a high accuracy. Setting it to "kCLDistanceFilterNone" could provide a - // higher accuracy, but it's also just spamming the callback with useless reports which drain the battery. - self.locationManager.distanceFilter = 5; - // Set desired accuracy to Best. - self.locationManager.desiredAccuracy = kCLLocationAccuracyBest; - } else { - __highAccuracyEnabled = NO; - self.locationManager.distanceFilter = 10; - self.locationManager.desiredAccuracy = kCLLocationAccuracyThreeKilometers; - } -} - -- (void)_stopLocation -{ - if (__locationStarted) { - if (![self isLocationServicesEnabled]) { - return; - } - - [self.locationManager stopUpdatingLocation]; - __locationStarted = NO; - __highAccuracyEnabled = NO; - } -} - -- (void)locationManager:(CLLocationManager*)manager - didUpdateToLocation:(CLLocation*)newLocation - fromLocation:(CLLocation*)oldLocation -{ - CDVLocationData* cData = self.locationData; - - cData.locationInfo = newLocation; - @synchronized (self.locationData.locationCallbacks) { - if (self.locationData.locationCallbacks.count > 0) { - for (NSString* callbackId in self.locationData.locationCallbacks) { - [self returnLocationInfo:callbackId andKeepCallback:NO]; - } - - [self.locationData.locationCallbacks removeAllObjects]; - } - } - if (self.locationData.watchCallbacks.count > 0) { - for (NSString* timerId in self.locationData.watchCallbacks) { - [self returnLocationInfo:[self.locationData.watchCallbacks objectForKey:timerId] andKeepCallback:YES]; - } - } else { - // No callbacks waiting on us anymore, turn off listening. - [self _stopLocation]; - } -} - -- (void)getLocation:(CDVInvokedUrlCommand*)command -{ - [self.commandDelegate runInBackground:^{ - NSString* callbackId = command.callbackId; - BOOL enableHighAccuracy = [[command argumentAtIndex:0] boolValue]; - - if ([self isLocationServicesEnabled] == NO) { - NSMutableDictionary* posError = [NSMutableDictionary dictionaryWithCapacity:2]; - [posError setObject:[NSNumber numberWithInt:PERMISSIONDENIED] forKey:@"code"]; - [posError setObject:@"Location services are disabled." forKey:@"message"]; - CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:posError]; - [self.commandDelegate sendPluginResult:result callbackId:callbackId]; - } else { - if (!self.locationData) { - self.locationData = [[CDVLocationData alloc] init]; - } - CDVLocationData* lData = self.locationData; - @synchronized (self.locationData.locationCallbacks) { - if (!lData.locationCallbacks) { - lData.locationCallbacks = [NSMutableArray arrayWithCapacity:1]; - } - } - - if (!__locationStarted || (__highAccuracyEnabled != enableHighAccuracy)) { - // add the callbackId into the array so we can call back when get data - @synchronized (self.locationData.locationCallbacks) { - if (callbackId != nil) { - [lData.locationCallbacks addObject:callbackId]; - } - } - // Tell the location manager to start notifying us of heading updates - [self startLocation:enableHighAccuracy]; - } else { - [self returnLocationInfo:callbackId andKeepCallback:NO]; - } - } - }]; -} - -- (void)addWatch:(CDVInvokedUrlCommand*)command -{ - NSString* callbackId = command.callbackId; - NSString* timerId = [command argumentAtIndex:0]; - BOOL enableHighAccuracy = [[command argumentAtIndex:1] boolValue]; - - if (!self.locationData) { - self.locationData = [[CDVLocationData alloc] init]; - } - CDVLocationData* lData = self.locationData; - - if (!lData.watchCallbacks) { - lData.watchCallbacks = [NSMutableDictionary dictionaryWithCapacity:1]; - } - - // add the callbackId into the dictionary so we can call back whenever get data - [lData.watchCallbacks setObject:callbackId forKey:timerId]; - - if ([self isLocationServicesEnabled] == NO) { - NSMutableDictionary* posError = [NSMutableDictionary dictionaryWithCapacity:2]; - [posError setObject:[NSNumber numberWithInt:PERMISSIONDENIED] forKey:@"code"]; - [posError setObject:@"Location services are disabled." forKey:@"message"]; - CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:posError]; - [self.commandDelegate sendPluginResult:result callbackId:callbackId]; - } else { - if (!__locationStarted || (__highAccuracyEnabled != enableHighAccuracy)) { - // Tell the location manager to start notifying us of location updates - [self startLocation:enableHighAccuracy]; - } - } -} - -- (void)clearWatch:(CDVInvokedUrlCommand*)command -{ - NSString* timerId = [command argumentAtIndex:0]; - - if (self.locationData && self.locationData.watchCallbacks && [self.locationData.watchCallbacks objectForKey:timerId]) { - [self.locationData.watchCallbacks removeObjectForKey:timerId]; - if([self.locationData.watchCallbacks count] == 0) { - [self _stopLocation]; - } - } -} - -- (void)stopLocation:(CDVInvokedUrlCommand*)command -{ - [self _stopLocation]; -} - -- (void)returnLocationInfo:(NSString*)callbackId andKeepCallback:(BOOL)keepCallback -{ - CDVPluginResult* result = nil; - CDVLocationData* lData = self.locationData; - - if (lData && !lData.locationInfo) { - // return error - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageToErrorObject:POSITIONUNAVAILABLE]; - } else if (lData && lData.locationInfo) { - CLLocation* lInfo = lData.locationInfo; - NSMutableDictionary* returnInfo = [NSMutableDictionary dictionaryWithCapacity:8]; - NSNumber* timestamp = [NSNumber numberWithDouble:([lInfo.timestamp timeIntervalSince1970] * 1000)]; - [returnInfo setObject:timestamp forKey:@"timestamp"]; - [returnInfo setObject:[NSNumber numberWithDouble:lInfo.speed] forKey:@"velocity"]; - [returnInfo setObject:[NSNumber numberWithDouble:lInfo.verticalAccuracy] forKey:@"altitudeAccuracy"]; - [returnInfo setObject:[NSNumber numberWithDouble:lInfo.horizontalAccuracy] forKey:@"accuracy"]; - [returnInfo setObject:[NSNumber numberWithDouble:lInfo.course] forKey:@"heading"]; - [returnInfo setObject:[NSNumber numberWithDouble:lInfo.altitude] forKey:@"altitude"]; - [returnInfo setObject:[NSNumber numberWithDouble:lInfo.coordinate.latitude] forKey:@"latitude"]; - [returnInfo setObject:[NSNumber numberWithDouble:lInfo.coordinate.longitude] forKey:@"longitude"]; - - if([NSJSONSerialization isValidJSONObject:returnInfo]){ - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:returnInfo]; - [result setKeepCallbackAsBool:keepCallback]; - }else{ - // return error - result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageToErrorObject:POSITIONUNAVAILABLE]; - } - } - if (result) { - [self.commandDelegate sendPluginResult:result callbackId:callbackId]; - } -} - -- (void)returnLocationError:(NSUInteger)errorCode withMessage:(NSString*)message -{ - NSMutableDictionary* posError = [NSMutableDictionary dictionaryWithCapacity:2]; - - [posError setObject:[NSNumber numberWithUnsignedInteger:errorCode] forKey:@"code"]; - [posError setObject:message ? message:@"" forKey:@"message"]; - CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:posError]; - - - @synchronized (self.locationData.locationCallbacks) { - for (NSString* callbackId in self.locationData.locationCallbacks) { - [self.commandDelegate sendPluginResult:result callbackId:callbackId]; - } - - [self.locationData.locationCallbacks removeAllObjects]; - } - - for (NSString* callbackId in self.locationData.watchCallbacks) { - [self.commandDelegate sendPluginResult:result callbackId:callbackId]; - } -} - -- (void)locationManager:(CLLocationManager*)manager didFailWithError:(NSError*)error -{ - NSLog(@"locationManager::didFailWithError %@", [error localizedFailureReason]); - - CDVLocationData* lData = self.locationData; - if (lData && __locationStarted) { - // TODO: probably have to once over the various error codes and return one of: - // PositionError.PERMISSION_DENIED = 1; - // PositionError.POSITION_UNAVAILABLE = 2; - // PositionError.TIMEOUT = 3; - NSUInteger positionError = POSITIONUNAVAILABLE; - if (error.code == kCLErrorDenied) { - positionError = PERMISSIONDENIED; - } - [self returnLocationError:positionError withMessage:[error localizedDescription]]; - } - - if (error.code != kCLErrorLocationUnknown) { - [self.locationManager stopUpdatingLocation]; - __locationStarted = NO; - } -} - -//iOS8+ --(void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status -{ - if(!__locationStarted){ - [self startLocation:__highAccuracyEnabled]; - } -} - -- (void)dealloc -{ - self.locationManager.delegate = nil; -} - -- (void)onReset -{ - [self _stopLocation]; - [self.locationManager stopUpdatingHeading]; -} - -@end diff --git a/RecipeGenie/plugins/cordova-plugin-geolocation/www/Coordinates.js b/RecipeGenie/plugins/cordova-plugin-geolocation/www/Coordinates.js deleted file mode 100644 index 6ef2166..0000000 --- a/RecipeGenie/plugins/cordova-plugin-geolocation/www/Coordinates.js +++ /dev/null @@ -1,69 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -/** - * This class contains position information. - * @param {Object} lat - * @param {Object} lng - * @param {Object} alt - * @param {Object} acc - * @param {Object} head - * @param {Object} vel - * @param {Object} altacc - * @constructor - */ -const Coordinates = function (lat, lng, alt, acc, head, vel, altacc) { - /** - * The latitude of the position. - */ - this.latitude = lat; - /** - * The longitude of the position, - */ - this.longitude = lng; - /** - * The accuracy of the position. - */ - this.accuracy = acc; - /** - * The altitude of the position. - */ - this.altitude = alt !== undefined ? alt : null; - /** - * The direction the device is moving at the position. - */ - this.heading = (typeof head === 'number' && head >= 0 && head <= 360 ? head : null); - /** - * The velocity with which the device is moving at the position. - */ - this.speed = (typeof vel === 'number' && vel >= 0 ? vel : null); - - if (this.speed === 0 || this.speed === null) { - this.heading = NaN; - } - - /** - * The altitude accuracy of the position. - */ - this.altitudeAccuracy = altacc !== undefined ? altacc : null; -}; - -module.exports = Coordinates; diff --git a/RecipeGenie/plugins/cordova-plugin-geolocation/www/Position.js b/RecipeGenie/plugins/cordova-plugin-geolocation/www/Position.js deleted file mode 100644 index f3be1f0..0000000 --- a/RecipeGenie/plugins/cordova-plugin-geolocation/www/Position.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -const Coordinates = require('./Coordinates'); - -const Position = function (coords, timestamp) { - if (coords) { - this.coords = new Coordinates( - coords.latitude, - coords.longitude, - coords.altitude, - coords.accuracy, - coords.heading, - coords.velocity, - coords.altitudeAccuracy - ); - } else { - this.coords = new Coordinates(); - } - this.timestamp = timestamp !== undefined ? timestamp : new Date().getTime(); -}; - -module.exports = Position; diff --git a/RecipeGenie/plugins/cordova-plugin-geolocation/www/PositionError.js b/RecipeGenie/plugins/cordova-plugin-geolocation/www/PositionError.js deleted file mode 100644 index 39d612c..0000000 --- a/RecipeGenie/plugins/cordova-plugin-geolocation/www/PositionError.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -/** - * Position error object - * - * @constructor - * @param code - * @param message - */ -const PositionError = function (code, message) { - this.code = code || null; - this.message = message || ''; -}; - -PositionError.prototype.PERMISSION_DENIED = PositionError.PERMISSION_DENIED = 1; -PositionError.prototype.POSITION_UNAVAILABLE = PositionError.POSITION_UNAVAILABLE = 2; -PositionError.prototype.TIMEOUT = PositionError.TIMEOUT = 3; - -module.exports = PositionError; diff --git a/RecipeGenie/plugins/cordova-plugin-geolocation/www/android/geolocation.js b/RecipeGenie/plugins/cordova-plugin-geolocation/www/android/geolocation.js deleted file mode 100644 index 76192ed..0000000 --- a/RecipeGenie/plugins/cordova-plugin-geolocation/www/android/geolocation.js +++ /dev/null @@ -1,79 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -const exec = cordova.require('cordova/exec'); // eslint-disable-line no-undef -const utils = require('cordova/utils'); -const PositionError = require('./PositionError'); - -// Native watchPosition method is called async after permissions prompt. -// So we use additional map and own ids to return watch id synchronously. -const pluginToNativeWatchMap = {}; - -module.exports = { - getCurrentPosition: function (success, error, args) { - const win = function (deviceApiLevel) { - // Workaround for bug specific to API 31 where requesting `enableHighAccuracy: false` results in TIMEOUT error. - if (deviceApiLevel === 31) { - if (typeof args === 'undefined') args = {}; - args.enableHighAccuracy = true; - } - const geo = cordova.require('cordova/modulemapper').getOriginalSymbol(window, 'navigator.geolocation'); // eslint-disable-line no-undef - geo.getCurrentPosition(success, error, args); - }; - const fail = function () { - if (error) { - error(new PositionError(PositionError.PERMISSION_DENIED, 'Illegal Access')); - } - }; - const enableHighAccuracy = typeof args === 'object' && !!args.enableHighAccuracy; - exec(win, fail, 'Geolocation', 'getPermission', [enableHighAccuracy]); - }, - - watchPosition: function (success, error, args) { - const pluginWatchId = utils.createUUID(); - - const win = function (deviceApiLevel) { - // Workaround for bug specific to API 31 where requesting `enableHighAccuracy: false` results in TIMEOUT error. - if (deviceApiLevel === 31) { - if (typeof args === 'undefined') args = {}; - args.enableHighAccuracy = true; - } - const geo = cordova.require('cordova/modulemapper').getOriginalSymbol(window, 'navigator.geolocation'); // eslint-disable-line no-undef - pluginToNativeWatchMap[pluginWatchId] = geo.watchPosition(success, error, args); - }; - - const fail = function () { - if (error) { - error(new PositionError(PositionError.PERMISSION_DENIED, 'Illegal Access')); - } - }; - const enableHighAccuracy = typeof args === 'object' && !!args.enableHighAccuracy; - exec(win, fail, 'Geolocation', 'getPermission', [enableHighAccuracy]); - - return pluginWatchId; - }, - - clearWatch: function (pluginWatchId) { - const nativeWatchId = pluginToNativeWatchMap[pluginWatchId]; - const geo = cordova.require('cordova/modulemapper').getOriginalSymbol(window, 'navigator.geolocation'); // eslint-disable-line no-undef - geo.clearWatch(nativeWatchId); - } -}; diff --git a/RecipeGenie/plugins/cordova-plugin-geolocation/www/geolocation.js b/RecipeGenie/plugins/cordova-plugin-geolocation/www/geolocation.js deleted file mode 100644 index 58e01be..0000000 --- a/RecipeGenie/plugins/cordova-plugin-geolocation/www/geolocation.js +++ /dev/null @@ -1,216 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -const argscheck = require('cordova/argscheck'); -const utils = require('cordova/utils'); -const exec = require('cordova/exec'); -const PositionError = require('./PositionError'); -const Position = require('./Position'); - -const timers = {}; // list of timers in use - -// Returns default params, overrides if provided with values -function parseParameters (options) { - const opt = { - maximumAge: 0, - enableHighAccuracy: false, - timeout: Infinity - }; - - if (options) { - if (options.maximumAge !== undefined && !isNaN(options.maximumAge) && options.maximumAge > 0) { - opt.maximumAge = options.maximumAge; - } - if (options.enableHighAccuracy !== undefined) { - opt.enableHighAccuracy = options.enableHighAccuracy; - } - if (options.timeout !== undefined && !isNaN(options.timeout)) { - if (options.timeout < 0) { - opt.timeout = 0; - } else { - opt.timeout = options.timeout; - } - } - } - - return opt; -} - -// Returns a timeout failure, closed over a specified timeout value and error callback. -function createTimeout (errorCallback, timeout) { - let t = setTimeout(function () { - clearTimeout(t); - t = null; - errorCallback({ - code: PositionError.TIMEOUT, - message: 'Position retrieval timed out.' - }); - }, timeout); - return t; -} - -const geolocation = { - lastPosition: null, // reference to last known (cached) position returned - /** - * Asynchronously acquires the current position. - * - * @param {Function} successCallback The function to call when the position data is available - * @param {Function} errorCallback The function to call when there is an error getting the heading position. (OPTIONAL) - * @param {PositionOptions} options The options for getting the position data. (OPTIONAL) - */ - getCurrentPosition: function (successCallback, errorCallback, options) { - argscheck.checkArgs('fFO', 'geolocation.getCurrentPosition', arguments); - options = parseParameters(options); - - // Timer var that will fire an error callback if no position is retrieved from native - // before the "timeout" param provided expires - const timeoutTimer = { timer: null }; - - const win = function (p) { - clearTimeout(timeoutTimer.timer); - if (!timeoutTimer.timer) { - // Timeout already happened, or native fired error callback for - // this geo request. - // Don't continue with success callback. - return; - } - const pos = new Position( - { - latitude: p.latitude, - longitude: p.longitude, - altitude: p.altitude, - accuracy: p.accuracy, - heading: p.heading, - velocity: p.velocity, - altitudeAccuracy: p.altitudeAccuracy - }, - p.timestamp - ); - geolocation.lastPosition = pos; - successCallback(pos); - }; - const fail = function (e) { - clearTimeout(timeoutTimer.timer); - timeoutTimer.timer = null; - const err = new PositionError(e.code, e.message); - if (errorCallback) { - errorCallback(err); - } - }; - - // Check our cached position, if its timestamp difference with current time is less than the maximumAge, then just - // fire the success callback with the cached position. - if ( - geolocation.lastPosition && - options.maximumAge && - new Date().getTime() - geolocation.lastPosition.timestamp <= options.maximumAge - ) { - successCallback(geolocation.lastPosition); - // If the cached position check failed and the timeout was set to 0, error out with a TIMEOUT error object. - } else if (options.timeout === 0) { - fail({ - code: PositionError.TIMEOUT, - message: - "timeout value in PositionOptions set to 0 and no cached Position object available, or cached Position object's age exceeds provided PositionOptions' maximumAge parameter." - }); - // Otherwise we have to call into native to retrieve a position. - } else { - if (options.timeout !== Infinity) { - // If the timeout value was not set to Infinity (default), then - // set up a timeout function that will fire the error callback - // if no successful position was retrieved before timeout expired. - timeoutTimer.timer = createTimeout(fail, options.timeout); - } else { - // This is here so the check in the win function doesn't mess stuff up - // may seem weird but this guarantees timeoutTimer is - // always truthy before we call into native - timeoutTimer.timer = true; - } - exec(win, fail, 'Geolocation', 'getLocation', [options.enableHighAccuracy, options.maximumAge]); - } - return timeoutTimer; - }, - /** - * Asynchronously watches the geolocation for changes to geolocation. When a change occurs, - * the successCallback is called with the new location. - * - * @param {Function} successCallback The function to call each time the location data is available - * @param {Function} errorCallback The function to call when there is an error getting the location data. (OPTIONAL) - * @param {PositionOptions} options The options for getting the location data such as frequency. (OPTIONAL) - * @return String The watch id that must be passed to #clearWatch to stop watching. - */ - watchPosition: function (successCallback, errorCallback, options) { - argscheck.checkArgs('fFO', 'geolocation.getCurrentPosition', arguments); - options = parseParameters(options); - - const id = utils.createUUID(); - - // Tell device to get a position ASAP, and also retrieve a reference to the timeout timer generated in getCurrentPosition - timers[id] = geolocation.getCurrentPosition(successCallback, errorCallback, options); - - const fail = function (e) { - clearTimeout(timers[id].timer); - const err = new PositionError(e.code, e.message); - if (errorCallback) { - errorCallback(err); - } - }; - - const win = function (p) { - clearTimeout(timers[id].timer); - if (options.timeout !== Infinity) { - timers[id].timer = createTimeout(fail, options.timeout); - } - const pos = new Position( - { - latitude: p.latitude, - longitude: p.longitude, - altitude: p.altitude, - accuracy: p.accuracy, - heading: p.heading, - velocity: p.velocity, - altitudeAccuracy: p.altitudeAccuracy - }, - p.timestamp - ); - geolocation.lastPosition = pos; - successCallback(pos); - }; - - exec(win, fail, 'Geolocation', 'addWatch', [id, options.enableHighAccuracy]); - - return id; - }, - /** - * Clears the specified heading watch. - * - * @param {String} id The ID of the watch returned from #watchPosition - */ - clearWatch: function (id) { - if (id && timers[id] !== undefined) { - clearTimeout(timers[id].timer); - timers[id].timer = false; - exec(null, null, 'Geolocation', 'clearWatch', [id]); - } - } -}; - -module.exports = geolocation; diff --git a/RecipeGenie/plugins/fetch.json b/RecipeGenie/plugins/fetch.json deleted file mode 100644 index 226f6fe..0000000 --- a/RecipeGenie/plugins/fetch.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "cordova-plugin-geolocation": { - "source": { - "type": "registry", - "id": "cordova-plugin-geolocation@5.0.0" - }, - "is_top_level": true, - "variables": {} - } -} \ No newline at end of file