Skip to content

Initial tvOS support for the SDK. #144

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

Merged
merged 1 commit into from
Jan 7, 2016
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions Parse/Internal/PlatformHooks/Unity/PlatformHooks.Unity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,18 @@ internal static bool IsIOS {
}
}

/// <summary>
/// Returns true if the current platform is tvOS.
/// </summary>
internal static bool IsTvOS {
get {
if (settingsPath == null) {
throw new InvalidOperationException("Parse must be initialized before making any calls.");
}
return Application.platform == RuntimePlatform.tvOS;
}
}

/// <summary>
/// Returns true if current running platform is Windows Phone 8.
/// </summary>
Expand Down Expand Up @@ -230,6 +242,9 @@ private string Load() {
try {
if (IsWebPlayer) {
return PlayerPrefs.GetString("Parse.settings", null);
} else if (IsTvOS) {
Debug.Log("Running on TvOS, prefs cannot be loaded.");
return null;
} else {
using (var fs = new FileStream(settingsPath, FileMode.Open, FileAccess.Read)) {
var reader = new StreamReader(fs);
Expand All @@ -250,6 +265,8 @@ private void Save() {
if (IsWebPlayer) {
PlayerPrefs.SetString("Parse.settings", ParseClient.SerializeJsonString(data));
PlayerPrefs.Save();
} else if (IsTvOS) {
Debug.Log("Running on TvOS, prefs cannot be saved.");
} else {
using (var fs = new FileStream(settingsPath, FileMode.Create, FileAccess.Write)) {
using (var writer = new StreamWriter(fs)) {
Expand Down
Binary file modified Parse/UnityEngine.dll
Binary file not shown.