Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
163 commits
Select commit Hold shift + click to select a range
27fc369
implement client side ramp up
KennyHuRadar Oct 16, 2024
9206728
fix parsing of geofences
KennyHuRadar Oct 16, 2024
e2efd53
use swift 5.0
KennyHuRadar Oct 16, 2024
429b4ed
change build definition of radar test to remove un-needed source files
KennyHuRadar Oct 17, 2024
1a38ecd
remove un-needed logging, just flacky tests
KennyHuRadar Oct 17, 2024
e84a9f0
remove logging
KennyHuRadar Oct 17, 2024
61f6b8e
update pod file
KennyHuRadar Oct 17, 2024
eb7e5d8
remove un-needed imports
KennyHuRadar Oct 17, 2024
decb2a8
update normal trackonce behaviour
KennyHuRadar Oct 17, 2024
6e54e28
clean up
KennyHuRadar Oct 17, 2024
e6e3c6a
add new swift definitions
KennyHuRadar Oct 17, 2024
65b9250
add logger to be accessible by swift
KennyHuRadar Oct 17, 2024
9142abf
add flag
KennyHuRadar Oct 17, 2024
3397fc6
put feature behind flag
KennyHuRadar Oct 17, 2024
c4e115b
bump beta version
KennyHuRadar Oct 21, 2024
e8522f3
Merge branch 'master' into kenny/off-line-ramp-up
KennyHuRadar Oct 21, 2024
d404d57
bump to right beta version
KennyHuRadar Oct 21, 2024
3fd5b00
Update RadarSettings.m
KennyHuRadar Oct 21, 2024
c2fb45d
add build settings and suppress testing on builds for now
KennyHuRadar Oct 21, 2024
4015e47
add flag to project
KennyHuRadar Oct 21, 2024
c4828b8
uncomment out the tests
KennyHuRadar Oct 21, 2024
a87cea2
clean up
KennyHuRadar Oct 21, 2024
28ce949
remove duplicate soruce and also add some logging to adding nearby ge…
KennyHuRadar Oct 21, 2024
be8c1d2
add back compile source
KennyHuRadar Oct 21, 2024
bdfcc07
add inside geofence log message for radar offline manager
KennyHuRadar Oct 21, 2024
5ac6d23
use ramp up specific json resource and improve logging in radar state
KennyHuRadar Oct 22, 2024
c5572b3
make compatible with replays
KennyHuRadar Oct 24, 2024
b6dc7fa
only call when replay is unsuccessful
KennyHuRadar Oct 24, 2024
9b4f71d
change json file for test
KennyHuRadar Oct 24, 2024
af9e4f7
change how geofenes are turned to jsons
KennyHuRadar Oct 24, 2024
f9f874c
change shape of alternative tracking options
KennyHuRadar Oct 25, 2024
aa12fd4
Merge branch 'master' into kenny/off-line-ramp-up
KennyHuRadar Oct 28, 2024
39af20d
refactor geofenceTag and tracking option extraction logic
KennyHuRadar Oct 28, 2024
25d1094
disable user script in build setting in radarSDKMotion
KennyHuRadar Oct 28, 2024
6dd7481
use xcode 16 in circle ci
KennyHuRadar Oct 28, 2024
4f277fd
use iphone 16 in ci
KennyHuRadar Oct 28, 2024
7f8c280
Merge branch 'master' into kenny/off-line-ramp-up
KennyHuRadar Oct 28, 2024
25e455d
Update RadarSDKMotion.podspec
KennyHuRadar Oct 28, 2024
fc75f16
define cocoapods version (#410)
KennyHuRadar Oct 29, 2024
f2baf95
rename
KennyHuRadar Oct 29, 2024
3785164
Merge branch 'master' into kenny/off-line-ramp-up
KennyHuRadar Oct 29, 2024
85e1abe
rename
KennyHuRadar Oct 29, 2024
761ef37
refactor updateTrackingFromConfig
KennyHuRadar Oct 30, 2024
b1cae04
Merge branch 'master' into kenny/off-line-ramp-up
KennyHuRadar Oct 30, 2024
880cbe7
rename and fix typo
KennyHuRadar Oct 30, 2024
b6f811b
increase number of geofences synced
KennyHuRadar Nov 5, 2024
999b459
Merge branch 'master' into kenny/off-line-ramp-up
KennyHuRadar Nov 11, 2024
41c7a36
Merge
lmeier Dec 30, 2024
ac5011e
3.19.7-beta.1
lmeier Dec 30, 2024
4769e5e
Fix merge
lmeier Dec 30, 2024
af1a7bd
Merge branch 'master' into kenny/off-line-ramp-up
KennyHuRadar Mar 31, 2025
8681189
fix xcode merge issue
KennyHuRadar Mar 31, 2025
24b4d9e
Merge branch 'master' into kenny/off-line-ramp-up
KennyHuRadar Apr 14, 2025
123d98c
compiles
KennyHuRadar Apr 17, 2025
08a684f
typo
KennyHuRadar Apr 17, 2025
4ed3989
tested manually
KennyHuRadar Apr 17, 2025
0f24da5
fix bug
KennyHuRadar Apr 17, 2025
88d1931
Update XCFramework-Bridging-Header.h
KennyHuRadar Apr 17, 2025
4c803ce
suppress xcode lint issues
KennyHuRadar Apr 18, 2025
4d31f2c
.
KennyHuRadar Apr 18, 2025
34da20c
use geofence dic value
KennyHuRadar Apr 18, 2025
25b37a3
Merge branch 'master' into kenny/offline-event-generation
cameron-morrow-toptal Aug 5, 2025
3e427a7
Merge branch 'master' into kenny/offline-event-generation
cameron-morrow-toptal Aug 5, 2025
2264fca
fixing build issue
cameron-morrow-toptal Aug 5, 2025
774889b
fixing build issue
cameron-morrow-toptal Aug 5, 2025
cd23cd0
fixing build issue
cameron-morrow-toptal Aug 5, 2025
150d0b4
fixing build issue
cameron-morrow-toptal Aug 5, 2025
bfbde64
fixing build issue
cameron-morrow-toptal Aug 5, 2025
cb79cb3
fixing build issue
cameron-morrow-toptal Aug 5, 2025
0789348
undo
cameron-morrow-toptal Aug 5, 2025
ed4f970
fixing build issue
cameron-morrow-toptal Aug 6, 2025
4b0291f
fixing build issue
cameron-morrow-toptal Aug 6, 2025
21efe5e
fixing build issue
cameron-morrow-toptal Aug 6, 2025
f167e4b
fixing build issue
cameron-morrow-toptal Aug 6, 2025
b3495ad
fixing build issue
cameron-morrow-toptal Aug 7, 2025
f3843fb
fixing build issue
cameron-morrow-toptal Aug 12, 2025
6db0a7d
fixing build issue
cameron-morrow-toptal Aug 12, 2025
cbe33de
fixing build issue
cameron-morrow-toptal Aug 12, 2025
81a9fed
fixing build issue
cameron-morrow-toptal Aug 12, 2025
8b6a4b2
fixing build issue
cameron-morrow-toptal Aug 12, 2025
94630fb
test swift
ShiCheng-Lu Aug 13, 2025
3a8caba
add InAppMessage
ShiCheng-Lu Aug 13, 2025
ed5984f
update podspec
ShiCheng-Lu Aug 13, 2025
345fed6
bump version
ShiCheng-Lu Aug 14, 2025
2c37b8d
include Radar-Swift.h in umbrella header
ShiCheng-Lu Aug 14, 2025
c05c65a
specify iOS version
ShiCheng-Lu Aug 14, 2025
c2ddaaa
use simulator 18.0
ShiCheng-Lu Aug 14, 2025
fe0e85d
list simulators
ShiCheng-Lu Aug 14, 2025
86b5921
use latest iOS
ShiCheng-Lu Aug 14, 2025
182a921
specify iOS 18.6
ShiCheng-Lu Aug 14, 2025
1553861
use swift 6 for test and build modules for library
ShiCheng-Lu Aug 14, 2025
a78f4a0
show available destinations
ShiCheng-Lu Aug 14, 2025
a888514
use Xcode 16.4
ShiCheng-Lu Aug 14, 2025
20a9803
change xcode with sudo
ShiCheng-Lu Aug 14, 2025
c196aee
disable build library for distribution
ShiCheng-Lu Aug 14, 2025
86c5685
skip mock tracking test
ShiCheng-Lu Aug 14, 2025
be17fa7
podspec use swift 6
ShiCheng-Lu Aug 14, 2025
6c6036a
?
ShiCheng-Lu Aug 14, 2025
db34167
make RadarInAppMessage Sendable, set RadarSDKTest deploy target to 13.0+
ShiCheng-Lu Aug 14, 2025
951af9d
fix workflow step name
ShiCheng-Lu Aug 15, 2025
7198568
fixing build issue
cameron-morrow-toptal Aug 18, 2025
85d802b
minor fixes to new objc offline manager
cameron-morrow-toptal Aug 18, 2025
c372bc7
update github workflow
KennyHuRadar Aug 15, 2025
89b7355
cleanup debug logs, expose loadImage
ShiCheng-Lu Aug 18, 2025
4ad2208
more padding at the bottom of description
ShiCheng-Lu Aug 18, 2025
c5c66e4
conditionally render button
ShiCheng-Lu Aug 18, 2025
97d773d
fix test 1 (#468)
ShiCheng-Lu Aug 18, 2025
503001a
testing workflow
cameron-morrow-toptal Aug 19, 2025
de915ac
testing workflow
cameron-morrow-toptal Aug 19, 2025
1f2565d
testing workflow
cameron-morrow-toptal Aug 19, 2025
bf75ba8
testing workflow
cameron-morrow-toptal Aug 19, 2025
baba5f9
testing workflow
cameron-morrow-toptal Aug 19, 2025
3f77bdf
restored swift file
cameron-morrow-toptal Aug 19, 2025
971c68f
cleanup
cameron-morrow-toptal Aug 19, 2025
a5f8de1
cleanup
cameron-morrow-toptal Aug 19, 2025
35b64f7
Merge branch 'master' of https://github.com/radarlabs/radar-sdk-ios i…
cameron-morrow-toptal Aug 19, 2025
eef96ee
cleanup
cameron-morrow-toptal Aug 19, 2025
2f92832
cleanup
cameron-morrow-toptal Aug 19, 2025
53873a2
slightly smaller padding
ShiCheng-Lu Aug 18, 2025
5dba6ad
add RadarAPIClient
ShiCheng-Lu Aug 19, 2025
02da453
cleanup
ShiCheng-Lu Aug 19, 2025
64edbcb
log conversion in Manager so it's logged regardless of what delegate …
ShiCheng-Lu Aug 20, 2025
6c67eda
cleanup
ShiCheng-Lu Aug 20, 2025
b3cdc7c
make RadarLogger available in all threading contexts
ShiCheng-Lu Aug 20, 2025
16f57cb
Merge branch 'shicheng/iam2' of https://github.com/radarlabs/radar-sd…
cameron-morrow-toptal Aug 20, 2025
6d82e8f
move dismiss into manager
ShiCheng-Lu Aug 21, 2025
fe70888
rename button.url to deepLink
ShiCheng-Lu Aug 21, 2025
ce89a49
bump version
ShiCheng-Lu Aug 21, 2025
84e7d27
bump version
ShiCheng-Lu Aug 21, 2025
3515fe2
Merge branch 'shicheng/iam2' of https://github.com/radarlabs/radar-sd…
cameron-morrow-toptal Aug 25, 2025
c1adab4
Merge branch 'master' into shicheng/iam2
KennyHuRadar Aug 25, 2025
b5e58be
fixed errors from merge
cameron-morrow-toptal Aug 25, 2025
023c1fe
fix merge
KennyHuRadar Aug 25, 2025
f32631e
removed private module
cameron-morrow-toptal Aug 25, 2025
b5054b3
Merge branch 'master' of https://github.com/radarlabs/radar-sdk-ios i…
cameron-morrow-toptal Aug 25, 2025
4ff52a0
fixed errors from merge
cameron-morrow-toptal Aug 25, 2025
7f2fa1f
removed private module
cameron-morrow-toptal Aug 25, 2025
7f115e5
add conversion event when IAM is shown
ShiCheng-Lu Aug 25, 2025
3d5e0a3
cleanup
ShiCheng-Lu Aug 25, 2025
d77198a
rename IAM operations
ShiCheng-Lu Aug 25, 2025
c81a7c9
ios test compile fix
ShiCheng-Lu Aug 25, 2025
e28ceb7
change impl to use Radar.showInAppMessage
ShiCheng-Lu Aug 25, 2025
806f9df
update tests
ShiCheng-Lu Aug 25, 2025
808b4ea
fix test
ShiCheng-Lu Aug 25, 2025
168ba94
bump version
ShiCheng-Lu Aug 25, 2025
74ce88c
Merge branch 'shicheng/iam2' of https://github.com/radarlabs/radar-sd…
cameron-morrow-toptal Aug 26, 2025
69ec6bc
trying to fix mock tracking test
cameron-morrow-toptal Aug 26, 2025
fbae1c1
Merge branch 'master' of https://github.com/radarlabs/radar-sdk-ios i…
cameron-radar Sep 10, 2025
9f344ed
fixing merge errors
cameron-radar Sep 10, 2025
8596723
disabled test_Radar_mockTracking
cameron-radar Sep 11, 2025
c40c152
swiftui example app
ShiCheng-Lu Sep 12, 2025
91d4ae3
format
ShiCheng-Lu Sep 16, 2025
20d7d79
wip get offline data
ShiCheng-Lu Sep 16, 2025
68eb1ac
wip
ShiCheng-Lu Sep 17, 2025
ecf2252
.
ShiCheng-Lu Sep 17, 2025
2c32e48
offline manager pretend its track
ShiCheng-Lu Sep 17, 2025
e283cee
remove remote tracking options from sdk config
ShiCheng-Lu Sep 17, 2025
f72869a
.
ShiCheng-Lu Sep 18, 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
329be24
Merge branch 'shicheng/swiftui-example' into shicheng/offline-events
ShiCheng-Lu Sep 18, 2025
4106508
working geofence sync
ShiCheng-Lu Sep 18, 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
4 changes: 2 additions & 2 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Xcode - Build, Analyze, & Test

on:
push:
branches: [ master, develop ]
branches: [master, develop]
pull_request:
branches: [ master, develop ]
branches: [master, develop]

jobs:
build:
Expand Down
16 changes: 6 additions & 10 deletions .github/workflows/release-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ name: Radar SDK iOS Release
on:
# Triggered when a new release is tagged in GitHub.
release:
types: [ published ]
types: [published]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:

build:
runs-on: macos-15

Expand All @@ -25,17 +24,14 @@ jobs:
- name: Use Xcode 16.4
run: sudo xcode-select -switch /Applications/Xcode_16.4.app

- name: Use Xcode 16.4
run: sudo xcode-select -switch /Applications/Xcode_16.4.app

- name: Build, test, and analyze (RadarSDK)
run: xcodebuild clean build analyze test -workspace Example/Example.xcodeproj/project.xcworkspace -scheme RadarSDK -destination "platform=iOS Simulator,name=iPhone 15 Pro" | xcpretty

- name: Build archive for iPhone simulator (RadarSDK)
run: xcodebuild archive -scheme RadarSDK -archivePath "RadarSDK-iphonesimulator.xcarchive" -sdk iphonesimulator SKIP_INSTALL=NO CODE_SIGN_IDENTITY= CODE_SIGNING_REQUIRED=NO
run: xcodebuild archive -scheme RadarSDK -archivePath "RadarSDK-iphonesimulator.xcarchive" -sdk iphonesimulator SKIP_INSTALL=NO CODE_SIGN_IDENTITY= CODE_SIGNING_REQUIRED=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES

- name: Build archive for iPhone device (RadarSDK)
run: xcodebuild archive -scheme RadarSDK -archivePath "RadarSDK-iphoneos.xcarchive" -sdk iphoneos SKIP_INSTALL=NO CODE_SIGN_IDENTITY= CODE_SIGNING_REQUIRED=NO
run: xcodebuild archive -scheme RadarSDK -archivePath "RadarSDK-iphoneos.xcarchive" -sdk iphoneos SKIP_INSTALL=NO CODE_SIGN_IDENTITY= CODE_SIGNING_REQUIRED=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES

- name: Build archive for iPhone simulator (RadarSDKMotion)
run: cd RadarSDKMotion && xcodebuild archive -scheme RadarSDKMotion -archivePath "../RadarSDKMotion-iphonesimulator.xcarchive" -sdk iphonesimulator SKIP_INSTALL=NO CODE_SIGN_IDENTITY= CODE_SIGNING_REQUIRED=NO
Expand Down Expand Up @@ -71,7 +67,7 @@ jobs:
uses: svenstaro/upload-release-action@v2
with:
file: RadarSDK.xcframework.zip

- name: Upload XCFramework to release (RadarSDKMotion)
uses: svenstaro/upload-release-action@v2
with:
Expand All @@ -86,7 +82,7 @@ jobs:
- name: Get SHA256 checksum (RadarSDK)
id: checksum_radarsdk
run: echo "::set-output name=checksum::$(shasum -a 256 RadarSDK.xcframework.zip | cut -d ' ' -f 1)"

- name: Get SHA256 checksum (RadarSDKMotion)
id: checksum_radarsdkmotion
run: echo "::set-output name=checksum::$(shasum -a 256 RadarSDKMotion.xcframework.zip | cut -d ' ' -f 1)"
Expand Down
14 changes: 10 additions & 4 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 @@ -71,11 +73,12 @@
DD236D34230A006900EB88F9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
DD291168230D0AF900049D3A /* Utils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Utils.swift; sourceTree = "<group>"; };
DD86FCF9239185F4003225F6 /* RadarSDK.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RadarSDK.xcodeproj; path = ../RadarSDK.xcodeproj; sourceTree = SOURCE_ROOT; };
DD86FD0B23918B3C003225F6 /* Example-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Example-Bridging-Header.h"; sourceTree = "<group>"; };
DDB861D22385FC3E00770661 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = "<group>"; };
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 @@ -112,10 +115,11 @@
isa = PBXGroup;
children = (
E632FA1C2CAC366C00E86C85 /* Example.entitlements */,
DD86FD0B23918B3C003225F6 /* Example-Bridging-Header.h */,
DD236D34230A006900EB88F9 /* Info.plist */,
DDB861D22385FC3E00770661 /* Default-568h@2x.png */,
DD236D26230A006700EB88F9 /* AppDelegate.swift */,
F6513F5F2E6B736200523472 /* MainView.swift */,
F66DAD642E707F0300896773 /* waypoints.gpx */,
DD291168230D0AF900049D3A /* Utils.swift */,
DD236D2F230A006900EB88F9 /* Assets.xcassets */,
DD86FCF9239185F4003225F6 /* RadarSDK.xcodeproj */,
Expand Down Expand Up @@ -267,7 +271,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 @@ -413,7 +419,7 @@
"@executable_path/Frameworks",
);
MARKETING_VERSION = 3.5.0;
PRODUCT_BUNDLE_IDENTIFIER = io.radar.iosexample;
PRODUCT_BUNDLE_IDENTIFIER = io.radar.iosexample1;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 5.0;
Expand Down Expand Up @@ -443,7 +449,7 @@
"@executable_path/Frameworks",
);
MARKETING_VERSION = 3.5.0;
PRODUCT_BUNDLE_IDENTIFIER = io.radar.iosexample;
PRODUCT_BUNDLE_IDENTIFIER = io.radar.iosexample1;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 5.0;
Expand Down
51 changes: 31 additions & 20 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,18 +31,19 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UIWindowSceneDelegate, UN

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

UserDefaults.standard.set("https://shichengradar.ngrok.app", forKey: "radar-host")
// 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.initialize(publishableKey: "prj_test_pk_", options: radarInitializeOptions )
Radar.setUserId("testUserId")
Radar.setMetadata([ "foo": "bar" ])
Radar.setDelegate(self)
Radar.setVerifiedDelegate(self)

return true
}


func application(_ app: UIApplication, open url: URL,
options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
Expand Down Expand Up @@ -75,12 +79,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 +106,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UIWindowSceneDelegate, UN
}
}


demoButton(text: "iam") {
Radar.showInAppMessage(RadarInAppMessage.fromDictionary([
"title": [
Expand Down Expand Up @@ -430,27 +439,29 @@ 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 })
}
}
// 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
9 changes: 0 additions & 9 deletions Example/Example/Example-Bridging-Header.h

This file was deleted.

Loading
Loading