Skip to content

Instantly share code, notes, and snippets.

@tolmasky
Created March 24, 2014 04:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tolmasky/9734274 to your computer and use it in GitHub Desktop.
Save tolmasky/9734274 to your computer and use it in GitHub Desktop.
using System.Runtime.InteropServices;
namespace PlaygroundTheory
{
public static class App
{
#if UNITY_IPHONE && !UNITY_EDITOR
[DllImport ("__Internal")]
private static extern string PTAppGetMainBundleIdentifier();
public static Func<string> GetIdentifier = _.Once(() => PTAppGetMainBundleIdentifier());
[DllImport ("__Internal")]
private static extern string PTAppGetMainBundleVersion();
public static Func<string> GetVersion = _.Once(() => PTAppGetMainBundleVersion());
[DllImport ("__Internal")]
private static extern string PTAppGetMainBundleShortVersionString();
public static Func<string> GetShortVersionString = _.Once(() => PTAppGetMainBundleShortVersionString());
#elif UNITY_ANDROID && !UNITY_EDITOR
public static Func<string> GetIdentifier = _.Once(() => "com.playgroundtheory.bonsaislice");
public static Func<string> GetVersion = _.Once(() => "1.0");
public static Func<string> GetShortVersionString = _.Once(() => "1.0");
#else
public static Func<string> GetIdentifier = _.Once(() => "com.playgroundtheory.bonsaislice");
public static Func<string> GetVersion = _.Once(() => "1.0");
public static Func<string> GetShortVersionString = _.Once(() => "1.0");
#endif
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment