Skip to content
This repository was archived by the owner on Jan 10, 2024. It is now read-only.

Commit ef0224c

Browse files
augustwsteinmvitanovrobynkoelle14slash12philippzagar
authored
Merge/swiftui swiftuidev (#510)
* Bugfix/482 (#483) * Fix iPad stacks breaking iPhone collapsibles in grades and lectures * Fix weird spacing in lectures list due to nested VStacks * Fix grades screen showing error upon login * Fix discrepancy in MenuPickerStyle between ios 15 and 16 * Fix resfresh of authericated information after sign out Co-authored-by: Milen Vitanov <m.vitanov@tum.de> * Feature/analytics (#484) * Feature/widget views (#472) * Add empty widget view * Add tuition widget * Add Cafeteria Widget * Cycle through menu items in cafeteria widget * Add allergenics label to cafeteria widget * Add study room widget * Add widget sizes, improve widget visibility * Improve design of tuition fee widget * Implement different size options for CafeteriaWidgetView, remove animations * Make tuition widget compatible with all sizes, improve its design * Make study room widget compatible with all sizes, improve its design * Beautify study room widget * Beautify tuition widget * Change study room widget color to white / dark gray * Change tuition fee widget color to white / dark gray * Add text widget view * Use text widget view in study room widget * Use widget color in widget loading view * Update project file * Beautify cafeteria widget * Remove Color extension * Fix count of available study rooms in large study room widget * Add grades widget * Add profile toolbar to widget screen * Add calendar widget * Fix preview * Add map background to study room widget * Improve study room widget design * Improve tuition widget design * Refactor TuitionWidgetInfoView * Improve cafeteria widget design * Improve grade widget design * Make calendar widget title size consistent with other widgets * Change symbol for widget screen * Improve widget frame previews * Add time based widget recommendations * Use protocols for widget recommender strategies * Add location strategy for widget recommendations * Add spatio-temporal strategy for widget recommendations * Add support for app usage data storage * Collect usage data for calendar, grades, cafeteria, study room, and tuition view * Add functionality to upload and persist analytics data * Add analytics opt-in * Collect data in selected views * Remove widget screen * Consider sheet blocking content for grades analytics * Consider sheet blocking content for calendar analytics * Listen to events for TCA sheets in AppUsageData * Hide API address * WIP - Add AnalyticsStrategy Co-authored-by: robynkoelle <46612010+robynkoelle@users.noreply.github.com> Co-authored-by: Robyn Kölle <robyn.koelle@tum.de> * Textanpassungen RK BA * Revert 495 feature/analytics (#496) * Feature/analytics (#495) * Feature/widget views (#472) * Add empty widget view * Add tuition widget * Add Cafeteria Widget * Cycle through menu items in cafeteria widget * Add allergenics label to cafeteria widget * Add study room widget * Add widget sizes, improve widget visibility * Improve design of tuition fee widget * Implement different size options for CafeteriaWidgetView, remove animations * Make tuition widget compatible with all sizes, improve its design * Make study room widget compatible with all sizes, improve its design * Beautify study room widget * Beautify tuition widget * Change study room widget color to white / dark gray * Change tuition fee widget color to white / dark gray * Add text widget view * Use text widget view in study room widget * Use widget color in widget loading view * Update project file * Beautify cafeteria widget * Remove Color extension * Fix count of available study rooms in large study room widget * Add grades widget * Add profile toolbar to widget screen * Add calendar widget * Fix preview * Add map background to study room widget * Improve study room widget design * Improve tuition widget design * Refactor TuitionWidgetInfoView * Improve cafeteria widget design * Improve grade widget design * Make calendar widget title size consistent with other widgets * Change symbol for widget screen * Improve widget frame previews * Add time based widget recommendations * Use protocols for widget recommender strategies * Add location strategy for widget recommendations * Add spatio-temporal strategy for widget recommendations * Add support for app usage data storage * Collect usage data for calendar, grades, cafeteria, study room, and tuition view * Bugfix/482 (#483) * Fix iPad stacks breaking iPhone collapsibles in grades and lectures * Fix weird spacing in lectures list due to nested VStacks * Fix grades screen showing error upon login * Fix discrepancy in MenuPickerStyle between ios 15 and 16 * Fix resfresh of authericated information after sign out Co-authored-by: Milen Vitanov <m.vitanov@tum.de> * Add functionality to upload and persist analytics data * Add analytics opt-in * Collect data in selected views * Remove widget screen * Consider sheet blocking content for grades analytics * Consider sheet blocking content for calendar analytics * Listen to events for TCA sheets in AppUsageData * Hide API address * WIP - Add AnalyticsStrategy * Update AnalyticsOptInView * Add API secrets file to .gitignore Co-authored-by: robynkoelle <46612010+robynkoelle@users.noreply.github.com> Co-authored-by: Milen Vitanov <milen.vitanov96@gmail.com> Co-authored-by: Milen Vitanov <m.vitanov@tum.de> Co-authored-by: Robyn Kölle <robyn.koelle@tum.de> * Revert "Feature/analytics (#495)" This reverts commit f8a4564. Co-authored-by: robynkoelle <46612010+robynkoelle@users.noreply.github.com> Co-authored-by: Milen Vitanov <milen.vitanov96@gmail.com> Co-authored-by: Milen Vitanov <m.vitanov@tum.de> Co-authored-by: Robyn Kölle <robyn.koelle@tum.de> * Fix/map panel (#500) * Change Map Panel bottom position * Put control of Map Panel into PanelContentView.swift * increase drag area * Map Panel: change top drag area bar to original size * MapPanel: increase Dragarea * MapPanel: remove DragArea Marker * MapPanel: remove view lag when selecting search field * MapPanel: increase Panel DragArea * Improve Code * MapPanel: increase DragArea on Studyroom Group View * improved dragging on different mapPanel views * MapPanel Dragging: bug fixes * stop panel from moving when clicking panelList item * resolve issue: cafeteria annotations not reloading after picker switch * Widget ux improvements (#501) * Feature/widget views (#472) * Add empty widget view * Add tuition widget * Add Cafeteria Widget * Cycle through menu items in cafeteria widget * Add allergenics label to cafeteria widget * Add study room widget * Add widget sizes, improve widget visibility * Improve design of tuition fee widget * Implement different size options for CafeteriaWidgetView, remove animations * Make tuition widget compatible with all sizes, improve its design * Make study room widget compatible with all sizes, improve its design * Beautify study room widget * Beautify tuition widget * Change study room widget color to white / dark gray * Change tuition fee widget color to white / dark gray * Add text widget view * Use text widget view in study room widget * Use widget color in widget loading view * Update project file * Beautify cafeteria widget * Remove Color extension * Fix count of available study rooms in large study room widget * Add grades widget * Add profile toolbar to widget screen * Add calendar widget * Fix preview * Add map background to study room widget * Improve study room widget design * Improve tuition widget design * Refactor TuitionWidgetInfoView * Improve cafeteria widget design * Improve grade widget design * Make calendar widget title size consistent with other widgets * Change symbol for widget screen * Improve widget frame previews * Add time based widget recommendations * Use protocols for widget recommender strategies * Add location strategy for widget recommendations * Add spatio-temporal strategy for widget recommendations * Add support for app usage data storage * Collect usage data for calendar, grades, cafeteria, study room, and tuition view * Feature/analytics (#497) * Fix/design fixes (#473) * MoviesView: Background Text in case no movies are left in a Semester * Calendar: spacing for headerscroll * Mapview: fixed spacer height between list & searchbar -> ipad had weird spacing before * Mapview: fixes in Panel height & positions * Fix/movie card ipad (#474) * Profile View: - adjust App icon change text - adjust version text to darkmode * Movie card view: give fixed size to movie cards to adapt to iPad screen * News Card: weird iPad screen overlap fixed * Fixing the issue when tapping on a news card of the five latest news where got the wrong WebView when WebView was enabled. It was always using the first link. This was because the .sheet() should only be implemented once and the parameter (i.e. the selectedLink) should be changed. In order to do that the URL has to be made identifable. * Profile & Person detail views: fix profile image stretch * Generic Collapsible: Make whole object clickable (before: just text & chevron) * Fix on Portrait Mode on iPhone * Calendar: improve header scroll design * Meal Plan View: adjust "no menus available today" to dark mode * News Card: improve "show more" card design for iPad Co-authored-by: David Lin <davidlin1412@yahoo.de> * Fix/splashscreen (#475) * Add storyboard to fix Launch Screen stretch * - remove original splash screen code - fix launch screen issues on iPad * fix iPad screen issue * Fixing the tower logo to not hide the buttons anymore (#476) * Fixing the tower logo to not hide the buttons anymore * Fixing the login without TUM ID button on landscape mode for iPad 12.9 inch * Removing a border for visualization * Map view: adjust searchbar placeholder to system language Co-authored-by: August Wittgenstein <august.wittgenstein@tum.de> * info.plist add UINewsstandApp = true * info.plist: delete remove newsstand icon error * . (#479) * Fix Typo Mail (#480) * Bugfix/482 (#483) * Fix iPad stacks breaking iPhone collapsibles in grades and lectures * Fix weird spacing in lectures list due to nested VStacks * Fix grades screen showing error upon login * Fix discrepancy in MenuPickerStyle between ios 15 and 16 * Fix resfresh of authericated information after sign out Co-authored-by: Milen Vitanov <m.vitanov@tum.de> * Add functionality to upload and persist analytics data * Add analytics opt-in * Collect data in selected views * Remove widget screen * Consider sheet blocking content for grades analytics * Consider sheet blocking content for calendar analytics * Listen to events for TCA sheets in AppUsageData * Hide API address * WIP - Add AnalyticsStrategy * Feature/analytics (#484) * Feature/widget views (#472) * Add empty widget view * Add tuition widget * Add Cafeteria Widget * Cycle through menu items in cafeteria widget * Add allergenics label to cafeteria widget * Add study room widget * Add widget sizes, improve widget visibility * Improve design of tuition fee widget * Implement different size options for CafeteriaWidgetView, remove animations * Make tuition widget compatible with all sizes, improve its design * Make study room widget compatible with all sizes, improve its design * Beautify study room widget * Beautify tuition widget * Change study room widget color to white / dark gray * Change tuition fee widget color to white / dark gray * Add text widget view * Use text widget view in study room widget * Use widget color in widget loading view * Update project file * Beautify cafeteria widget * Remove Color extension * Fix count of available study rooms in large study room widget * Add grades widget * Add profile toolbar to widget screen * Add calendar widget * Fix preview * Add map background to study room widget * Improve study room widget design * Improve tuition widget design * Refactor TuitionWidgetInfoView * Improve cafeteria widget design * Improve grade widget design * Make calendar widget title size consistent with other widgets * Change symbol for widget screen * Improve widget frame previews * Add time based widget recommendations * Use protocols for widget recommender strategies * Add location strategy for widget recommendations * Add spatio-temporal strategy for widget recommendations * Add support for app usage data storage * Collect usage data for calendar, grades, cafeteria, study room, and tuition view * Add functionality to upload and persist analytics data * Add analytics opt-in * Collect data in selected views * Remove widget screen * Consider sheet blocking content for grades analytics * Consider sheet blocking content for calendar analytics * Listen to events for TCA sheets in AppUsageData * Hide API address * WIP - Add AnalyticsStrategy Co-authored-by: robynkoelle <46612010+robynkoelle@users.noreply.github.com> Co-authored-by: Robyn Kölle <robyn.koelle@tum.de> * Textanpassungen RK BA * Update AnalyticsOptInView * Add API secrets file to .gitignore * Revert 495 feature/analytics (#496) * Feature/analytics (#495) * Feature/widget views (#472) * Add empty widget view * Add tuition widget * Add Cafeteria Widget * Cycle through menu items in cafeteria widget * Add allergenics label to cafeteria widget * Add study room widget * Add widget sizes, improve widget visibility * Improve design of tuition fee widget * Implement different size options for CafeteriaWidgetView, remove animations * Make tuition widget compatible with all sizes, improve its design * Make study room widget compatible with all sizes, improve its design * Beautify study room widget * Beautify tuition widget * Change study room widget color to white / dark gray * Change tuition fee widget color to white / dark gray * Add text widget view * Use text widget view in study room widget * Use widget color in widget loading view * Update project file * Beautify cafeteria widget * Remove Color extension * Fix count of available study rooms in large study room widget * Add grades widget * Add profile toolbar to widget screen * Add calendar widget * Fix preview * Add map background to study room widget * Improve study room widget design * Improve tuition widget design * Refactor TuitionWidgetInfoView * Improve cafeteria widget design * Improve grade widget design * Make calendar widget title size consistent with other widgets * Change symbol for widget screen * Improve widget frame previews * Add time based widget recommendations * Use protocols for widget recommender strategies * Add location strategy for widget recommendations * Add spatio-temporal strategy for widget recommendations * Add support for app usage data storage * Collect usage data for calendar, grades, cafeteria, study room, and tuition view * Bugfix/482 (#483) * Fix iPad stacks breaking iPhone collapsibles in grades and lectures * Fix weird spacing in lectures list due to nested VStacks * Fix grades screen showing error upon login * Fix discrepancy in MenuPickerStyle between ios 15 and 16 * Fix resfresh of authericated information after sign out Co-authored-by: Milen Vitanov <m.vitanov@tum.de> * Add functionality to upload and persist analytics data * Add analytics opt-in * Collect data in selected views * Remove widget screen * Consider sheet blocking content for grades analytics * Consider sheet blocking content for calendar analytics * Listen to events for TCA sheets in AppUsageData * Hide API address * WIP - Add AnalyticsStrategy * Update AnalyticsOptInView * Add API secrets file to .gitignore Co-authored-by: robynkoelle <46612010+robynkoelle@users.noreply.github.com> Co-authored-by: Milen Vitanov <milen.vitanov96@gmail.com> Co-authored-by: Milen Vitanov <m.vitanov@tum.de> Co-authored-by: Robyn Kölle <robyn.koelle@tum.de> * Revert "Feature/analytics (#495)" This reverts commit f8a4564. Co-authored-by: robynkoelle <46612010+robynkoelle@users.noreply.github.com> Co-authored-by: Milen Vitanov <milen.vitanov96@gmail.com> Co-authored-by: Milen Vitanov <m.vitanov@tum.de> Co-authored-by: Robyn Kölle <robyn.koelle@tum.de> * Implement AnalyticsStrategy using CoreML * Add filter for relevant data in AnalyticsStrategy * Disable analytics opt-in and data upload Co-authored-by: August Wittgenstein <75639931+AW-tum@users.noreply.github.com> Co-authored-by: David Lin <davidlin1412@yahoo.de> Co-authored-by: 14slash12 <59373377+14slash12@users.noreply.github.com> Co-authored-by: August Wittgenstein <august.wittgenstein@tum.de> Co-authored-by: Philipp, Zagar <philipp.zagar@gmail.com> Co-authored-by: Milen Vitanov <milen.vitanov96@gmail.com> Co-authored-by: Milen Vitanov <m.vitanov@tum.de> * Use single associated widget for Campus App views * Remove analytics opt-in query in profile view * Enable interactive dismiss for analytics opt-in view * Arrange widgets dynamically on widget screen * Adapt widget size to screen size * Update widget frame design * Add expandable view modifier for widgets * Make calendar widget expandable and tappable * Make grades widget expandable and tappable * Make tuition widget expandable * Make cafeteria widget expandable and tappable * Make study room widget expandable and tappable * Use map image in widget map background view * Use spatio-temporal strategy for widget recommendations * Make expanding widgets more interactive * Request location permission for widgets * Make widgets refreshable * Make rectangle widget size consistent * Support tbd grades in grades widget * Make calendar and study room widgets adapt to screen size better * Make widget screen compatible with iPads * Fix bug where users cannot dismiss the study room group view on the map * Fix cafeteria widget: display real menu, display full meal plan on tap * Use stack navigation style for widget screen * Only show events with future end date in calendar widget * Fix Secrets path * Resolve conflicts Co-authored-by: August Wittgenstein <75639931+AW-tum@users.noreply.github.com> Co-authored-by: David Lin <davidlin1412@yahoo.de> Co-authored-by: 14slash12 <59373377+14slash12@users.noreply.github.com> Co-authored-by: August Wittgenstein <august.wittgenstein@tum.de> Co-authored-by: Philipp, Zagar <philipp.zagar@gmail.com> Co-authored-by: Milen Vitanov <milen.vitanov96@gmail.com> Co-authored-by: Milen Vitanov <m.vitanov@tum.de> * Widget ux improvements (#502) * Feature/widget views (#472) * Add empty widget view * Add tuition widget * Add Cafeteria Widget * Cycle through menu items in cafeteria widget * Add allergenics label to cafeteria widget * Add study room widget * Add widget sizes, improve widget visibility * Improve design of tuition fee widget * Implement different size options for CafeteriaWidgetView, remove animations * Make tuition widget compatible with all sizes, improve its design * Make study room widget compatible with all sizes, improve its design * Beautify study room widget * Beautify tuition widget * Change study room widget color to white / dark gray * Change tuition fee widget color to white / dark gray * Add text widget view * Use text widget view in study room widget * Use widget color in widget loading view * Update project file * Beautify cafeteria widget * Remove Color extension * Fix count of available study rooms in large study room widget * Add grades widget * Add profile toolbar to widget screen * Add calendar widget * Fix preview * Add map background to study room widget * Improve study room widget design * Improve tuition widget design * Refactor TuitionWidgetInfoView * Improve cafeteria widget design * Improve grade widget design * Make calendar widget title size consistent with other widgets * Change symbol for widget screen * Improve widget frame previews * Add time based widget recommendations * Use protocols for widget recommender strategies * Add location strategy for widget recommendations * Add spatio-temporal strategy for widget recommendations * Add support for app usage data storage * Collect usage data for calendar, grades, cafeteria, study room, and tuition view * Feature/analytics (#497) * Fix/design fixes (#473) * MoviesView: Background Text in case no movies are left in a Semester * Calendar: spacing for headerscroll * Mapview: fixed spacer height between list & searchbar -> ipad had weird spacing before * Mapview: fixes in Panel height & positions * Fix/movie card ipad (#474) * Profile View: - adjust App icon change text - adjust version text to darkmode * Movie card view: give fixed size to movie cards to adapt to iPad screen * News Card: weird iPad screen overlap fixed * Fixing the issue when tapping on a news card of the five latest news where got the wrong WebView when WebView was enabled. It was always using the first link. This was because the .sheet() should only be implemented once and the parameter (i.e. the selectedLink) should be changed. In order to do that the URL has to be made identifable. * Profile & Person detail views: fix profile image stretch * Generic Collapsible: Make whole object clickable (before: just text & chevron) * Fix on Portrait Mode on iPhone * Calendar: improve header scroll design * Meal Plan View: adjust "no menus available today" to dark mode * News Card: improve "show more" card design for iPad Co-authored-by: David Lin <davidlin1412@yahoo.de> * Fix/splashscreen (#475) * Add storyboard to fix Launch Screen stretch * - remove original splash screen code - fix launch screen issues on iPad * fix iPad screen issue * Fixing the tower logo to not hide the buttons anymore (#476) * Fixing the tower logo to not hide the buttons anymore * Fixing the login without TUM ID button on landscape mode for iPad 12.9 inch * Removing a border for visualization * Map view: adjust searchbar placeholder to system language Co-authored-by: August Wittgenstein <august.wittgenstein@tum.de> * info.plist add UINewsstandApp = true * info.plist: delete remove newsstand icon error * . (#479) * Fix Typo Mail (#480) * Bugfix/482 (#483) * Fix iPad stacks breaking iPhone collapsibles in grades and lectures * Fix weird spacing in lectures list due to nested VStacks * Fix grades screen showing error upon login * Fix discrepancy in MenuPickerStyle between ios 15 and 16 * Fix resfresh of authericated information after sign out Co-authored-by: Milen Vitanov <m.vitanov@tum.de> * Add functionality to upload and persist analytics data * Add analytics opt-in * Collect data in selected views * Remove widget screen * Consider sheet blocking content for grades analytics * Consider sheet blocking content for calendar analytics * Listen to events for TCA sheets in AppUsageData * Hide API address * WIP - Add AnalyticsStrategy * Feature/analytics (#484) * Feature/widget views (#472) * Add empty widget view * Add tuition widget * Add Cafeteria Widget * Cycle through menu items in cafeteria widget * Add allergenics label to cafeteria widget * Add study room widget * Add widget sizes, improve widget visibility * Improve design of tuition fee widget * Implement different size options for CafeteriaWidgetView, remove animations * Make tuition widget compatible with all sizes, improve its design * Make study room widget compatible with all sizes, improve its design * Beautify study room widget * Beautify tuition widget * Change study room widget color to white / dark gray * Change tuition fee widget color to white / dark gray * Add text widget view * Use text widget view in study room widget * Use widget color in widget loading view * Update project file * Beautify cafeteria widget * Remove Color extension * Fix count of available study rooms in large study room widget * Add grades widget * Add profile toolbar to widget screen * Add calendar widget * Fix preview * Add map background to study room widget * Improve study room widget design * Improve tuition widget design * Refactor TuitionWidgetInfoView * Improve cafeteria widget design * Improve grade widget design * Make calendar widget title size consistent with other widgets * Change symbol for widget screen * Improve widget frame previews * Add time based widget recommendations * Use protocols for widget recommender strategies * Add location strategy for widget recommendations * Add spatio-temporal strategy for widget recommendations * Add support for app usage data storage * Collect usage data for calendar, grades, cafeteria, study room, and tuition view * Add functionality to upload and persist analytics data * Add analytics opt-in * Collect data in selected views * Remove widget screen * Consider sheet blocking content for grades analytics * Consider sheet blocking content for calendar analytics * Listen to events for TCA sheets in AppUsageData * Hide API address * WIP - Add AnalyticsStrategy Co-authored-by: robynkoelle <46612010+robynkoelle@users.noreply.github.com> Co-authored-by: Robyn Kölle <robyn.koelle@tum.de> * Textanpassungen RK BA * Update AnalyticsOptInView * Add API secrets file to .gitignore * Revert 495 feature/analytics (#496) * Feature/analytics (#495) * Feature/widget views (#472) * Add empty widget view * Add tuition widget * Add Cafeteria Widget * Cycle through menu items in cafeteria widget * Add allergenics label to cafeteria widget * Add study room widget * Add widget sizes, improve widget visibility * Improve design of tuition fee widget * Implement different size options for CafeteriaWidgetView, remove animations * Make tuition widget compatible with all sizes, improve its design * Make study room widget compatible with all sizes, improve its design * Beautify study room widget * Beautify tuition widget * Change study room widget color to white / dark gray * Change tuition fee widget color to white / dark gray * Add text widget view * Use text widget view in study room widget * Use widget color in widget loading view * Update project file * Beautify cafeteria widget * Remove Color extension * Fix count of available study rooms in large study room widget * Add grades widget * Add profile toolbar to widget screen * Add calendar widget * Fix preview * Add map background to study room widget * Improve study room widget design * Improve tuition widget design * Refactor TuitionWidgetInfoView * Improve cafeteria widget design * Improve grade widget design * Make calendar widget title size consistent with other widgets * Change symbol for widget screen * Improve widget frame previews * Add time based widget recommendations * Use protocols for widget recommender strategies * Add location strategy for widget recommendations * Add spatio-temporal strategy for widget recommendations * Add support for app usage data storage * Collect usage data for calendar, grades, cafeteria, study room, and tuition view * Bugfix/482 (#483) * Fix iPad stacks breaking iPhone collapsibles in grades and lectures * Fix weird spacing in lectures list due to nested VStacks * Fix grades screen showing error upon login * Fix discrepancy in MenuPickerStyle between ios 15 and 16 * Fix resfresh of authericated information after sign out Co-authored-by: Milen Vitanov <m.vitanov@tum.de> * Add functionality to upload and persist analytics data * Add analytics opt-in * Collect data in selected views * Remove widget screen * Consider sheet blocking content for grades analytics * Consider sheet blocking content for calendar analytics * Listen to events for TCA sheets in AppUsageData * Hide API address * WIP - Add AnalyticsStrategy * Update AnalyticsOptInView * Add API secrets file to .gitignore Co-authored-by: robynkoelle <46612010+robynkoelle@users.noreply.github.com> Co-authored-by: Milen Vitanov <milen.vitanov96@gmail.com> Co-authored-by: Milen Vitanov <m.vitanov@tum.de> Co-authored-by: Robyn Kölle <robyn.koelle@tum.de> * Revert "Feature/analytics (#495)" This reverts commit f8a4564. Co-authored-by: robynkoelle <46612010+robynkoelle@users.noreply.github.com> Co-authored-by: Milen Vitanov <milen.vitanov96@gmail.com> Co-authored-by: Milen Vitanov <m.vitanov@tum.de> Co-authored-by: Robyn Kölle <robyn.koelle@tum.de> * Implement AnalyticsStrategy using CoreML * Add filter for relevant data in AnalyticsStrategy * Disable analytics opt-in and data upload Co-authored-by: August Wittgenstein <75639931+AW-tum@users.noreply.github.com> Co-authored-by: David Lin <davidlin1412@yahoo.de> Co-authored-by: 14slash12 <59373377+14slash12@users.noreply.github.com> Co-authored-by: August Wittgenstein <august.wittgenstein@tum.de> Co-authored-by: Philipp, Zagar <philipp.zagar@gmail.com> Co-authored-by: Milen Vitanov <milen.vitanov96@gmail.com> Co-authored-by: Milen Vitanov <m.vitanov@tum.de> * Use single associated widget for Campus App views * Remove analytics opt-in query in profile view * Enable interactive dismiss for analytics opt-in view * Arrange widgets dynamically on widget screen * Adapt widget size to screen size * Update widget frame design * Add expandable view modifier for widgets * Make calendar widget expandable and tappable * Make grades widget expandable and tappable * Make tuition widget expandable * Make cafeteria widget expandable and tappable * Make study room widget expandable and tappable * Use map image in widget map background view * Use spatio-temporal strategy for widget recommendations * Make expanding widgets more interactive * Request location permission for widgets * Make widgets refreshable * Make rectangle widget size consistent * Support tbd grades in grades widget * Make calendar and study room widgets adapt to screen size better * Make widget screen compatible with iPads * Fix bug where users cannot dismiss the study room group view on the map * Fix cafeteria widget: display real menu, display full meal plan on tap * Use stack navigation style for widget screen * Only show events with future end date in calendar widget * Fix Secrets path * Resolve conflicts * Fix map snapshot bug * Fix order of displayed menu items in MenuView * Fix order of dishes in MenuViewModel * Automatically refresh widgets every minute * Fix drag gestures on CafeteriaView, StudyRoomGroupView * Remove simultaneous drag gestures from buttons in PanelContentView, CafeteriaView, StudyRoomGroupView * Move data collection from GradesScreen to GradesView Co-authored-by: August Wittgenstein <75639931+AW-tum@users.noreply.github.com> Co-authored-by: David Lin <davidlin1412@yahoo.de> Co-authored-by: 14slash12 <59373377+14slash12@users.noreply.github.com> Co-authored-by: August Wittgenstein <august.wittgenstein@tum.de> Co-authored-by: Philipp, Zagar <philipp.zagar@gmail.com> Co-authored-by: Milen Vitanov <milen.vitanov96@gmail.com> Co-authored-by: Milen Vitanov <m.vitanov@tum.de> * Merge conflicts resolve * fix merge conflicts * Remove Analytics Section in Profile View * Fix Calendar Widget only showing 1 event * Reorder Tabbar Co-authored-by: Milen Vitanov <milen.vitanov96@gmail.com> Co-authored-by: Milen Vitanov <m.vitanov@tum.de> Co-authored-by: robynkoelle <46612010+robynkoelle@users.noreply.github.com> Co-authored-by: Robyn Kölle <robyn.koelle@tum.de> Co-authored-by: David Lin <davidlin1412@yahoo.de> Co-authored-by: 14slash12 <59373377+14slash12@users.noreply.github.com> Co-authored-by: Philipp, Zagar <philipp.zagar@gmail.com>
1 parent a403790 commit ef0224c

File tree

52 files changed

+1595
-446
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1595
-446
lines changed

Campus-iOS.xcodeproj/project.pbxproj

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,18 @@
1515
0805E72828CC0954003C5CFD /* AppUsageDataEntity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0805E72728CC0954003C5CFD /* AppUsageDataEntity.swift */; };
1616
0805E72C28CC2278003C5CFD /* HashFunction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0805E72B28CC2278003C5CFD /* HashFunction.swift */; };
1717
0805E72E28CC2462003C5CFD /* Secrets.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 0805E72D28CC2462003C5CFD /* Secrets.xcconfig */; };
18+
0815249428E445030098A2C3 /* Date+Time.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0815249328E445030098A2C3 /* Date+Time.swift */; };
19+
0815249628E45C390098A2C3 /* MLModelDataHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0815249528E45C390098A2C3 /* MLModelDataHandler.swift */; };
20+
0815249828E492070098A2C3 /* RecommenderError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0815249728E492070098A2C3 /* RecommenderError.swift */; };
21+
0815249C28E4A38D0098A2C3 /* CLLocation+isInvalid.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0815249B28E4A38D0098A2C3 /* CLLocation+isInvalid.swift */; };
22+
0815249E28E4A6310098A2C3 /* Date+daysBetween.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0815249D28E4A6310098A2C3 /* Date+daysBetween.swift */; };
1823
082F756628AD2F0E00FE0D52 /* AnalyticsStrategy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 082F756528AD2F0E00FE0D52 /* AnalyticsStrategy.swift */; };
1924
08441F2B2874E2D00033F5B1 /* WidgetLoadingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08441F2A2874E2D00033F5B1 /* WidgetLoadingView.swift */; };
2025
08573BA5287847DC006AC06F /* MapLocation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08573BA4287847DC006AC06F /* MapLocation.swift */; };
2126
08573BA7287B6152006AC06F /* GradeWidgetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08573BA6287B6152006AC06F /* GradeWidgetView.swift */; };
2227
085DE9C628AB7C530045095F /* AnalyticsController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 085DE9C528AB7C530045095F /* AnalyticsController.swift */; };
2328
08D0703A28776DD6004140B1 /* TextWidgetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08D0703928776DD6004140B1 /* TextWidgetView.swift */; };
29+
08D9535A28E34596007ED2F1 /* Array+Groups.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08D9535928E34596007ED2F1 /* Array+Groups.swift */; };
2430
08DFB96F286647E900E357DF /* WidgetScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08DFB96E286647E900E357DF /* WidgetScreen.swift */; };
2531
08DFB97328664BC400E357DF /* TuitionWidgetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08DFB97228664BC400E357DF /* TuitionWidgetView.swift */; };
2632
08DFB97528664CFC00E357DF /* TuitionDetailsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08DFB97428664CFC00E357DF /* TuitionDetailsView.swift */; };
@@ -277,13 +283,19 @@
277283
0805E72328CAABB3003C5CFD /* AnalyticsError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalyticsError.swift; sourceTree = "<group>"; };
278284
0805E72728CC0954003C5CFD /* AppUsageDataEntity.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppUsageDataEntity.swift; sourceTree = "<group>"; };
279285
0805E72B28CC2278003C5CFD /* HashFunction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HashFunction.swift; sourceTree = "<group>"; };
280-
0805E72D28CC2462003C5CFD /* Secrets.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Secrets.xcconfig; sourceTree = "<group>"; };
286+
0805E72D28CC2462003C5CFD /* Secrets.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Secrets.xcconfig; path = "Campus-iOS/AnalyticsComponent/Secrets.xcconfig"; sourceTree = "<group>"; };
287+
0815249328E445030098A2C3 /* Date+Time.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Date+Time.swift"; sourceTree = "<group>"; };
288+
0815249528E45C390098A2C3 /* MLModelDataHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MLModelDataHandler.swift; sourceTree = "<group>"; };
289+
0815249728E492070098A2C3 /* RecommenderError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecommenderError.swift; sourceTree = "<group>"; };
290+
0815249B28E4A38D0098A2C3 /* CLLocation+isInvalid.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CLLocation+isInvalid.swift"; sourceTree = "<group>"; };
291+
0815249D28E4A6310098A2C3 /* Date+daysBetween.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Date+daysBetween.swift"; sourceTree = "<group>"; };
281292
082F756528AD2F0E00FE0D52 /* AnalyticsStrategy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalyticsStrategy.swift; sourceTree = "<group>"; };
282293
08441F2A2874E2D00033F5B1 /* WidgetLoadingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WidgetLoadingView.swift; sourceTree = "<group>"; };
283294
08573BA4287847DC006AC06F /* MapLocation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapLocation.swift; sourceTree = "<group>"; };
284295
08573BA6287B6152006AC06F /* GradeWidgetView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GradeWidgetView.swift; sourceTree = "<group>"; };
285296
085DE9C528AB7C530045095F /* AnalyticsController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalyticsController.swift; sourceTree = "<group>"; };
286297
08D0703928776DD6004140B1 /* TextWidgetView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextWidgetView.swift; sourceTree = "<group>"; };
298+
08D9535928E34596007ED2F1 /* Array+Groups.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Array+Groups.swift"; sourceTree = "<group>"; };
287299
08DFB96E286647E900E357DF /* WidgetScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WidgetScreen.swift; sourceTree = "<group>"; };
288300
08DFB97228664BC400E357DF /* TuitionWidgetView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TuitionWidgetView.swift; sourceTree = "<group>"; };
289301
08DFB97428664CFC00E357DF /* TuitionDetailsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TuitionDetailsView.swift; sourceTree = "<group>"; };
@@ -561,7 +573,6 @@
561573
0805E72328CAABB3003C5CFD /* AnalyticsError.swift */,
562574
0805E72728CC0954003C5CFD /* AppUsageDataEntity.swift */,
563575
0805E72B28CC2278003C5CFD /* HashFunction.swift */,
564-
0805E72D28CC2462003C5CFD /* Secrets.xcconfig */,
565576
);
566577
path = AnalyticsComponent;
567578
sourceTree = "<group>";
@@ -604,6 +615,7 @@
604615
08FAFD19288DED6F006A0E27 /* WidgetRecommender.swift */,
605616
08FAFD1F288DEE3B006A0E27 /* Widget.swift */,
606617
08FAFD23288DF553006A0E27 /* WidgetRecommendation.swift */,
618+
0815249728E492070098A2C3 /* RecommenderError.swift */,
607619
);
608620
path = Recommender;
609621
sourceTree = "<group>";
@@ -616,6 +628,7 @@
616628
08FAFD262898A2B8006A0E27 /* LocationStrategy.swift */,
617629
08FAFD282898B6C8006A0E27 /* SpatioTemporalStrategy.swift */,
618630
082F756528AD2F0E00FE0D52 /* AnalyticsStrategy.swift */,
631+
0815249528E45C390098A2C3 /* MLModelDataHandler.swift */,
619632
);
620633
path = Strategy;
621634
sourceTree = "<group>";
@@ -1050,6 +1063,7 @@
10501063
366F0E7727580CFB0091651D = {
10511064
isa = PBXGroup;
10521065
children = (
1066+
0805E72D28CC2462003C5CFD /* Secrets.xcconfig */,
10531067
366F0E8227580CFB0091651D /* Campus-iOS */,
10541068
366F0E9827580CFD0091651D /* Campus-iOSTests */,
10551069
366F0EA227580CFD0091651D /* Campus-iOSUITests */,
@@ -1478,6 +1492,10 @@
14781492
97270F5927AB2A4900BB25E4 /* Array+Rearrange.swift */,
14791493
36BB6F8C27B3F25A00F224AB /* NSMutableString+Extensions.swift */,
14801494
0805DB7828C933AE00712FF2 /* Operators.swift */,
1495+
08D9535928E34596007ED2F1 /* Array+Groups.swift */,
1496+
0815249328E445030098A2C3 /* Date+Time.swift */,
1497+
0815249B28E4A38D0098A2C3 /* CLLocation+isInvalid.swift */,
1498+
0815249D28E4A6310098A2C3 /* Date+daysBetween.swift */,
14811499
);
14821500
path = Extensions;
14831501
sourceTree = "<group>";
@@ -1700,6 +1718,7 @@
17001718
36AF61DE27A2FD7800FEBD98 /* APIResponse.swift in Sources */,
17011719
3654F37A2851710E008AD5DC /* RoomFinderDetailsBaseView.swift in Sources */,
17021720
3654F388285185A4008AD5DC /* StudyRoomGroupView.swift in Sources */,
1721+
0815249428E445030098A2C3 /* Date+Time.swift in Sources */,
17031722
36BB6F7027B1197400F224AB /* Profile.swift in Sources */,
17041723
08D0703A28776DD6004140B1 /* TextWidgetView.swift in Sources */,
17051724
08FAFD15287DC484006A0E27 /* CalendarWidgetView.swift in Sources */,
@@ -1731,6 +1750,7 @@
17311750
36108BBF27A3046B007DC62D /* LectureDetailsService.swift in Sources */,
17321751
0805E72C28CC2278003C5CFD /* HashFunction.swift in Sources */,
17331752
36982BD827A2739000515847 /* Collapsible.swift in Sources */,
1753+
0815249E28E4A6310098A2C3 /* Date+daysBetween.swift in Sources */,
17341754
1F2068DE28FD731200DBDF67 /* LoginViewModel+TokenState.swift in Sources */,
17351755
36AD5CFA27B9711B00DAE143 /* LectureSearchListView.swift in Sources */,
17361756
1F4C836228300306006971C0 /* MapViewModel.swift in Sources */,
@@ -1830,6 +1850,7 @@
18301850
36108BF027A304B6007DC62D /* PanelContentView.swift in Sources */,
18311851
36AF61F127A2FD7800FEBD98 /* XMLSerializer.swift in Sources */,
18321852
08FAFD1A288DED6F006A0E27 /* WidgetRecommender.swift in Sources */,
1853+
08D9535A28E34596007ED2F1 /* Array+Groups.swift in Sources */,
18331854
36108C1A27A307FA007DC62D /* Modus.swift in Sources */,
18341855
3654F38028517156008AD5DC /* ImageFullScreenView.swift in Sources */,
18351856
36108BC127A3046B007DC62D /* LectureView.swift in Sources */,
@@ -1838,16 +1859,19 @@
18381859
36BB6F6A27AFD2A100F224AB /* PhoneExtension.swift in Sources */,
18391860
36AF61DC27A2FD7800FEBD98 /* NetworkingAPI.swift in Sources */,
18401861
08DFB97528664CFC00E357DF /* TuitionDetailsView.swift in Sources */,
1862+
0815249628E45C390098A2C3 /* MLModelDataHandler.swift in Sources */,
18411863
3654F366285168D2008AD5DC /* StudyRoomAttribute.swift in Sources */,
18421864
1FBFA168285E5B2D00FC1515 /* PanelContentListView.swift in Sources */,
18431865
100803462764E2C50013ED0E /* ProfileToolbar.swift in Sources */,
18441866
36BB6F7B27B27D0D00F224AB /* TuitionCard.swift in Sources */,
18451867
36AF61E227A2FD7800FEBD98 /* Constants.swift in Sources */,
18461868
36BB6F6C27AFD2B900F224AB /* Room.swift in Sources */,
1869+
0815249828E492070098A2C3 /* RecommenderError.swift in Sources */,
18471870
36AF61EB27A2FD7800FEBD98 /* ErrorCategory.swift in Sources */,
18481871
36203E8C2761C6EC00C24658 /* LoginView.swift in Sources */,
18491872
1F33B2ED282B084100C898E4 /* MockGradesViewModel.swift in Sources */,
18501873
36E964A7277498540055777F /* CalendarContentView.swift in Sources */,
1874+
0815249C28E4A38D0098A2C3 /* CLLocation+isInvalid.swift in Sources */,
18511875
36AF61E327A2FD7800FEBD98 /* APIConstants.swift in Sources */,
18521876
3629BA2C27A1CECA0036AC80 /* NewsView.swift in Sources */,
18531877
1FB82E3428F95776007B1858 /* TokenPermissionsView.swift in Sources */,
@@ -2061,7 +2085,7 @@
20612085
CODE_SIGN_STYLE = Automatic;
20622086
CURRENT_PROJECT_VERSION = 53;
20632087
DEVELOPMENT_ASSET_PATHS = "\"Campus-iOS/Preview Content\"";
2064-
DEVELOPMENT_TEAM = 92JDXCA2AA;
2088+
DEVELOPMENT_TEAM = 2J3C6P6X3N;
20652089
"ENABLE_HARDENED_RUNTIME[sdk=macosx*]" = YES;
20662090
ENABLE_PREVIEWS = YES;
20672091
GENERATE_INFOPLIST_FILE = YES;
@@ -2083,7 +2107,7 @@
20832107
"@executable_path/Frameworks",
20842108
);
20852109
MARKETING_VERSION = 4.0;
2086-
PRODUCT_BUNDLE_IDENTIFIER = "de.tum.tca-robyn-dev1";
2110+
PRODUCT_BUNDLE_IDENTIFIER = de.tum.tca;
20872111
PRODUCT_NAME = "$(TARGET_NAME)";
20882112
SUPPORTS_MACCATALYST = YES;
20892113
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;

Campus-iOS/AnalyticsComponent/AnalyticsController.swift

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,20 @@ struct AnalyticsController {
1919
}
2020
}
2121

22+
static func getEntries() throws -> [AppUsageDataEntity] {
23+
let request = AppUsageDataEntity.fetchRequest()
24+
guard let data = try? PersistenceController.shared.container.viewContext.fetch(request) else {
25+
throw AnalyticsError.fetchFailed
26+
}
27+
28+
return data
29+
}
30+
2231
static func upload(entry: AppUsageData) async throws {
2332

33+
print("Info: app usage data upload is disabled.")
34+
return
35+
2436
if !didOptIn {
2537
return
2638
}
@@ -44,8 +56,8 @@ struct AnalyticsController {
4456
return
4557
}
4658

47-
let latitude = entry.getLatitude() ?? AppUsageData.invalidLocation
48-
let longitude = entry.getLongitude() ?? AppUsageData.invalidLocation
59+
let latitude = entry.getLatitude() ?? AppUsageData.invalidLocation.coordinate.latitude
60+
let longitude = entry.getLongitude() ?? AppUsageData.invalidLocation.coordinate.longitude
4961

5062
let hashedId = HashFunction.sha256(deviceIdentifier)
5163
let formatter = DateFormatter()

Campus-iOS/AnalyticsComponent/AnalyticsError.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
import Foundation
99

1010
enum AnalyticsError: Error {
11-
case missingValues
11+
case missingValues, fetchFailed
1212
}

Campus-iOS/AnalyticsComponent/AppUsageData.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class AppUsageData {
1818
/* CoreData's double values (for latitude, longitude) are not optional.
1919
* However, we still want to store the other data when we cannot get the location.
2020
* Thus we symbolize invalid locations with an impossible latitude / longitude value in the CoreData entity. */
21-
static let invalidLocation: Double = 200
21+
static let invalidLocation: CLLocation = CLLocation(latitude: 200, longitude: 200)
2222

2323
private var view: CampusAppView?
2424
private var latitude: Double?

Campus-iOS/AnalyticsComponent/AppUsageDataEntity.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ extension AppUsageDataEntity {
2222
self.view = view
2323
self.startTime = startTime
2424
self.endTime = endTime
25-
self.latitude = data.getLatitude() ?? AppUsageData.invalidLocation
26-
self.longitude = data.getLongitude() ?? AppUsageData.invalidLocation
25+
self.latitude = data.getLatitude() ?? AppUsageData.invalidLocation.coordinate.latitude
26+
self.longitude = data.getLongitude() ?? AppUsageData.invalidLocation.coordinate.longitude
2727
}
2828
}
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
//
2+
// Analytics.swift
3+
// Campus-iOS
4+
//
5+
// Created by Robyn Kölle on 16.08.22.
6+
//
7+
8+
import Foundation
9+
import MapKit
10+
import SwiftUI
11+
12+
struct AnalyticsController {
13+
14+
@AppStorage("analyticsOptIn") private static var didOptIn = false
15+
16+
static func store(entry: AppUsageData) {
17+
if let _ = try? AppUsageDataEntity(data: entry, context: PersistenceController.shared.container.viewContext) {
18+
PersistenceController.shared.save()
19+
}
20+
}
21+
22+
static func upload(entry: AppUsageData) async throws {
23+
24+
if !didOptIn {
25+
return
26+
}
27+
28+
guard let postToken = Bundle.main.object(forInfoDictionaryKey: "ANALYTICS_POST_TOKEN") as? String, !postToken.isEmpty,
29+
let analyticsApi = Bundle.main.object(forInfoDictionaryKey: "ANALYTICS_API") as? String else {
30+
return
31+
}
32+
33+
guard var components = URLComponents(string: "https://" + analyticsApi) else {
34+
return
35+
}
36+
37+
/* Query items */
38+
39+
guard let deviceIdentifier = await UIDevice.current.identifierForVendor?.uuidString else {
40+
return
41+
}
42+
43+
guard let startDate = entry.getStartTime(), let endDate = entry.getEndTime(), let view = entry.getView() else {
44+
return
45+
}
46+
47+
let latitude = entry.getLatitude() ?? AppUsageData.invalidLocation
48+
let longitude = entry.getLongitude() ?? AppUsageData.invalidLocation
49+
50+
let hashedId = HashFunction.sha256(deviceIdentifier)
51+
let formatter = DateFormatter()
52+
formatter.dateFormat = "YY-MM-dd HH-mm-ss"
53+
let startTime = formatter.string(from: startDate)
54+
let endTime = formatter.string(from: endDate)
55+
56+
components.queryItems = [
57+
URLQueryItem(name: "user_id", value: hashedId),
58+
URLQueryItem(name: "latitude", value: String(latitude)),
59+
URLQueryItem(name: "longitude", value: String(longitude)),
60+
URLQueryItem(name: "start_time", value: startTime),
61+
URLQueryItem(name: "end_time", value: endTime),
62+
URLQueryItem(name: "view", value: view.rawValue)
63+
]
64+
65+
guard let url = components.url else {
66+
return
67+
}
68+
69+
#if targetEnvironment(simulator)
70+
print("🟢 Query items:")
71+
print(components.queryItems ?? [])
72+
return
73+
#endif
74+
75+
var request = URLRequest(url: url)
76+
request.httpMethod = "POST"
77+
request.setValue(postToken, forHTTPHeaderField: "Authorization")
78+
79+
let (_, _) = try await URLSession.shared.data(for: request)
80+
}
81+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//
2+
// AnalyticsError.swift
3+
// Campus-iOS
4+
//
5+
// Created by Robyn Kölle on 09.09.22.
6+
//
7+
8+
import Foundation
9+
10+
enum AnalyticsError: Error {
11+
case missingValues
12+
}

0 commit comments

Comments
 (0)