Beispiel #1
0
        public bool EqualsCurrentPlatformID(string _identifier)
        {
            PlatformValue _object = PlatformValueHelper.GetCurrentPlatformValue(_array: m_platformIDs);

            if (_object == null)
            {
                return(false);
            }

            return(string.Equals(_object.Value, _identifier));
        }
Beispiel #2
0
        public static string GetCurrentPlatformID(this IIdentifierContainer _object)
        {
            PlatformValue _platform = PlatformValueHelper.GetCurrentPlatformValue(_array: _object.PlatformIDs);

            if (_platform == null)
            {
                return(null);
            }

            return(_platform.Value);
        }
Beispiel #3
0
        /// <summary>
        /// Opens the Store page of the specified application.
        /// </summary>
        /// <description>
        ///	For iOS platform, id is the value that identifies your app on App Store.
        /// And on Android, it will be same as app's bundle identifier (com.example.test).
        /// </description>
        /// <param name="_applicationIDList">An array of string values, that holds app id's of each supported platform.</param>
        /// <example>
        /// The following code example shows how to open store link.
        /// <code>
        /// using UnityEngine;
        /// using System.Collections;
        /// using VoxelBusters.NativePlugins;
        ///
        /// public class ExampleClass : MonoBehaviour
        /// {
        ///     public void OpenStorePage ()
        ///     {
        ///         NPBinding.Utility.OpenStoreLink(PlatformValue.Android("com.example.app"),
        ///                                         PlatformValue.IOS("ios-app-id"));
        ///     }
        /// }
        /// </code>
        /// </example>
        public void OpenStoreLink(params PlatformValue[] _storeIdentifiers)
        {
            PlatformValue _storeIdentifier = PlatformValueHelper.GetCurrentPlatformValue(_array: _storeIdentifiers);

            if (_storeIdentifier == null)
            {
                DebugUtility.Logger.Log(Constants.kDebugTag, "[Utility] The operation could not be completed because application identifier is invalid.");
                return;
            }

            OpenStoreLink(_applicationID: _storeIdentifier.Value);
        }
Beispiel #4
0
        /// <summary>
        /// Opens the Store page of the specified application.
        /// </summary>
        /// <description>
        ///	For iOS platform, id is the value that identifies your app on App Store.
        /// And on Android, it will be same as app's bundle identifier (com.example.test).
        /// </description>
        /// <param name="_applicationIDList">An array of string values, that holds app id's of each supported platform.</param>
        /// <example>
        /// The following code example shows how to open store link.
        /// <code>
        /// using UnityEngine;
        /// using System.Collections;
        /// using VoxelBusters.NativePlugins;
        ///
        /// public class ExampleClass : MonoBehaviour
        /// {
        ///     public void OpenStorePage ()
        ///     {
        ///         NPBinding.Utility.OpenStoreLink(PlatformValue.Android("com.example.app"),
        ///                                         PlatformValue.IOS("ios-app-id"));
        ///     }
        /// }
        /// </code>
        /// </example>
        public void OpenStoreLink(params PlatformValue[] _storeIdentifiers)
        {
            PlatformValue _storeIdentifier = PlatformValueHelper.GetCurrentPlatformValue(_array: _storeIdentifiers);

            if (_storeIdentifier == null)
            {
#if NP_DEBUG
                Debug.Log("[Utility] The operation could not be completed because application identifier is invalid.");
#endif
                return;
            }

            OpenStoreLink(_applicationID: _storeIdentifier.Value);
        }