Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
c40c152
swiftui example app
ShiCheng-Lu Sep 12, 2025
872b81e
download model
ShiCheng-Lu Sep 12, 2025
ecf2252
.
ShiCheng-Lu Sep 17, 2025
a43f30e
fix build
ShiCheng-Lu Sep 18, 2025
2618ba6
add back, but comment out notify()
ShiCheng-Lu Sep 18, 2025
13a44cb
cleanup
ShiCheng-Lu Sep 18, 2025
2a119cd
Merge branch 'master' into shicheng/swiftui-example
ShiCheng-Lu Oct 7, 2025
8f45b5e
.
ShiCheng-Lu Oct 8, 2025
fbea8d9
split views
ShiCheng-Lu Oct 21, 2025
12bccc8
Merge branch 'master' into shicheng/swiftui-example
ShiCheng-Lu Oct 21, 2025
e52db94
load model
ShiCheng-Lu Oct 21, 2025
779bc51
cleanup
ShiCheng-Lu Oct 21, 2025
fffd39b
cleanup
ShiCheng-Lu Oct 21, 2025
0663108
cleanup
ShiCheng-Lu Oct 21, 2025
24bb86a
Merge branch 'shicheng/swiftui-example' into shicheng/ml
ShiCheng-Lu Oct 21, 2025
dc82657
working download model and run prediction
ShiCheng-Lu Oct 21, 2025
6dff2e1
wip
ShiCheng-Lu Oct 28, 2025
dd12119
Merge branch 'master' into shicheng/ml
ShiCheng-Lu Oct 28, 2025
937a559
maplibre site map
ShiCheng-Lu Oct 30, 2025
e2f4434
sites map with maplibre, and position selection system
ShiCheng-Lu Oct 30, 2025
7b6636b
update site struct
ShiCheng-Lu Oct 31, 2025
fdae592
add big red button for ranging
ShiCheng-Lu Nov 3, 2025
532fff8
flashing
ShiCheng-Lu Nov 3, 2025
a2c8536
convert to xy before sending to backend
ShiCheng-Lu Nov 3, 2025
b06317b
AR tracking
ShiCheng-Lu Nov 4, 2025
6304f13
ui updates
ShiCheng-Lu Nov 4, 2025
798105c
slider to calibrate rotation
ShiCheng-Lu Nov 5, 2025
d987e84
.
ShiCheng-Lu Nov 5, 2025
da1d1a1
pass beacons through
ShiCheng-Lu Nov 7, 2025
9ecb4c2
pass beacon
ShiCheng-Lu Nov 7, 2025
e1fa764
testing
ShiCheng-Lu Nov 11, 2025
0c719ec
kalman filter the result
ShiCheng-Lu Nov 26, 2025
26af093
productionizing wip
ShiCheng-Lu Nov 26, 2025
c435be9
Merge branch 'master' into shicheng/ml-beacons
ShiCheng-Lu Nov 26, 2025
2e4b90c
move to server training
ShiCheng-Lu Dec 5, 2025
e241c3d
interface with RadarSDKIndoors
ShiCheng-Lu Dec 10, 2025
f8c11b4
add extension to model dir
ShiCheng-Lu Dec 15, 2025
916d3a0
initialize model from metadata
ShiCheng-Lu Dec 16, 2025
5537d3a
send location to track
ShiCheng-Lu Dec 16, 2025
654c34a
update RadarSDKIndoors
ShiCheng-Lu Dec 16, 2025
430f574
clean up example
ShiCheng-Lu Dec 17, 2025
d05b82f
use stored values for example app survey api
ShiCheng-Lu Dec 17, 2025
ff95e47
use log instead of print
ShiCheng-Lu Dec 17, 2025
f9c589e
fix tests, skip log calls in mock api capture
ShiCheng-Lu Dec 17, 2025
c9ba215
add client location updates
ShiCheng-Lu Jan 12, 2026
809d4a1
Merge branch 'master' into shicheng/ml-beacons
ShiCheng-Lu Jan 13, 2026
d036931
fix build
ShiCheng-Lu Jan 13, 2026
f95d378
don't show raw predict points
ShiCheng-Lu Jan 13, 2026
c4d2920
add circle resolution, don't use app group
ShiCheng-Lu Jan 13, 2026
ab7e7d5
typo
ShiCheng-Lu Jan 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
181 changes: 166 additions & 15 deletions Example/Example.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

70 changes: 70 additions & 0 deletions Example/Example/AR.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
//
// AR.swift
// Example
//
// Created by ShiCheng Lu on 11/3/25.
// Copyright © 2025 Radar Labs, Inc. All rights reserved.
//

import ARKit
import SwiftUI


// MARK: - UIViewRepresentable for ARSCNView (or ARView)
struct ARViewContainer: UIViewRepresentable {
@ObservedObject var viewModel: DebugViewModel

func makeUIView(context: Context) -> ARSCNView {
let arView = ARSCNView(frame: .zero)
arView.session = viewModel.session
arView.delegate = context.coordinator
arView.autoenablesDefaultLighting = true
return arView
}

func updateUIView(_ uiView: ARSCNView, context: Context) {
// Nothing to update for now
}

func makeCoordinator() -> Coordinator {
return Coordinator(self)
}

class Coordinator: NSObject, ARSCNViewDelegate {
var container: ARViewContainer
init(_ container: ARViewContainer) {
self.container = container
}
// You can implement delegate methods if you want (e.g., for debug)
}
}

// MARK: - SwiftUI View
struct ARView: View {
@StateObject private var viewModel = DebugViewModel()
var body: some View {
ZStack(alignment: .topLeading) {
ARViewContainer(viewModel: viewModel)

VStack(alignment: .leading, spacing: 10) {

Button("Reset") {
viewModel.resetTracking()
}
.padding()
.background(Color.white.opacity(0.8))
.foregroundColor(.black)
.cornerRadius(8)
}
.padding(.top, 40)
.padding(.leading, 20)
}
}
}

// MARK: - Preview
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ARView()
}
}
77 changes: 10 additions & 67 deletions Example/Example/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import SwiftUI
import ActivityKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, UIWindowSceneDelegate, UNUserNotificationCenterDelegate, CLLocationManagerDelegate, RadarDelegate, RadarVerifiedDelegate {
class AppDelegate: UIResponder, UIApplicationDelegate, UIWindowSceneDelegate, UNUserNotificationCenterDelegate, CLLocationManagerDelegate {

let locationManager = CLLocationManager()
var window: UIWindow? // required for UIWindowSceneDelegate
Expand All @@ -21,27 +21,28 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UIWindowSceneDelegate, UN
var demoFunctions = Array<() -> Void>()

var useSwiftUI = true

let motionManager = CMMotionManager()

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound]) { (_, _) in }
UNUserNotificationCenter.current().delegate = self

locationManager.delegate = self
self.requestLocationPermissions()
Radar.setAppGroup(nil)

// Replace with a valid test publishable key
let radarInitializeOptions = RadarInitializeOptions()
UserDefaults.standard.setValue("https://api-shicheng.radar-staging.com", forKey: "radar-host")

// Uncomment to enable automatic setup for notification conversions or deep linking
let radarInitializeOptions = RadarInitializeOptions()
radarInitializeOptions.autoLogNotificationConversions = true
radarInitializeOptions.autoHandleNotificationDeepLinks = true
radarInitializeOptions.silentPush = true

Radar.setAppGroup("group.waypoint.data")
Radar.setAppGroup(nil)
Radar.initialize(publishableKey: "prj_test_pk_0000000000000000000000000000000000000000", options: radarInitializeOptions )
Radar.setMetadata([ "foo": "bar" ])
Radar.setDelegate(self)
Radar.setVerifiedDelegate(self)
Radar.setInAppMessageDelegate(MyIAMDelegate())

if #available(iOS 15.0, *) {
Expand All @@ -60,25 +61,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UIWindowSceneDelegate, UN
return true
}

func demoButton(text: String, function: @escaping () -> Void) {
guard let scrollView = self.scrollView else { return }

let buttonHeight = 30
scrollView.contentSize.height += CGFloat(buttonHeight)

let buttonFrame = CGRect(x: 0, y: demoFunctions.count * buttonHeight, width: Int(scrollView.frame.width), height: buttonHeight)
let button = UIButton(frame: buttonFrame, primaryAction:UIAction(handler:{ _ in
function()
}))
button.setTitleColor(.black, for: .normal)
button.setTitleColor(.lightGray, for: .highlighted)
button.setTitle(text, for: .normal)

demoFunctions.append(function)

scrollView.addSubview(button)
}

func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
Expand All @@ -89,17 +71,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UIWindowSceneDelegate, UN

window.backgroundColor = .white

if (useSwiftUI) {
let controller = UIHostingController(rootView: MainView())
controller.view.frame = UIScreen.main.bounds
window.addSubview(controller.view)
} else {
scrollView = UIScrollView(frame: CGRect(x: 0, y: 100, width: window.frame.size.width, height: window.frame.size.height))
scrollView!.contentSize.height = 0
scrollView!.contentSize.width = window.frame.size.width

window.addSubview(scrollView!)
}
let controller = UIHostingController(rootView: MainView())
controller.view.frame = UIScreen.main.bounds
window.addSubview(controller.view)

window.makeKeyAndVisible()

Expand All @@ -114,37 +88,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UIWindowSceneDelegate, UN
// print("Track once: status = \(Radar.stringForStatus(status)); location = \(String(describing: location)); events = \(String(describing: events)); user = \(String(describing: user))")
// }
}

demoButton(text: "IAM") {
Radar.showInAppMessage(RadarInAppMessage.fromDictionary([
"title": [
"text": "This is the titleakfjaklsjdflajsldfjalsdjflajsldkfjaslkfdjkalsjdfklajlkfdjklsjflajsd",
"color": "#ff0000"
],
"body": [
"text": "This is a demo message.",
"color": "#00ff00"
],
"button": [
"text": "Buy it",
"color": "#0000ff",
"backgroundColor": "#EB0083",
],
"image": [
"url": "https://images.pexels.com/photos/949587/pexels-photo-949587.jpeg",
"name": "image.jpeg"
],
"metadata": [
"campainId": "1234"
]
])!)
}
demoButton(text: "get User Id") {
print(Radar.getUserId())
}
demoButton(text: "track once") {
print(Radar.trackOnce())
}
}

func requestLocationPermissions() {
Expand Down
Loading
Loading