Skip to content

Commit

Permalink
Use URL from the config
Browse files Browse the repository at this point in the history
  • Loading branch information
tananaev committed Apr 21, 2024
1 parent 73d4fa0 commit 37e749b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion AirtagSync/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func uploadItem(url: URL, item: [String: Any]) -> String? {

log("Sending \(name) location")

var request = URLRequest(url: URL(string: "https://demo.traccar.org")!)
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.httpBody = "id=\(name)&lat=\(latitude)&lon=\(longitude)".data(using: .utf8)
request.addValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,8 @@ Default configuration:
You can change those parameters in the `launchd` configuration:

- `/Library/LaunchAgents/org.traccar.sync.plist`

To apply new configuration, make sure to reload the service:

- `launchctl unload /Library/LaunchAgents/org.traccar.sync.plist`
- `launchctl load /Library/LaunchAgents/org.traccar.sync.plist`

0 comments on commit 37e749b

Please sign in to comment.