Skip to content
Open
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
4fe50b4
keep existing regions and notifications when possible
ShiCheng-Lu Sep 5, 2025
ff06d8b
notifications remaining
ShiCheng-Lu Sep 5, 2025
7b10532
fix duplicate synced notification issues
ShiCheng-Lu Sep 8, 2025
2b5711e
clean up logs
ShiCheng-Lu Sep 8, 2025
2544640
cleanup
ShiCheng-Lu Sep 8, 2025
4d729af
cleanup
ShiCheng-Lu Sep 8, 2025
b1b8eaf
cleanup
ShiCheng-Lu Sep 8, 2025
c515bd9
add semaphore for editing notifications
ShiCheng-Lu Sep 8, 2025
f168f1a
keep beacon notifications
ShiCheng-Lu Sep 8, 2025
6a2a969
bump version
ShiCheng-Lu Sep 8, 2025
0ed4ef4
.
ShiCheng-Lu Sep 9, 2025
0be314f
.
ShiCheng-Lu Sep 9, 2025
605e9e6
add gpx for testing
ShiCheng-Lu Sep 9, 2025
f8edf70
.
ShiCheng-Lu Sep 9, 2025
2176f14
initialize on tests tab
ShiCheng-Lu Sep 12, 2025
606aeb2
only track first 19 regions
ShiCheng-Lu Sep 12, 2025
db51a3a
early break on loop
ShiCheng-Lu Sep 15, 2025
4d3f7c0
Merge branch 'master' into shicheng/improve-sync-logic
ShiCheng-Lu Sep 15, 2025
035c86b
Merge branch 'master' into shicheng/improve-sync-logic
ShiCheng-Lu Oct 15, 2025
a35ea7f
sync logic in swift
ShiCheng-Lu Oct 16, 2025
1bf9666
revert objC impl to old, and use new version in swift
ShiCheng-Lu Oct 17, 2025
c5afd9f
add back Indoors
ShiCheng-Lu Oct 17, 2025
3fcd1e9
revert beacon manager
ShiCheng-Lu Oct 17, 2025
ae27893
make RadarLocationManagerSwift singleton
ShiCheng-Lu Oct 17, 2025
0aed520
reset NotificationHelper
ShiCheng-Lu Oct 17, 2025
96a28e1
feature flag
ShiCheng-Lu Oct 17, 2025
b13ab07
better comparison on notification request
ShiCheng-Lu Oct 20, 2025
c6f31b9
re-run test?
ShiCheng-Lu Oct 20, 2025
b92f01c
logs and events in UI
ShiCheng-Lu Oct 20, 2025
308a81a
clean up
ShiCheng-Lu Oct 20, 2025
40d978e
Merge branch 'master' into shicheng/improve-sync-logic-2
ShiCheng-Lu Oct 22, 2025
0d0aa4c
add geofence metadata that allows it to skip nearby sync
ShiCheng-Lu Oct 22, 2025
9e2e6d5
don't notify on exit
ShiCheng-Lu Oct 22, 2025
5b65c2f
a bit more logging
ShiCheng-Lu Oct 22, 2025
20475fb
log the list of pending notifications at once
ShiCheng-Lu Oct 22, 2025
8dd90cb
why dust thou stall
ShiCheng-Lu Oct 23, 2025
e8ffc5a
Revert "why dust thou stall"
ShiCheng-Lu Oct 23, 2025
480cec6
Merge branch 'master' into shicheng/improve-sync-logic-2
ShiCheng-Lu Oct 27, 2025
df8b5c8
logs
ShiCheng-Lu Oct 27, 2025
f2aa5c9
beta version
ShiCheng-Lu Oct 27, 2025
d2227e9
update indoor version
ShiCheng-Lu Oct 27, 2025
857a815
beta 2
ShiCheng-Lu Oct 27, 2025
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
12 changes: 10 additions & 2 deletions Example/Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
E698B7492C626B0600084371 /* RadarSDKMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E698B7412C626AE600084371 /* RadarSDKMotion.framework */; };
E698B7502C627A1600084371 /* RadarSDKMotion.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = E698B7412C626AE600084371 /* RadarSDKMotion.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
F625D7F92C3337650024D1E7 /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F625D7F82C3337650024D1E7 /* Launch Screen.storyboard */; };
F6513F602E6B736200523472 /* MainView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F6513F5F2E6B736200523472 /* MainView.swift */; };
F66DAD6A2E707F0700896773 /* waypoints.gpx in Sources */ = {isa = PBXBuildFile; fileRef = F66DAD642E707F0300896773 /* waypoints.gpx */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -76,6 +78,8 @@
E632FA1C2CAC366C00E86C85 /* Example.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Example.entitlements; sourceTree = "<group>"; };
E698B7382C626AE600084371 /* RadarSDKMotion.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RadarSDKMotion.xcodeproj; path = ../../RadarSDKMotion/RadarSDKMotion.xcodeproj; sourceTree = "<group>"; };
F625D7F82C3337650024D1E7 /* Launch Screen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = "Launch Screen.storyboard"; sourceTree = "<group>"; };
F6513F5F2E6B736200523472 /* MainView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainView.swift; sourceTree = "<group>"; };
F66DAD642E707F0300896773 /* waypoints.gpx */ = {isa = PBXFileReference; lastKnownFileType = text; path = waypoints.gpx; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -116,6 +120,8 @@
DD236D34230A006900EB88F9 /* Info.plist */,
DDB861D22385FC3E00770661 /* [email protected] */,
DD236D26230A006700EB88F9 /* AppDelegate.swift */,
F6513F5F2E6B736200523472 /* MainView.swift */,
F66DAD642E707F0300896773 /* waypoints.gpx */,
DD291168230D0AF900049D3A /* Utils.swift */,
DD236D2F230A006900EB88F9 /* Assets.xcassets */,
DD86FCF9239185F4003225F6 /* RadarSDK.xcodeproj */,
Expand Down Expand Up @@ -267,7 +273,9 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
F66DAD6A2E707F0700896773 /* waypoints.gpx in Sources */,
DD236D27230A006700EB88F9 /* AppDelegate.swift in Sources */,
F6513F602E6B736200523472 /* MainView.swift in Sources */,
DD291169230D0AF900049D3A /* Utils.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -326,7 +334,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -381,7 +389,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
Expand Down
37 changes: 18 additions & 19 deletions Example/Example/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import UIKit
import UserNotifications
import RadarSDK
import SwiftUI


@UIApplicationMain
Expand All @@ -18,6 +19,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UIWindowSceneDelegate, UN

var scrollView: UIScrollView?
var demoFunctions = Array<() -> Void>()

var useSwiftUI = true

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound]) { (_, _) in }
Expand All @@ -28,12 +31,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UIWindowSceneDelegate, UN

// Replace with a valid test publishable key
let radarInitializeOptions = RadarInitializeOptions()

// Uncomment to enable automatic setup for notification conversions or deep linking
//radarInitializeOptions.autoLogNotificationConversions = true
//radarInitializeOptions.autoHandleNotificationDeepLinks = true
Radar.initialize(publishableKey: "prj_test_pk_0000000000000000000000000000000000000000", options: radarInitializeOptions )
Radar.setUserId("testUserId")
Radar.setMetadata([ "foo": "bar" ])
Radar.setDelegate(self)
Radar.setVerifiedDelegate(self)

Expand Down Expand Up @@ -75,12 +78,18 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UIWindowSceneDelegate, UN
let window = UIWindow(windowScene: windowScene)

window.backgroundColor = .white

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!)

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!)
}

window.makeKeyAndVisible()

Expand All @@ -96,7 +105,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UIWindowSceneDelegate, UN
}
}


demoButton(text: "iam") {
Radar.showInAppMessage(RadarInAppMessage.fromDictionary([
"title": [
Expand Down Expand Up @@ -430,27 +438,18 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UIWindowSceneDelegate, UN
}

func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {
print("will present notification!")
completionHandler([.list, .banner, .sound])
}

func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse) async {
// Uncomment for manual setup for notification conversions and URLs
// Radar.logConversion(response: response)
// Radar.openURLFromNotification(response.notification)
print("Received notification!")
}

func notify(_ body: String) {
UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound]) { (granted, error) in
if granted {
let content = UNMutableNotificationContent()
content.body = body
content.sound = UNNotificationSound.default
content.categoryIdentifier = "example"

let request = UNNotificationRequest(identifier: UUID().uuidString, content: content, trigger: nil)
UNUserNotificationCenter.current().add(request, withCompletionHandler: { (_) in })
}
}
}

func didReceiveEvents(_ events: [RadarEvent], user: RadarUser?) {
Expand Down
Loading