Example #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));
        }
Example #2
0
        public static string GetCurrentPlatformID(this IIdentifierContainer _object)
        {
            PlatformValue _platform = PlatformValueHelper.GetCurrentPlatformValue(_array: _object.PlatformIDs);

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

            return(_platform.Value);
        }
Example #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);
        }
Example #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);
        }
Example #5
0
        internal void RebuildObject()
        {
            if (!string.IsNullOrEmpty(m_iosProductId) || !string.IsNullOrEmpty(m_androidProductId))
            {
                // Copy product identifier information
                m_productIdentifiers = new PlatformValue[]
                {
                    PlatformValue.IOS(m_iosProductId),
                    PlatformValue.Android(m_androidProductId)
                };

                // Reset deprecated attribute value
                m_iosProductId     = null;
                m_androidProductId = null;
            }
        }