Unverified Commit 275c64b0 authored by Gant Laborde's avatar Gant Laborde Committed by GitHub

Merge pull request #283 from redak105/master

updated tvOS support
parents d80e333d d04b83bd
...@@ -7,7 +7,8 @@ Pod::Spec.new do |s| ...@@ -7,7 +7,8 @@ Pod::Spec.new do |s|
s.license = "MIT" s.license = "MIT"
s.authors = { "Rebecca Hughes" => "rebecca@learnium.net" } s.authors = { "Rebecca Hughes" => "rebecca@learnium.net" }
s.platform = :ios, "7.0" s.ios.deployment_target = '9.0'
s.tvos.deployment_target = '10.0'
s.source = { :git => "https://github.com/rebeccahughes/react-native-device-info.git" } s.source = { :git => "https://github.com/rebeccahughes/react-native-device-info.git" }
......
...@@ -16,7 +16,9 @@ ...@@ -16,7 +16,9 @@
@property (nonatomic) bool isEmulator; @property (nonatomic) bool isEmulator;
@end @end
#if !(TARGET_OS_TV)
@import CoreTelephony; @import CoreTelephony;
#endif
@implementation RNDeviceInfo @implementation RNDeviceInfo
...@@ -156,9 +158,13 @@ RCT_EXPORT_MODULE(RNDeviceInfo) ...@@ -156,9 +158,13 @@ RCT_EXPORT_MODULE(RNDeviceInfo)
- (NSString *) carrier - (NSString *) carrier
{ {
#if (TARGET_OS_TV)
return nil;
#else
CTTelephonyNetworkInfo *netinfo = [[CTTelephonyNetworkInfo alloc] init]; CTTelephonyNetworkInfo *netinfo = [[CTTelephonyNetworkInfo alloc] init];
CTCarrier *carrier = [netinfo subscriberCellularProvider]; CTCarrier *carrier = [netinfo subscriberCellularProvider];
return carrier.carrierName; return carrier.carrierName;
#endif
} }
- (NSString*) userAgent - (NSString*) userAgent
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment