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

Store startTrackingAfter and stopTrackingAfter as ms since Unix epoch, with backcompat [WIP] #129

Closed
wants to merge 6 commits into from

Conversation

nickpatrick
Copy link
Contributor

No description provided.

* develop: (121 commits)
  [sc-8770] [project] Updated the release version to 3.3.1, and dropped the beta suffix.
  [sc-8281] [project] Removed "RadarSDK.h" from the Package.swift's list of files to exclude. It was a holdover from when I was trying to add a testTarget().
  [sc-8281] [project] Now that we've dropped the Swift Package Manager's testTarget(), all of the source files (except public headers) can go back to their original locations.
  8281: [project] Added the dist/ folder to .gitignore.
  8281: [project] Added the Package.swift file to the project, just so that it can be edited right in Xcode.
  8281: [project] Restored the Package.swift file. Moved the model and internal-only .m files into the Internal folder.
  8291: [project] In an effort to move toward a source-only distribution, Swift Package Manager support and the precompiled XCFrameworks in the dist subfolder. Carthage, too, will build from source, because its RadarSDK.json file has been removed.
  8281: [project] Now that the Swift Package Manager's testTarget is gone, the duplicate RadarSDK.h can go, too.
  8281: [project] Bumped the version to 3.3.1(-beta.1).
  8281: [project] Removed the Swift Package Manager's .testTarget again, because I can't get the unit tests to find their JSON data files. Swift Package Manager puts them in a resource bundle inside the main bundle, whereas the Xcode project puts them at the top level of the main bundle. Why?
  8281: [project] The unit tests now compile, but they needed to specify relative paths for the project-scoped #includes, and I'm not exactly sure why.
  consistent purging
  8281: [project] Adding a second copy of the RadarSDK.h. One should be used by Swift Package Manager, and the other by the Xcode project.
  8281: [project] Added a .testTarget to Package.swift.
  8281: [project] Package.swift now builds the SDK from source, instead of using a precompiled XCFramework. This required moving all of the headers into either an Include (for public headers) or Internal (for project-scope headers) folder. Code-wise, nothing changed. It now builds both from the Xcode project and as a Swift package.
  8556: [project] Removed the XCFramework and documentation steps from the GitHub release workflow, since we still have to do these things manually right now anyway.
  8556: [project] Re-ran make dist.
  8556: [project] Fixed the dist target in the Makefile.
  8556: [project] Bumped the version number to 3.3.0.
  8531: [project] The XCFramework target now includes the .dSYM debug symbols.
  ...
@jrtibbetts jrtibbetts changed the base branch from master to develop February 10, 2022 04:32
* develop: (35 commits)
  [sc-8564] [project] Added various top-level files to the project so that they can be searched and edited within Xcode. Dropped the "-beta.2" suffix from the version number.
  [sc-8564] [cleanup] Removed a commented-out line.
  log network error
  [sc-8564] [fix] Added "RadarMeta.h" to the umbrella header.
  [sc-8853] [fix] Removed a duplicate method, caused by the merge.
  [sc-8853] [docs] Added a comment.
  [sc-8853] [add] Added Radar.sdkVersion.
  [sc-8853] [add] Added Radar.sdkVersion.
  syncGeofences for continuous (#157)
  [sc-8770] Merge develop into master for the 3.3.1 release (#153)
  [sc-8770] [project] Dropped the "-beta.1" from the version number.
  [sc-8770] [project] Updated the version numbers to 3.3.1(-beta.1).
  [sc-8564] [project] Bumped the version number to 3.4.0(-beta.2).
  store client and remote tracking options separately to avoid client options overwriting server tracking options
  [sc-8564] [fix] RadarAPIClient.getConfig() no longer flushes the logs if the config/ request fails.
  [sc-8564] [cleanup] Missed a space.
  [sc-8564] [add] RadarLocationManager.updateTrackingFromMeta(:) now logs whether server-side tracking options are used.
  [sc-8564] [remove] Removed RadarMeta.config.
  [sc-8564] [fix] Removed a redundant call to `RadarSettings.setTrackingOptions(:)`.
  8564: [fix] Restored a Radar.flushLogs() call that was dropped during the merge. Renamed a block argument to indicate that it's ignored.
  ...
* develop:
  make log uniform with Android
  fix string formatter
  fix compile error
  Adds logging to adding and removing bubble and synced geofences
  Bump json from 2.1.0 to 2.6.1
  regenerate docs
  revert docs
  fix tests
  update docs
  remove from Xcode
* develop: (157 commits)
  [sc-11504] [project] Regenerated docs.
  [sc-11504] [project] Bumped to 3.5.3.
  [sc-11505] [add] Added a RadarTripOptions.approachingThreshold property that's passed in when starting or updating trips.
  sc-11459: 3.5.2 Release (#200)
  [sc-11459] [project] Regenerated docs.
  [sc-11337] [fix] Fixed custom event metadata parsing and added metadata assertions to the unit tests.
  [sc-11274] [comment] Added a comment to the Radar.searchPlaces() example.
  [sc-11410] [fix] Removed a statement that's no longer reachable.
  [sc-11410] [minor] Typo.
  [sc-11410] [minor] Formatting.
  [sc-11410] [fix] If RadarApiClient.sendEvent() returns no events, then something went wrong, and a server error should be passed to the completion handler.
  [sc-11274] [minor] Removed unnecessary trailing commas in a JSON file, even though they're valid JSON and iOS parses them without errors. When I copied the file to the Android SDK, however, Android complained. This just keeps the files in sync.
  [sc-11274] [project] Bumped to 3.5.2.
  [sc-11274] [docs] Tweaked the Radar.searchPlaces() docs.
  Merge develop (3.5.1) into master (#197)
  [sc-11274] [add] Added a unit test for Radar.searchPlaces() with chainMetadata.
  [sc-11274] [fix] Radar.searchPlaces() with chainMetadata now works. The metadata that's returned still isn't being parsed correctly, so that will be the next thing to fix.
  [sc-11274] [fix] Prepended each chainMetadata value with a colon, and changed the Example app's chainMetadata to match the values I set up in Dashboard.
  [sc-11274] [add] Added Radar.searchPlaces(near:radius:chains:chainMetadata:categories:groups:limit:completionHandler:) and Radar.searchPlaces(radius:chains:chainMetadata:categories:groups:limit:completionHandler:) overloads to support chain metadata.
  [sc-11210] [project] Regenerated the docs.
  ...
Comment on lines +242 to +243
dict[kStartTrackingAfter] = self.startTrackingAfter ? @([self.startTrackingAfter timeIntervalSince1970] * 1000) : nil;
dict[kStopTrackingAfter] = self.stopTrackingAfter ? @([self.stopTrackingAfter timeIntervalSince1970] * 1000) : nil;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two lines cause the XCTAssertEqualObjects() line in the RadarSDKTests.test_Radar_startTracking_custom() test to fail, because now it's trying to compare an NSDate with a TimeInterval. The test passes if these lines are reverted.

@jrtibbetts
Copy link
Contributor

Superseded by a Capacitor-side fix in radarlabs/capacitor-radar PR 58.

@tjulien tjulien closed this Mar 2, 2023
@nickpatrick nickpatrick deleted the start-stop-tracking-after branch March 8, 2023 18:01
ShiCheng-Lu pushed a commit that referenced this pull request Jun 13, 2024
ShiCheng-Lu pushed a commit that referenced this pull request Jun 13, 2024
* update build config, remove AsyncTask, unnecessary annotations

* fix extra getLocation() callback on permissions error

* use newSingleThreadExecutor() and Thread.sleep(1000)

* uncomment sample code

* unwrap RadarActivityLifecycleCallbacks checks

* remove setLogLevel from sample code

* add comment

* remove extra return

* remove newline

* only sleep for track calls

* bump version, fix tests

* fix ERROR_LOCATION status

* Android 12 (#120)

* Move BluetoothAdapter initialization after permission check (#109)

* move BluetoothAdapter initialization after permission check

* prevent extra getLocation() callback when permissions aren't granted

* Update README.md

Add Maven Central badge

* Wrap Activity references in RadarActivityLifecycleCallbacks (#111)

* try/catch permissions logic in RadarActivityLifecycleCallbacks

* add logging

* expose event.trip and beacon.metadata

* remove alpha

* call callback immediately if no beacons to range

* revert beacons change for now

* 3.1.4 (#112)

* expose postal code events, support locationless trip status updates, bump version, dist

* pass options to PATCH endpoint

* updateTrip(), responsive defaults

* docs

* Add callbacks to trip update functions (#114)

* catch bad requests

* add trip callbacks

* add back tripOptions

* flush location updates on all trip updates, javadocs

* clear trip options immediately on complete or cancel

* clear trip options only on success or 404 in completeTrip() and cancelTrip()

* Add Maven Central publication task (#116)

* add Maven Central publication task

* output javadocs to /docs

* upgrade dokka

* generate kdocs and javadocs, update BuildConfig

* bump version

* fix CI

* fix CI

* bump version

* use correct properties

* Update README.md

* call callback when no nearby beacons (#117)

* bump version (#118)

* Make beacon UUIDs case insensitive (#119)

* fix error code

* lowercase uuid

* bump version

* case insensitive compare

* compare uuids directly

* Foreground service support and tracking options updates (#121)

* useForegroundService and syncGeofencesLimit tracking options

* add foreground service, update tracking options

* send syncGeofencesLimit

* rm extra newlines

* rm extra newlines

* rm extra newlines

* add RadarTrackingOptionsForegroundService

* store context in logger, log all requests and responses

* pass logger

* expose location.mocked

* fix foreground service logging

* fix tests

* add foreground service test

* fix tests

* set icon and PendingIntent

* null handling

* add background beacon monitoring

* fix tests

* remove callback on timeout

* bump version

* avoid unnecessary rescans, bump verison

* avoid unnecessary rescans, bump verison

* dist

* use app name as foreground service title

* dist

* add RadarTrackingOptionsForegroundService docs

* use startForegroundService() to stop service, catch exceptions

* use startService() to stop service, store monitored beacons in memory

* remove force for beacon locations

* use ScanSettings.MATCH_MODE_STICKY

* clean up logging

* remove aluetoothLeScanner usage from RadarLocationReceiver

* remove BluetoothLeScanner usage from RadarLocationReceiver

* Use getCurrentLocation() instead of LocationRequest for trackOnce() (#122)

* use getCurrentLocation() for trackOnce()

* bump version

* logs consistency

* fix tests

* Update bad comment about tracking options (#123)

* Add Bluetooth permission checks (#124)

* add permission checks

* check if Bluetooth supported

* add logging

* comment out Bluetooth permissions

* rm extra newline

* More responsiveness improvements (#125)

* listen for moving bubble exit transition, skip JobScheduler if foregroundService set

* update intent filters

* add more logging, fix moving radius, always use JobScheduler

* use callCallbacks()

* remove unused handler

* remove unused import

* Catch exceptions constructing ScanFilters, better RadarForegroundService checks (#127)

* fix params log

* catch exceptions constructing ScanFilters

* check if RadarForegroundService is started before calling startForegroundService()

* beta

* bypass JobScheduler if RadarForegroundService started

* non-beta

* revert JobScheduler logic

* Layers + country params for autocomplete (#128)

* layers added to autocomplete. build instructions needed

* country

* layers-autocomplete

* build fixes

* country in autocomplete call fix

* default as null

* limit first before layers

* dist

* add second method signature, bump version

Co-authored-by: Nick Patrick <nicholasjohnpatrick@gmail.com>

* Fix address serialization (#129)

* bump version (#130)

* WIP support for Android 12

* WIP support for Android 12

* Fix Lint: compileSdkVersion (30) should not be lower than the targetSdkVersion (31)

* More changes needed for Android 12

* Update roboelectric and bump up sdk version

* Make example app more useable

* Revert example app

* Bump up to sdk 31 (android 12)

* Fix merge conflicts

* Force main loop to flush tasks

* Make sure IMMUTABLE flag is passed for all pending intents

* fix callback

* fix error response logging

Co-authored-by: Nick Patrick <nicholasjohnpatrick@gmail.com>
Co-authored-by: Jeff Kao <jeff@radar.io>
Co-authored-by: David Goodfellow <61531269+david-goodfellow@users.noreply.github.com>
Co-authored-by: Jeff Kao <jkao@jkao.fios-router.home>
Co-authored-by: Jeff Kao <jeff.kao.000@gmail.com>

* dist

* fix beacon intent mismatch

* support BLUETOOTH_SCAN permission, add comments

* make request codes private

* flip shouldShowRequestPermissionRationale logic

* upgrade versions

* remove LocalBroadcastManager

* use flag mutable

* handle synced geofence errors

* add events to trip callbacks

* send locationAccuracyAuthorization to POST /track

* don't send trip errors to receiver

* coarse checks for trackOnce() and startTracking()

* send trip events to receiver, fix example app

* docs

* update migration guide

* call callbacks on main thread, stop foreground service when switching from continuous to responsive

* mockTracking() looper

* ShadowLooper for tests

* add stopDistance and stopDuration for continuous

* bump version

* update migration guide

* Fix location accuracy check (#133)

Co-authored-by: Tim Julien <tim@radar.io>
Co-authored-by: Jeff Kao <jeff@radar.io>
Co-authored-by: David Goodfellow <61531269+david-goodfellow@users.noreply.github.com>
Co-authored-by: Jeff Kao <jkao@jkao.fios-router.home>
Co-authored-by: Jeff Kao <jeff.kao.000@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants