Beispiel #1
0
 public static void showShareMenu(PlatformType[] types, Hashtable content, int x, int y, MenuArrowDirection direction, ShareResultEvent resultHandler)
 {
     if (Application.platform != RuntimePlatform.IPhonePlayer)
     {
         if (Application.platform == RuntimePlatform.Android)
         {
             AndroidUtils.getInstance().onekeyShare(content, resultHandler);
         }
     }
 }
Beispiel #2
0
        /// <summary>
        /// Shows the share menu.
        /// </summary>
        /// <param name='types'>
        /// Types.
        /// </param>
        /// <param name='content'>
        /// Content.
        /// </param>
        /// <param name='x'>
        /// X.
        /// </param>
        /// <param name='y'>
        /// Y.
        /// </param>
        /// <param name='direction'>
        /// Direction.
        /// </param>
        /// <param name='callback'>
        /// Callback.
        /// </param>
        public static void showShareMenu(PlatformType[] types, Hashtable content, int x, int y, MenuArrowDirection direction, ShareResultEvent resultHandler)
        {
            _shareResultEvent = resultHandler;

            string platTypesStr = null;
            if (types != null)
            {
                List<int> platTypesArr = new List<int>();
                foreach (PlatformType type in types)
                {
                    platTypesArr.Add((int)type);
                }
                platTypesStr = MiniJSON.jsonEncode(platTypesArr.ToArray());
            }

            __iosShareSDKShowShareMenu (platTypesStr, MiniJSON.jsonEncode(content), x, y, (int)direction, _callbackObjectName);
        }
Beispiel #3
0
        /// <summary>
        /// Shows the share menu.
        /// </summary>
        /// <param name='types'>
        /// Types.
        /// </param>
        /// <param name='content'>
        /// Content.
        /// </param>
        /// <param name='x'>
        /// X. only for iPad
        /// </param>
        /// <param name='y'>
        /// Y. only for iPad
        /// </param>
        /// <param name='direction'>
        /// Direction. only for iPad
        /// </param>
        /// <param name='callback'>
        /// Callback.
        /// </param>
        public static void showShareMenu(Hashtable content, int x, int y, MenuArrowDirection direction, ShareResultEvent resultHandler)
        {
            Debug.Log("Application.platform = " + Application.platform);
            if (Application.platform == RuntimePlatform.IPhonePlayer)
            {
            #if UNITY_IPHONE
                ios.ShareSDK.showShareMenu (types, content, x, y, direction, resultHandler);
            #endif
            }
            else if (Application.platform == RuntimePlatform.Android)
            {
            #if UNITY_ANDROID
                // The android platform doesn't have this method, you can modify the PlatformGridView class of OnekeyShare in java layer to achieve this function
                Debug.Log("content = " + content);
                if (resultHandler == null)
                {
                    Debug.Log("resultHandler = null");
                }
                else
                {
                    Debug.Log("resultHandler != null");
                }
                AndroidUtils.getInstance().onekeyShare(content, resultHandler);
            #endif

            }
        }
Beispiel #4
0
        /// <summary>
        /// Shows the share menu.
        /// </summary>
        /// <param name='types'>
        /// Types.
        /// </param>
        /// <param name='content'>
        /// Content.
        /// </param>
        /// <param name='x'>
        /// X.
        /// </param>
        /// <param name='y'>
        /// Y.
        /// </param>
        /// <param name='direction'>
        /// Direction.
        /// </param>
        /// <param name='callback'>
        /// Callback.
        /// </param>
        public static void showShareMenu(PlatformType[] types, Hashtable content, int x, int y, MenuArrowDirection direction, ShareResultEvent resultHandler)
        {
            _shareResultEvent = resultHandler;

            string platTypesStr = null;

            if (types != null)
            {
                List <int> platTypesArr = new List <int>();
                foreach (PlatformType type in types)
                {
                    platTypesArr.Add((int)type);
                }
                platTypesStr = MiniJSON.jsonEncode(platTypesArr.ToArray());
            }

            __iosShareSDKShowShareMenu(platTypesStr, MiniJSON.jsonEncode(content), x, y, (int)direction, _callbackObjectName);
        }
Beispiel #5
0
 public static void showShareMenu(PlatformType[] types, Hashtable content, int x, int y, MenuArrowDirection direction, ShareResultEvent resultHandler)
 {
     ShareSDK._shareResultEvent = resultHandler;
     List<PlatformType> json = new List<PlatformType>(types);
     string platTypes = MiniJSON.jsonEncode(json);
     string content2 = MiniJSON.jsonEncode(content);
     ShareSDK.__iosShareSDKShowShareMenu(platTypes, content2, x, y, (int)direction, ShareSDK._callbackObjectName);
 }