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

fix(ios,tvos): Remove IPv4-only paths to prevent App Store warnings #431

Merged
merged 1 commit into from
Jan 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,6 @@ index.ios.bundle

# generated by bob
lib/

# npm package lock file
package-lock.json
8 changes: 6 additions & 2 deletions ios/RNCNetInfo.m
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,9 @@ - (NSString *)ipAddress
[ifname isEqualToString:@"en1"]
) {
// Get NSString from C String
address = [NSString stringWithUTF8String:inet_ntoa(((struct sockaddr_in *)temp_addr->ifa_addr)->sin_addr)];
char str[INET_ADDRSTRLEN];
inet_ntop(AF_INET, &((struct sockaddr_in *)temp_addr->ifa_addr)->sin_addr, str, INET_ADDRSTRLEN);
address = [NSString stringWithUTF8String:str];
}
}

Expand Down Expand Up @@ -198,7 +200,9 @@ - (NSString *)subnet
[ifname isEqualToString:@"en1"]
) {
// Get NSString from C String
subnet = [NSString stringWithUTF8String:inet_ntoa(((struct sockaddr_in *)temp_addr->ifa_netmask)->sin_addr)];
char str[INET_ADDRSTRLEN];
inet_ntop(AF_INET, &((struct sockaddr_in *)temp_addr->ifa_netmask)->sin_addr, str, INET_ADDRSTRLEN);
subnet = [NSString stringWithUTF8String:str];
}
}

Expand Down