Exemple #1
0
    private void AndroidUtilGUI()
    {
        showAndroidUtils = EditorGUILayout.Foldout(showAndroidUtils, "Android Build Facebook Settings");
        if (showAndroidUtils)
        {
            if (!FacebookAndroidUtil.IsSetupProperly())
            {
                var msg = "Your Android setup is not right. Check the documentation.";
                switch (FacebookAndroidUtil.SetupError)
                {
                case FacebookAndroidUtil.ERROR_NO_SDK:
                    msg = "You don't have the Android SDK setup!  Go to " + (Application.platform == RuntimePlatform.OSXEditor ? "Unity" : "Edit") + "->Preferences... and set your Android SDK Location under External Tools";
                    break;

                case FacebookAndroidUtil.ERROR_NO_KEYSTORE:
                    // msg = "Your android debug keystore file is missing! You can create new one by creating and building empty Android project in Ecplise.";
                    msg = "Your keystore file is missing! You can create one by going into Unity's Build Settings->Android->Publish Settings.";
                    break;

                case FacebookAndroidUtil.ERROR_NO_KEYTOOL:
                    msg = "Keytool not found. Make sure that Java is installed, and that Java tools are in your path.";
                    break;

                case FacebookAndroidUtil.ERROR_NO_OPENSSL:
                    msg = "OpenSSL not found. Make sure that OpenSSL is installed, and that it is in your path.";
                    break;

                case FacebookAndroidUtil.ERROR_KEYTOOL_ERROR:
                    msg = "Unkown error while getting Debug Android Key Hash.";
                    break;
                }
                EditorGUILayout.HelpBox(msg, MessageType.Warning);
            }
            EditorGUILayout.HelpBox("Copy and Paste these into your \"Native Android App\" Settings on developers.facebook.com/apps", MessageType.None);
            SelectableLabelField(packageNameLabel, PlayerSettings.bundleIdentifier);
            SelectableLabelField(classNameLabel, ManifestMod.DeepLinkingActivityName);
            SelectableLabelField(debugAndroidKeyLabel, FacebookAndroidUtil.DebugKeyHash);

            if (GUILayout.Button("Refresh Keyhash"))
            {
                FacebookAndroidUtil.refresh();
            }

            if (GUILayout.Button("Regenerate Android Manifest"))
            {
                ManifestMod.GenerateManifest();
            }
        }
        EditorGUILayout.Space();
    }
Exemple #2
0
 private void AndroidUtilGUI()
 {
     showAndroidUtils = EditorGUILayout.Foldout(showAndroidUtils, "Android Build Facebook Settings");
     if (showAndroidUtils)
     {
         if (!FacebookAndroidUtil.HasAndroidSDK())
         {
             EditorGUILayout.HelpBox("You don't have the Android SDK setup!  Go to Edit->Preferences... and set your Android SDK Location under External Tools", MessageType.Warning);
         }
         EditorGUILayout.HelpBox("Copy and Paste these into your \"Native Android App\" Settings on developers.facebook.com/apps", MessageType.None);
         SelectableLabelField(packageNameLabel, PlayerSettings.bundleIdentifier);
         SelectableLabelField(classNameLabel, ManifestMod.ActivityName);
         SelectableLabelField(debugAndroidKeyLabel, FacebookAndroidUtil.DebugKeyHash);
     }
     EditorGUILayout.Space();
 }