Skip to content

Commit 6e2f37a

Browse files
Initial tvOS support for the SDK.
Very basic support, lots of features still missing. Primarily missing is persistence, so don't expect things like CurrentUser or CurrentInstallation to persist across app launches. ----- - Tested to work: - ParseObject fetch/save - ParseUser login/logout (not persisted) - Untested, likely to work: - Queries - Analytics - ACL/Roles - Config - Cloud - Relations - Sessions - Won't work - Installations - Push
1 parent a60db2e commit 6e2f37a

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

Parse/Internal/PlatformHooks/Unity/PlatformHooks.Unity.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,18 @@ internal static bool IsIOS {
147147
}
148148
}
149149

150+
/// <summary>
151+
/// Returns true if the current platform is tvOS.
152+
/// </summary>
153+
internal static bool IsTvOS {
154+
get {
155+
if (settingsPath == null) {
156+
throw new InvalidOperationException("Parse must be initialized before making any calls.");
157+
}
158+
return Application.platform == RuntimePlatform.tvOS;
159+
}
160+
}
161+
150162
/// <summary>
151163
/// Returns true if current running platform is Windows Phone 8.
152164
/// </summary>
@@ -230,6 +242,9 @@ private string Load() {
230242
try {
231243
if (IsWebPlayer) {
232244
return PlayerPrefs.GetString("Parse.settings", null);
245+
} else if (IsTvOS) {
246+
Debug.Log("Running on TvOS, prefs cannot be loaded.");
247+
return null;
233248
} else {
234249
using (var fs = new FileStream(settingsPath, FileMode.Open, FileAccess.Read)) {
235250
var reader = new StreamReader(fs);
@@ -250,6 +265,8 @@ private void Save() {
250265
if (IsWebPlayer) {
251266
PlayerPrefs.SetString("Parse.settings", ParseClient.SerializeJsonString(data));
252267
PlayerPrefs.Save();
268+
} else if (IsTvOS) {
269+
Debug.Log("Running on TvOS, prefs cannot be saved.");
253270
} else {
254271
using (var fs = new FileStream(settingsPath, FileMode.Create, FileAccess.Write)) {
255272
using (var writer = new StreamWriter(fs)) {

Parse/UnityEngine.dll

294 KB
Binary file not shown.

0 commit comments

Comments
 (0)