aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firebase
diff options
context:
space:
mode:
authorGravatar Paul Beusterien <paulbeusterien@google.com>2018-01-03 12:12:22 -0800
committerGravatar GitHub <noreply@github.com>2018-01-03 12:12:22 -0800
commitf08b5044d64197a3227017ad44235a2bd7421691 (patch)
tree0ea97726a39d1746acf260f42ef35c18f363f4e2 /Firebase
parent9179dd86bfa507ede505c788a513e3824ad01856 (diff)
Add Community Supported tvOS (#590)
Add Community Supported tvOS for Core, Auth, Database and Storage. Add tvOS unit tests Add tvOS sample app Update README.md Add tvOS to travis testing
Diffstat (limited to 'Firebase')
-rw-r--r--Firebase/Auth/Source/FIRAuthAPNSTokenManager.m2
-rw-r--r--Firebase/Core/FIRNetworkURLSession.m1
-rw-r--r--Firebase/Core/FIRReachabilityChecker.m4
-rw-r--r--Firebase/Core/third_party/FIRAppEnvironmentUtil.m10
-rw-r--r--Firebase/Database/Core/FPersistentConnection.m2
-rw-r--r--Firebase/Database/Core/FRepo.m4
-rw-r--r--Firebase/Database/Persistence/FLevelDBStorageEngine.m2
-rw-r--r--Firebase/Database/Realtime/FWebSocketConnection.m4
-rw-r--r--Firebase/Database/third_party/SocketRocket/FSRWebSocket.m4
-rw-r--r--Firebase/Storage/FIRStorageUtils.m2
10 files changed, 19 insertions, 16 deletions
diff --git a/Firebase/Auth/Source/FIRAuthAPNSTokenManager.m b/Firebase/Auth/Source/FIRAuthAPNSTokenManager.m
index 7775305..215a391 100644
--- a/Firebase/Auth/Source/FIRAuthAPNSTokenManager.m
+++ b/Firebase/Auth/Source/FIRAuthAPNSTokenManager.m
@@ -73,7 +73,9 @@ static const NSTimeInterval kLegacyRegistrationTimeout = 30;
} else {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#if TARGET_OS_IOS
[_application registerForRemoteNotificationTypes:UIRemoteNotificationTypeAlert];
+#endif // TARGET_OS_IOS
#pragma clang diagnostic pop
}
});
diff --git a/Firebase/Core/FIRNetworkURLSession.m b/Firebase/Core/FIRNetworkURLSession.m
index d9c6f3a..c3da674 100644
--- a/Firebase/Core/FIRNetworkURLSession.m
+++ b/Firebase/Core/FIRNetworkURLSession.m
@@ -428,6 +428,7 @@
- (NSURLSessionConfiguration *)backgroundSessionConfigWithSessionID:(NSString *)sessionID {
#if (TARGET_OS_OSX && defined(MAC_OS_X_VERSION_10_10) && \
MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10) || \
+ TARGET_OS_TV || \
(TARGET_OS_IOS && defined(__IPHONE_8_0) && __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_8_0)
// iOS 8/10.10 builds require the new backgroundSessionConfiguration method name.
diff --git a/Firebase/Core/FIRReachabilityChecker.m b/Firebase/Core/FIRReachabilityChecker.m
index 733dffe..cac87ff 100644
--- a/Firebase/Core/FIRReachabilityChecker.m
+++ b/Firebase/Core/FIRReachabilityChecker.m
@@ -177,7 +177,7 @@ static NSString *const kFIRReachabilityDisconnectedStatus = @"Disconnected";
// Reachable flag is set. Check further flags.
if (!(flags & kSCNetworkReachabilityFlagsConnectionRequired)) {
// Connection required flag is not set, so we have connectivity.
-#if TARGET_OS_IOS
+#if TARGET_OS_IOS || TARGET_OS_TV
status = (flags & kSCNetworkReachabilityFlagsIsWWAN) ? kFIRReachabilityViaCellular
: kFIRReachabilityViaWifi;
#elif TARGET_OS_OSX
@@ -188,7 +188,7 @@ static NSString *const kFIRReachabilityDisconnectedStatus = @"Disconnected";
!(flags & kSCNetworkReachabilityFlagsInterventionRequired)) {
// If the connection on demand or connection on traffic flag is set, and user intervention
// is not required, we have connectivity.
-#if TARGET_OS_IOS
+#if TARGET_OS_IOS || TARGET_OS_TV
status = (flags & kSCNetworkReachabilityFlagsIsWWAN) ? kFIRReachabilityViaCellular
: kFIRReachabilityViaWifi;
#elif TARGET_OS_OSX
diff --git a/Firebase/Core/third_party/FIRAppEnvironmentUtil.m b/Firebase/Core/third_party/FIRAppEnvironmentUtil.m
index 859c04e..90e66f0 100644
--- a/Firebase/Core/third_party/FIRAppEnvironmentUtil.m
+++ b/Firebase/Core/third_party/FIRAppEnvironmentUtil.m
@@ -177,7 +177,7 @@ static BOOL isAppEncrypted() {
}
+ (BOOL)hasEmbeddedMobileProvision {
- #if TARGET_OS_IOS
+ #if TARGET_OS_IOS || TARGET_OS_TV
return [[NSBundle mainBundle] pathForResource:@"embedded" ofType:@"mobileprovision"].length > 0;
#elif TARGET_OS_OSX
return NO;
@@ -185,7 +185,7 @@ static BOOL isAppEncrypted() {
}
+ (BOOL)isSimulator {
- #if TARGET_OS_IOS
+ #if TARGET_OS_IOS || TARGET_OS_TV
NSString *platform = [FIRAppEnvironmentUtil deviceModel];
return [platform isEqual:@"x86_64"] || [platform isEqual:@"i386"];
#elif TARGET_OS_OSX
@@ -207,7 +207,7 @@ static BOOL isAppEncrypted() {
}
+ (NSString *)systemVersion {
- #if TARGET_OS_IOS
+ #if TARGET_OS_IOS || TARGET_OS_TV
return [UIDevice currentDevice].systemVersion;
#elif TARGET_OS_OSX
return [NSProcessInfo processInfo].operatingSystemVersionString;
@@ -215,7 +215,7 @@ static BOOL isAppEncrypted() {
}
+ (BOOL)isAppExtension {
- #if TARGET_OS_IOS
+ #if TARGET_OS_IOS || TARGET_OS_TV
// Documented by <a href="https://goo.gl/RRB2Up">Apple</a>
BOOL appExtension = [[[NSBundle mainBundle] bundlePath] hasSuffix:@".appex"];
return appExtension;
@@ -227,7 +227,7 @@ static BOOL isAppEncrypted() {
#pragma mark - Helper methods
+ (BOOL)hasSCInfoFolder {
- #if TARGET_OS_IOS
+ #if TARGET_OS_IOS || TARGET_OS_TV
NSString *bundlePath = [NSBundle mainBundle].bundlePath;
NSString *scInfoPath = [bundlePath stringByAppendingPathComponent:@"SC_Info"];
return [[NSFileManager defaultManager] fileExistsAtPath:scInfoPath];
diff --git a/Firebase/Database/Core/FPersistentConnection.m b/Firebase/Database/Core/FPersistentConnection.m
index 6f71d8b..870727c 100644
--- a/Firebase/Database/Core/FPersistentConnection.m
+++ b/Firebase/Database/Core/FPersistentConnection.m
@@ -925,7 +925,7 @@ static void reachabilityCallback(SCNetworkReachabilityRef ref, SCNetworkReachabi
- (void) sendConnectStats {
NSMutableDictionary *stats = [NSMutableDictionary dictionary];
- #if TARGET_OS_IOS
+ #if TARGET_OS_IOS || TARGET_OS_TV
if (self.config.persistenceEnabled) {
stats[@"persistence.ios.enabled"] = @1;
}
diff --git a/Firebase/Database/Core/FRepo.m b/Firebase/Database/Core/FRepo.m
index 0935b44..1c4b956 100644
--- a/Firebase/Database/Core/FRepo.m
+++ b/Firebase/Database/Core/FRepo.m
@@ -53,7 +53,7 @@
#import "FValueEventRegistration.h"
#import "FEmptyNode.h"
-#if TARGET_OS_IOS
+#if TARGET_OS_IOS || TARGET_OS_TV
#import <UIKit/UIKit.h>
#endif
@@ -546,7 +546,7 @@
return;
// Targetted compilation is ONLY for testing. UIKit is weak-linked in actual release build.
- #if TARGET_OS_IOS
+ #if TARGET_OS_IOS || TARGET_OS_TV
// The idea is to wait until any outstanding sets get written to disk. Since the sets might still be in our
// dispatch queue, we wait for the dispatch queue to catch up and for persistence to catch up.
// This may be undesirable though. The dispatch queue might just be processing a bunch of incoming data or
diff --git a/Firebase/Database/Persistence/FLevelDBStorageEngine.m b/Firebase/Database/Persistence/FLevelDBStorageEngine.m
index 490fb6c..7de9ebf 100644
--- a/Firebase/Database/Persistence/FLevelDBStorageEngine.m
+++ b/Firebase/Database/Persistence/FLevelDBStorageEngine.m
@@ -211,7 +211,7 @@ static NSString* trackedQueryKeysKey(NSUInteger trackedQueryId, NSString *key) {
}
+ (NSString *) firebaseDir {
- #if TARGET_OS_IOS
+ #if TARGET_OS_IOS || TARGET_OS_TV
NSArray *dirPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDir = [dirPaths objectAtIndex:0];
return [documentsDir stringByAppendingPathComponent:@"firebase"];
diff --git a/Firebase/Database/Realtime/FWebSocketConnection.m b/Firebase/Database/Realtime/FWebSocketConnection.m
index 0fd07e5..49d6bd8 100644
--- a/Firebase/Database/Realtime/FWebSocketConnection.m
+++ b/Firebase/Database/Realtime/FWebSocketConnection.m
@@ -25,7 +25,7 @@
#import "FStringUtilities.h"
#import "FIRDatabase_Private.h"
-#if TARGET_OS_IOS
+#if TARGET_OS_IOS || TARGET_OS_TV
#import <UIKit/UIKit.h>
#endif
@@ -85,7 +85,7 @@
BOOL hasUiDeviceClass = NO;
// Targetted compilation is ONLY for testing. UIKit is weak-linked in actual release build.
- #if TARGET_OS_IOS
+ #if TARGET_OS_IOS || TARGET_OS_TV
Class uiDeviceClass = NSClassFromString(@"UIDevice");
if (uiDeviceClass) {
systemVersion = [uiDeviceClass currentDevice].systemVersion;
diff --git a/Firebase/Database/third_party/SocketRocket/FSRWebSocket.m b/Firebase/Database/third_party/SocketRocket/FSRWebSocket.m
index a2c857b..c80dbb0 100644
--- a/Firebase/Database/third_party/SocketRocket/FSRWebSocket.m
+++ b/Firebase/Database/third_party/SocketRocket/FSRWebSocket.m
@@ -18,7 +18,7 @@
#import "FSRWebSocket.h"
-#if TARGET_OS_IOS
+#if TARGET_OS_IOS || TARGET_OS_TV
#define HAS_ICU
#endif
@@ -28,7 +28,7 @@
#import <unicode/utf8.h>
#endif
-#if TARGET_OS_IOS
+#if TARGET_OS_IOS || TARGET_OS_TV
#import <Endian.h>
#elif TARGET_OS_OSX
#import <CoreServices/CoreServices.h>
diff --git a/Firebase/Storage/FIRStorageUtils.m b/Firebase/Storage/FIRStorageUtils.m
index 216b4b6..bc517ff 100644
--- a/Firebase/Storage/FIRStorageUtils.m
+++ b/Firebase/Storage/FIRStorageUtils.m
@@ -14,7 +14,7 @@
#import <Foundation/Foundation.h>
-#if TARGET_OS_IOS
+#if TARGET_OS_IOS || TARGET_OS_TV
#import <MobileCoreServices/MobileCoreServices.h>
#elif TARGET_OS_OSX
#import <CoreServices/CoreServices.h>