-
Notifications
You must be signed in to change notification settings - Fork 15
Update SPMExample and Cocoapods Example with map view #417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
e0cc089 to
40eed06
Compare
Wiz Scan Summary
To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension. |
dc5502f to
2c58995
Compare
|
Was all of the SwiftUI code AI-generated? Because smh its badddd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to take a little more time on this. It's great that AI was able to convert crufty old storyboard code into SwiftUI... but AI didn't do a great job of writing SwiftUI. While a sample app isn't exactly mission-critical and admittedly probably won't be seen by too many people, I do think it's important to put our best foot forward and write clean UI code, even if it's minimal.
It's not a priority right now because universal links is more pressing, but I think next week I can take a stab at proposing some ways to clean it up
|
^^ lol agree -- also as we discussed, we probably want the overall sample app update to SwiftUI/removing the storyboard to not be behind this feature branch, so I'll plan to restructure those code changes to be targeting master and then this could be moreso focused on adding the map view/geofencing related updates |
|
This PR has not seen any updates in the last 16 days. Without further action this PR will be closed in 14 days. To disable further staleness checks add the |
ab1470
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I've reviewed everything except for MapView.swift. I need a little break to work on other stuff but I'll get back to this and review MapView a bit later
ab1470
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing all of my comments. This is much better already. I left some other suggestions for improving this a bit more, particularly where it pertains to iOS 26 compatibility.
Also see my suggestion PR for some changes to the MapView.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* changed `NavigationView` to `NavigationStack` `NavigationView` is deprecated * added .ignoresSafeArea and background for toolbars. this makes the map fill is parent container. The toolbar background ensures that the buttons are visible above the map on pre-iOS-26 devices * changed Close button to show an image instead of text * Changed "Stop" button to show an icon instead of text this resolves an issue on iOS 26 where the "Stop" button text was getting truncated * consolidated styles into `locationStatusLabel` tuple * minor formatting fix * added `geofenceMonitoringLabel` and revised geofence monitoring indicator style this fixes an issue on iOS 26+ where the monitoring label was getting truncated * removed geofencing monitoring label from bottom toolbar and placed it in navigation bar * moved all controls into a menu button at the top of the screen * moved monitoring buttons to bottom bar --------- Co-authored-by: Belle Lim <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Menu Item Identity Crisis Breaks Cart
The id for "Beef Bolognese" is set to 5 but should be 4 based on the menu initialization in MenuPageViewController and MenuView. This mismatch causes cart restoration to create items with incorrect IDs.
Examples/KlaviyoSwiftExamples/Shared/Cart.swift#L62-L63
klaviyo-swift-sdk/Examples/KlaviyoSwiftExamples/Shared/Cart.swift
Lines 62 to 63 in 85061f8
| case "Beef Bolognese": | |
| cartItems.append( |
ab1470
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👋👋 storyboards! Can't say we'll miss you
Nice job, feels good to have a modern sample app!
Cursor's got beef with your beef 🐄 |



Description
Updating the sample app(s) in this repo and prepping them for geofencing updates. Big goal of getting rid of using the Storyboard and moving it all (or as much as possible) to SwiftUI. Fairly straightforward change for the SPMExample, but since Cocoapods relies on the actual pods, I had to create a new
podspecfor the upcoming KlaviyoLocation pod - kind of a placeholder for now (as that will actually be coming) but the Cocoapods example still has trouble building as it is somewhat self referential and unpublished but still felt like a good update to do.Still kept the main AppDelegate where we had a lot of instructional comments showing how to write calls to our SDK.
Due Diligence
Release/Versioning Considerations
PatchContains internal changes or backwards-compatible bug fixes.MinorContains changes to the public API.MajorContains breaking changes.Changelog / Code Overview
new.app.mov
map.portion.mov
Test Plan
Related Issues/Tickets
https://klaviyo.atlassian.net/browse/CHNL-25115
Note
Migrates example apps to SwiftUI with a new geofencing map flow, updates app/ project configs (Pods/SPM, Info.plists), and adds an internal API to query currently monitored geofences.
CocoapodsExampleApp/KLMuncheryApp,ContentView,LoginView,MenuView,CheckoutView; removeMain.storyboardand related table view cells.MapViewto register/unregister geofencing and visualize monitored regions with annotations and radius overlays.AppStateto manage auth, profile, and cart; persist viaUserDefaults.key_value_pairsfrom notifications.Info.plist(URL schemes, backgroundremote-notification&location, location usage strings, bundle IDs). CocoaPods addsKlaviyoLocation; SPM switches to local package, addsKlaviyoLocation, updates project/scheme.KlaviyoLocationManager.getCurrentGeofences()and surface viaKlaviyoSDK.getCurrentGeofences()(SPI, deprecated notice); keepregisterGeofencing/unregisterGeofencingAPIs.MenuItembecomesCodableand dropsimage; adjustCartand remove unused image assets.Written by Cursor Bugbot for commit ee8c74d. This will update automatically on new commits. Configure here.