1 #region Copyright Notice & License Information
29 using System.Collections;
36 [AddComponentMenu (
"Hydrogen/Singletons/TestFlight")]
60 static readonly System.Object _syncRoot =
new System.Object ();
74 if (_staticInstance == null) {
79 if (_staticInstance == null) {
81 var go = GameObject.Find (Hydrogen.Components.DefaultSingletonName) ??
82 new GameObject (Hydrogen.Components.DefaultSingletonName);
84 go.AddComponent<hTestFlight> ();
85 _staticInstance = go.GetComponent<hTestFlight> ();
89 return _staticInstance;
98 return _staticInstance != null;
111 if (!Hydrogen.Plugins.TestFlight.Flying || !Hydrogen.Plugins.TestFlight.Session) {
113 #if (UNITY_IPHONE || UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR
114 Debug.Log (
"Unable to send information, TestFlight is not in flight.");
122 Hydrogen.Plugins.TestFlight.AddCustomEnvironmentInformation (data, key);
129 public void Log (
string message)
133 if (!Hydrogen.Plugins.TestFlight.Flying || !Hydrogen.Plugins.TestFlight.Session) {
134 #if (UNITY_IPHONE || UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR
135 Debug.Log (
"Unable to send log data, TestFlight is not in flight.");
140 Hydrogen.Plugins.TestFlight.Log (message);
151 if (!Hydrogen.Plugins.TestFlight.Flying || !Hydrogen.Plugins.TestFlight.Session) {
152 #if (UNITY_IPHONE || UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR
153 Debug.Log (
"Unable to send log data, TestFlight is not in flight.");
158 Hydrogen.Plugins.TestFlight.LogAsync (message);
169 if (!Hydrogen.Plugins.TestFlight.Flying || !Hydrogen.Plugins.TestFlight.Session) {
170 #if (UNITY_IPHONE || UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR
171 Debug.Log (
"Unable to send checkpoint data, TestFlight is not in flight.");
176 Hydrogen.Plugins.TestFlight.PassCheckpoint (checkpoint);
187 if (!Hydrogen.Plugins.TestFlight.Flying || !Hydrogen.Plugins.TestFlight.Session) {
188 #if (UNITY_IPHONE || UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR
189 Debug.Log (
"Unable to submit feedback, TestFlight is not in flight.");
194 Hydrogen.Plugins.TestFlight.SubmitFeedback (message);
204 static void OnApplicationPause ()
206 if (!Hydrogen.Plugins.TestFlight.Session)
207 Hydrogen.Plugins.TestFlight.StartSession ();
209 Hydrogen.Plugins.TestFlight.EndSession ();
215 static void OnApplicationQuit ()
217 Hydrogen.Plugins.TestFlight.EndSession ();
227 DontDestroyOnLoad (gameObject);
230 StartCoroutine (Initialize ());
236 IEnumerator Initialize ()
238 if (!Hydrogen.Plugins.TestFlight.Flying) {
241 Hydrogen.Plugins.TestFlight.Initialize ();
244 #if (UNITY_IPHONE || UNITY_IOS) && !UNITY_EDITOR
245 Hydrogen.Plugins.TestFlight.TakeOff(
TokenIOS);
246 #elif UNITY_ANDROID && !UNITY_EDITOR
252 yield
return new WaitForEndOfFrame ();
254 if (!Hydrogen.Plugins.TestFlight.Session) {
256 Hydrogen.Plugins.TestFlight.StartSession ();
void LogAsync(string message)
Send a message to TestFlight asynchronously to appear in it's console.
void SubmitFeedback(string message)
Submits a feedback message for the App to TestFlight.
string TokenAndroid
The TestFlight token for Android.
static bool Exists()
Does a TestFlight manager instance exist?
bool Persistent
Should this TestFlight manager survive scene switches.
void AddCustomEnvironmentInformation(string key, string data)
Adds an entry into the Key-Value store for this TestFlight session.
void Log(string message)
Send a message to TestFlight to appear in it's console.
string TokenIOS
The TestFlight token iOS.
A drop in implementation of the Hydrogen.Plugins.TestFlight manager. It implements advanced features ...
static hTestFlight Instance
Gets the TestFlight interface instance.
void PassCheckpoint(string checkpoint)
Report to TestFlight that the session has passed a Checkpoint.