Skip to content

Commit

Permalink
Added a fix for showing the IP address: now getting it from a better …
Browse files Browse the repository at this point in the history
…provider that returns text only.
  • Loading branch information
ChefAharoni committed Mar 4, 2025
1 parent 412e00e commit 7005dd8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ShowMyIP/IPFetcher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ class IPFetcher: ObservableObject {

func fetchIPAddress() {
print("Starting to fetch IP address...") // Debug log
guard let url = URL(string: "http://ifconfig.me") else {
// guard let url = URL(string: "https://ifconfig.me/ip") else {
guard let url = URL(string: "https://api.ipify.org/?format=text") else {
DispatchQueue.main.async {
self.ipAddress = "Invalid URL"
}
Expand Down

0 comments on commit 7005dd8

Please sign in to comment.