Skip to content
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

Companion app #413

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Build, Analyze, & Test
env:
scheme: RadarSDK
Expand Down
14 changes: 12 additions & 2 deletions .github/workflows/release-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,22 @@ jobs:
event-type: update-xcframework
client-payload: '{"release": "${{ github.event.release.tag_name }}", "checksum": "${{ steps.checksum_radarsdk.outputs.checksum }}", "url": "${{ github.event.release.html_url }}", "checksum_motion": "${{ steps.checksum_radarsdkmotion.outputs.checksum }}"}'

- name: Check versions is not duplicate
run: |
VERSION=$(pod ipc spec RadarSDK.podspec | jq -r .version)
! pod trunk info RadarSDK | grep -q $VERSION
echo "RadarSDK version is OK"
VERSION=$(pod ipc spec RadarSDKMotion.podspec | jq -r .version)
! pod trunk info RadarSDKMotion | grep -q $VERSION
echo "RadarSDKMotion version is OK"

- name: Deploy to Cocoapods
run: |
set -eo pipefail
gem install cocoapods
pod lib lint --allow-warnings RadarSDK.podspec
pod trunk push --allow-warnings RadarSDK.podspec
pod lib lint --allow-warnings RadarSDKMotion.podspec
pod trunk push --allow-warnings RadarSDK.podspec
pod trunk push --allow-warnings RadarSDKMotion.podspec
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict/>
</plist>
8 changes: 8 additions & 0 deletions Example/Example/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,14 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UIWindowSceneDelegate, UN
}
}

demoButton(text: "startVerifyServer") {
Radar.startVerifyServer()
}

demoButton(text: "stopVerifyServer") {
Radar.stopVerifyServer()
}

demoButton(text: "searchPlaces") {
// In the Radar dashboard settings
// (https://radar.com/dashboard/settings), add this to the chain
Expand Down
13 changes: 13 additions & 0 deletions Example/Example/Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// swift-tools-version:5.8
import PackageDescription

let package = Package(
name: "MyProject",
dependencies: [
.package(url: "https//github.com/apple/swift-nio.git", from: "2.0.0"),
.package(url: "https://github.com/apple/swift-nio-ssl.git", from: "2.0.0")
],
targets: [
.target(name: "MyProject", dependencies: ["NIO", "NIOSSL"]),
]
)
13 changes: 10 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import PackageDescription
let package = Package(
name: "RadarSDK",
platforms: [
.iOS(.v10)
.iOS(.v12)
],
products: [
.library(
Expand All @@ -16,7 +16,10 @@ let package = Package(
targets: ["RadarSDKMotion"]
)
],
dependencies: [],
dependencies: [
.package(url: "https://github.com/apple/swift-nio.git", from: "2.62.0"),
.package(url: "https://github.com/apple/swift-nio-ssl.git", from: "2.25.0")
],
targets: [
.target(
name: "RadarSDK",
Expand All @@ -26,6 +29,10 @@ let package = Package(
publicHeadersPath: "Include",
cSettings: [
.headerSearchPath(".")
],
dependencies: [
.product(name: "NIO", package: "swift-nio"),
.product(name: "NIOHTTP1", package: "swift-nio")
]
),
.target(
Expand All @@ -35,7 +42,7 @@ let package = Package(
publicHeadersPath: "Include",
cSettings: [
.headerSearchPath(".")
]
]
)
]
)
7 changes: 4 additions & 3 deletions RadarSDK.podspec
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
Pod::Spec.new do |s|
s.name = 'RadarSDK'
s.version = '3.19.0'
s.version = '3.19.1'
s.summary = 'iOS SDK for Radar, the leading geofencing and location tracking platform'
s.homepage = 'https://radar.com'
s.author = { 'Radar Labs, Inc.' => 'support@radar.com' }
s.platform = :ios
s.source = { :git => 'https://github.com/radarlabs/radar-sdk-ios.git', :tag => s.version.to_s }
s.source_files = ["RadarSDK/*.{h,m}", "RadarSDK/Internal/*.{h,m}", "RadarSDK/Include/*.h"]
s.source_files = ["RadarSDK/*.{h,m,swift}", "RadarSDK/Include/*.h"]
s.module_name = 'RadarSDK'
s.ios.deployment_target = '10.0'
s.ios.deployment_target = '12.0'
s.frameworks = 'CoreLocation'
s.requires_arc = true
s.license = { :type => 'Apache-2.0' }
s.resource_bundles = {'RadarSDK' => ['RadarSDK/PrivacyInfo.xcprivacy']}
s.swift_version = '5.0'
end
39 changes: 23 additions & 16 deletions RadarSDK.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@
0107AB2F262201FB008AB52F /* RadarUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = DD236D0423099B8400EB88F9 /* RadarUtils.m */; };
0107AB7A2622061A008AB52F /* RadarSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0107A9E82621FFB9008AB52F /* RadarSDK.framework */; };
0114F058284EFDB700ADA4E4 /* RadarRouteMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0114F057284EFDB700ADA4E4 /* RadarRouteMode.h */; settings = {ATTRIBUTES = (Public, ); }; };
015C53AD29B8E8BA004F53A6 /* (null) in Headers */ = {isa = PBXBuildFile; };
015C53AE29B8E8BA004F53A6 /* (null) in Sources */ = {isa = PBXBuildFile; };
0158673E2CEB3B83007BEAC0 /* RadarVerifyServer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0158673D2CEB3B83007BEAC0 /* RadarVerifyServer.swift */; };
015867572CEB5071007BEAC0 /* RadarVerifyServer.h in Headers */ = {isa = PBXBuildFile; fileRef = 015867562CEB5071007BEAC0 /* RadarVerifyServer.h */; };
019514362BD078D90031ABA2 /* RadarVerifiedLocationToken.h in Headers */ = {isa = PBXBuildFile; fileRef = 019514352BD077D10031ABA2 /* RadarVerifiedLocationToken.h */; settings = {ATTRIBUTES = (Public, ); }; };
019514392BD081630031ABA2 /* RadarVerifiedLocationToken.m in Sources */ = {isa = PBXBuildFile; fileRef = 019514372BD081630031ABA2 /* RadarVerifiedLocationToken.m */; };
0195143A2BD081630031ABA2 /* RadarVerifiedLocationToken+Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 019514382BD081630031ABA2 /* RadarVerifiedLocationToken+Internal.h */; };
Expand Down Expand Up @@ -188,6 +188,8 @@
0107A9E82621FFB9008AB52F /* RadarSDK.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = RadarSDK.framework; sourceTree = BUILT_PRODUCTS_DIR; };
0113020E2AE1467800EFC377 /* Network.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Network.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/System/Library/PrivateFrameworks/Network.framework; sourceTree = DEVELOPER_DIR; };
0114F057284EFDB700ADA4E4 /* RadarRouteMode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RadarRouteMode.h; sourceTree = "<group>"; };
0158673D2CEB3B83007BEAC0 /* RadarVerifyServer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RadarVerifyServer.swift; sourceTree = "<group>"; };
015867562CEB5071007BEAC0 /* RadarVerifyServer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RadarVerifyServer.h; sourceTree = "<group>"; };
019514352BD077D10031ABA2 /* RadarVerifiedLocationToken.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RadarVerifiedLocationToken.h; sourceTree = "<group>"; };
019514372BD081630031ABA2 /* RadarVerifiedLocationToken.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RadarVerifiedLocationToken.m; sourceTree = "<group>"; };
019514382BD081630031ABA2 /* RadarVerifiedLocationToken+Internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "RadarVerifiedLocationToken+Internal.h"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -533,6 +535,8 @@
DD236D0423099B8400EB88F9 /* RadarUtils.m */,
82F7FAEC2A65FE030055AA4B /* RadarVerificationManager.h */,
82F7FAED2A65FE030055AA4B /* RadarVerificationManager.m */,
015867562CEB5071007BEAC0 /* RadarVerifyServer.h */,
0158673D2CEB3B83007BEAC0 /* RadarVerifyServer.swift */,
DD27CB7D235D13F000299FEC /* Models */,
53CCD781275E576B00F79CC8 /* Util */,
);
Expand Down Expand Up @@ -574,8 +578,8 @@
96A5A0BA27AD9F41007B960B /* RadarContext+Internal.h */,
5343FFD923E38BA300808D93 /* RadarContext.m */,
96A5A0B627AD9F40007B960B /* RadarCoordinate+Internal.h */,
96A5A0B927AD9F41007B960B /* RadarEvent+Internal.h */,
DD236CBA2308812700EB88F9 /* RadarCoordinate.m */,
96A5A0B927AD9F41007B960B /* RadarEvent+Internal.h */,
DD236CB82308812700EB88F9 /* RadarEvent.m */,
96A5A0AD27AD9F40007B960B /* RadarFraud+Internal.h */,
96FC90F6277379C1000757DF /* RadarFraud.m */,
Expand Down Expand Up @@ -678,7 +682,6 @@
96A5A10927AD9F7F007B960B /* RadarContext.h in Headers */,
0107AA1226220049008AB52F /* RadarCollectionAdditions.h in Headers */,
E6EEC56E2B20F41A00DD096B /* RadarFileStorage.h in Headers */,
015C53AD29B8E8BA004F53A6 /* (null) in Headers */,
0107AA1C26220055008AB52F /* RadarPermissionsHelper.h in Headers */,
96A5A11227AD9F7F007B960B /* Radar.h in Headers */,
96A5A10827AD9F7F007B960B /* RadarSegment.h in Headers */,
Expand Down Expand Up @@ -711,6 +714,7 @@
96A5A10127AD9F7F007B960B /* RadarRoute.h in Headers */,
96A5A0FE27AD9F7F007B960B /* RadarTrip.h in Headers */,
96A5A10027AD9F7F007B960B /* RadarCoordinate.h in Headers */,
015867572CEB5071007BEAC0 /* RadarVerifyServer.h in Headers */,
532FC304277A790600989279 /* Radar+Internal.h in Headers */,
96A5A0FB27AD9F7F007B960B /* RadarChain.h in Headers */,
);
Expand Down Expand Up @@ -767,7 +771,7 @@
TargetAttributes = {
0107A9E72621FFB9008AB52F = {
CreatedOnToolsVersion = 12.4;
LastSwiftMigration = 1320;
LastSwiftMigration = 1610;
};
0107AB3826220308008AB52F = {
CreatedOnToolsVersion = 12.4;
Expand Down Expand Up @@ -868,7 +872,6 @@
8227EF0C2CDAB69B00C47290 /* RadarRouteMode.m in Sources */,
9683FD6527B36C26009EBB6B /* RadarMeta.m in Sources */,
0107AA9B26220153008AB52F /* RadarContext.m in Sources */,
015C53AE29B8E8BA004F53A6 /* (null) in Sources */,
0107AB23262201EC008AB52F /* RadarSettings.m in Sources */,
0107AAAA26220165008AB52F /* RadarGeofenceGeometry.m in Sources */,
0107AAEC262201A6008AB52F /* RadarTrip.m in Sources */,
Expand Down Expand Up @@ -897,6 +900,7 @@
0107AA832622013A008AB52F /* RadarBeacon.m in Sources */,
82F7FAEB2A65FDD50055AA4B /* RadarNotificationHelper.m in Sources */,
0107AAB626220172008AB52F /* RadarPolygonGeometry.m in Sources */,
0158673E2CEB3B83007BEAC0 /* RadarVerifyServer.swift in Sources */,
0107AB0E262201D5008AB52F /* RadarBeaconManager.m in Sources */,
82D04AC729771BF10036619F /* RadarReplay.m in Sources */,
0107AADA26220195008AB52F /* RadarRouteMatrix.m in Sources */,
Expand Down Expand Up @@ -937,6 +941,7 @@
0107A9ED2621FFB9008AB52F /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO;
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
Expand All @@ -947,26 +952,28 @@
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = RadarSDK/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 3.9.6;
PRODUCT_BUNDLE_IDENTIFIER = io.radar.sdk;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = "";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = "1,2";
TVOS_DEPLOYMENT_TARGET = 10.0;
TVOS_DEPLOYMENT_TARGET = 12.0;
};
name = Debug;
};
0107A9EE2621FFB9008AB52F /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO;
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
Expand All @@ -977,20 +984,20 @@
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = RadarSDK/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 3.9.6;
PRODUCT_BUNDLE_IDENTIFIER = io.radar.sdk;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = "";
SKIP_INSTALL = YES;
SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = "1,2";
TVOS_DEPLOYMENT_TARGET = 10.0;
TVOS_DEPLOYMENT_TARGET = 12.0;
};
name = Release;
};
Expand Down Expand Up @@ -1065,8 +1072,8 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
MARKETING_VERSION = 3.19.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MARKETING_VERSION = 3.19.1;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -1123,8 +1130,8 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
MARKETING_VERSION = 3.19.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MARKETING_VERSION = 3.19.1;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
OTHER_CFLAGS = "-fembed-bitcode";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"originHash" : "5b93791d19b1fba6dd03f2def460785e85cc17099b7c47acd513cd259380ff0c",
"pins" : [
{
"identity" : "swift-atomics",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-atomics.git",
"state" : {
"revision" : "cd142fd2f64be2100422d658e7411e39489da985",
"version" : "1.2.0"
}
},
{
"identity" : "swift-collections",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-collections.git",
"state" : {
"revision" : "671108c96644956dddcd89dd59c203dcdb36cec7",
"version" : "1.1.4"
}
},
{
"identity" : "swift-nio",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio.git",
"state" : {
"revision" : "914081701062b11e3bb9e21accc379822621995e",
"version" : "2.76.1"
}
},
{
"identity" : "swift-nio-ssl",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio-ssl",
"state" : {
"revision" : "c7e95421334b1068490b5d41314a50e70bab23d1",
"version" : "2.29.0"
}
},
{
"identity" : "swift-system",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-system.git",
"state" : {
"revision" : "c8a44d836fe7913603e246acab7c528c2e780168",
"version" : "1.4.0"
}
}
],
"version" : 3
}
14 changes: 14 additions & 0 deletions RadarSDK/Include/Radar.h
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,20 @@ typedef void (^_Nullable RadarLogConversionCompletionHandler)(RadarStatus status
*/
+ (void)stopTrackingVerified NS_SWIFT_NAME(stopTrackingVerified());

/**
Starts the Radar Verify companion app server.

@warning Note that you must configure SSL pinning before calling this method.
*/
+ (void)startVerifyServer NS_SWIFT_NAME(startVerifyServer());

/**
Stops the Radar Verify companion app server.

@warning Note that you must configure SSL pinning before calling this method.
*/
+ (void)stopVerifyServer NS_SWIFT_NAME(stopVerifyServer());

/**
Returns the user's last verified location token if still valid, or requests a fresh token if not.

Expand Down
4 changes: 2 additions & 2 deletions RadarSDK/Include/RadarUser.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,6 @@ typedef NS_ENUM(NSInteger, RadarActivityType);
*/
@property (nullable, copy, nonatomic, readonly) NSArray<RadarChain *> *topChains;

- (NSDictionary *_Nonnull)dictionaryValue;

/**
The source of the user's current location.
*/
Expand All @@ -158,4 +156,6 @@ typedef NS_ENUM(NSInteger, RadarActivityType);
*/
@property (nullable, copy, nonatomic, readonly) RadarFraud *fraud;

- (NSDictionary *_Nonnull)dictionaryValue;

@end
5 changes: 5 additions & 0 deletions RadarSDK/Include/RadarVerifiedLocationToken.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@
*/
@property (nullable, copy, nonatomic, readonly) NSString *_id;

/**
The raw dictionary value of the token.
*/
@property (nullable, copy, nonatomic, readonly) NSDictionary *rawDict;

- (NSDictionary *_Nonnull)dictionaryValue;

@end
Loading
Loading