Exemplo n.º 1
0
        void DrawAndroidSettings()
        {
            var androidSettingsText = " Android Settings";

            if (!ShowAndroidSettings && !GetSocialSettings.IsAndroidEnabled)
            {
                androidSettingsText += PlatformDisabledLabel;
            }

            var androidSettingsLabel = EditorGuiUtils.GetBoldLabel(androidSettingsText, "", GetSocialEditorUtils.AndroidIcon);

            GetSocialEditorUtils.BeginSetSmallIconSize();
            ShowAndroidSettings = EditorGUILayout.Foldout(ShowAndroidSettings, androidSettingsLabel);
            GetSocialEditorUtils.EndSetSmallIconSize();

            if (ShowAndroidSettings)
            {
                EditorGUILayout.BeginVertical(GUI.skin.box);
                {
                    DrawDashboardSettingToogle("Platform status",
                                               GetSocialSettings.IsAndroidEnabled ? "✔️ Enabled [?]" : "✘ Disabled [?]");

                    DrawDashboardSettingToogle("Push notifications status",
                                               GetSocialSettings.IsAndroidPushEnabled ? "✔️ Enabled [?]" : "✘ Disabled [?]");

                    if (Application.platform == RuntimePlatform.WindowsEditor ||
                        Application.platform == RuntimePlatform.OSXEditor)
                    {
                        DrawAndroidSigningSignatureHash();
                    }
                }
                EditorGUILayout.EndVertical();
            }
        }
        void DrawIosSettings()
        {
            var iosSettingsText = " iOS Settings";

            if (!ShowIosSettings && !GetSocialSettings.IsIosEnabled)
            {
                iosSettingsText += PlatformDisabledLabel;
            }
            var iosSettingsLabel = EditorGuiUtils.GetBoldLabel(iosSettingsText, "", GetSocialEditorUtils.IOSIcon);

            GetSocialEditorUtils.BeginSetSmallIconSize();
            ShowIosSettings = EditorGUILayout.Foldout(ShowIosSettings, iosSettingsLabel);
            GetSocialEditorUtils.EndSetSmallIconSize();

            if (ShowIosSettings)
            {
                EditorGUILayout.BeginVertical(GUI.skin.box);
                {
                    DrawiOSFrameworkStatusSettings();
                    DrawDashboardSettingToogle("Platform status",
                                               GetSocialSettings.IsIosEnabled ? "✔️ Enabled [?]" : "✘ Disabled [?]");

                    DrawDashboardSettingToogle("Push notifications status",
                                               GetSocialSettings.IsIosPushEnabled ? "✔️ Enabled [?]" : "✘ Disabled [?]");

                    if (GetSocialSettings.IsIosPushEnabled)
                    {
                        DrawDashboardSettingToogle("Push notifications environment",
                                                   "    " + GetSocialSettings.IosPushEnvironment.Capitalize());
                    }
                }
                EditorGUILayout.EndVertical();
            }
        }
Exemplo n.º 3
0
        static void DrawAdditionalInfo()
        {
            GetSocialEditorUtils.BeginSetSmallIconSize();
            EditorGUILayout.LabelField(new GUIContent(" SDK Info", GetSocialEditorUtils.InfoIcon),
                                       EditorStyles.boldLabel);
            GetSocialEditorUtils.EndSetSmallIconSize();

            using (new EditorGUILayout.HorizontalScope(GUI.skin.box))
            {
                EditorGuiUtils.SelectableLabelField(
                    new GUIContent("SDK Version [?]", "GetSocial SDK Version"),
                    BuildConfig.UnitySdkVersion);
            }
        }
Exemplo n.º 4
0
        private void DrawiOSFrameworkStatusSettings()
        {
            bool frameworkStatus = _iosFrameworkStatus;

            using (new EditorGUILayout.HorizontalScope())
            {
                EditorGUILayout.LabelField("Framework status", EditorGuiUtils.OneThirdWidth);

                EditorGuiUtils.ColoredBackground(frameworkStatus || FileHelper.IOSDownloadInProgress ? GUI.backgroundColor : Color.green,
                                                 () =>
                {
                    string buttonText;
                    if (FileHelper.IOSDownloadInProgress)
                    {
                        buttonText = "... Downloading, please wait ...";
                    }
                    else
                    {
                        buttonText = frameworkStatus ? "✔ Downloaded" : "✘ Not downloaded";
                    }

                    var style = frameworkStatus ? EditorStyles.label : EditorStyles.miniButton;

                    if (GUILayout.Button(buttonText, style, EditorGuiUtils.OneThirdWidth))
                    {
                        if (!frameworkStatus && !FileHelper.IOSDownloadInProgress)
                        {
                            FileHelper.DownloadiOSFramework(() =>
                            {
                                buttonText = "✔ Downloaded";
                            }, error =>
                            {
                                buttonText = "✘ Not downloaded";
                            });
                        }
                    }

                    if (FileHelper.IOSDownloadInProgress)
                    {
                        var progress = (int)(FileHelper.IOSDownloadProgress * 100);
                        EditorGUILayout.LabelField(string.Format("{0}%", progress), EditorGuiUtils.OneThirdWidth);
                    }
                });
            }
        }
Exemplo n.º 5
0
        static void DrawAndroidSigningSignatureHash()
        {
            string     label   = "Signing-certificate fingerprint [?]";
            GUIContent content = new GUIContent(label,
                                                "SHA-256 hash of the keystore you use to sign your application.");

            var hasError = GetSocialEditorUtils.KeyStoreUtilError != null;

            if (hasError)
            {
                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.LabelField(label, GUILayout.Height(16), EditorGuiUtils.OneThirdWidth);
                if (GUILayout.Button("More info", EditorStyles.miniButton, EditorGuiUtils.OneThirdWidth))
                {
                    Application.OpenURL(string.Format("https://docs.getsocial.im/knowledge-base/android-signing-key-sha256/?utm_source={0}&utm_medium=unity-editor", BuildConfig.PublishTarget));
                }
                if (GUILayout.Button("Refresh", EditorStyles.miniButton, EditorGuiUtils.OneThirdWidth))
                {
                    AssetDatabase.ImportAsset(GetSocialSettings.GetPluginPath() + Path.DirectorySeparatorChar +
                                              "Editor" + Path.DirectorySeparatorChar +
                                              "GetSocialSettingsEditor.cs");
                }
                EditorGUILayout.EndHorizontal();
            }
            else
            {
                EditorGuiUtils.SelectableLabelField(content, GetSocialEditorUtils.SigningKeyHash);
            }

            using (new EditorGUILayout.HorizontalScope())
            {
                if (!GetSocialEditorUtils.UserDefinedKeystore())
                {
                    EditorGUILayout.HelpBox("You are using default Android keystore to sign your application. Are you sure this is what you want?",
                                            MessageType.Warning);
                }
                else if (GetSocialEditorUtils.KeyStoreUtilError != null)
                {
                    EditorGUILayout.HelpBox(GetSocialEditorUtils.KeyStoreUtilError,
                                            MessageType.Warning);
                }
            }
        }
 static void DrawAndroidSigningSignatureHash()
 {
     using (new EditorGUILayout.HorizontalScope())
     {
         string     label   = "Signing-certificate fingerprint [?]";
         GUIContent content = new GUIContent(label,
                                             "SHA-256 hash of the keystore you use to sign your application.");
         EditorGuiUtils.SelectableLabelField(content, GetSocialEditorUtils.SigningKeyHash);
     }
     if (GetSocialEditorUtils.KeyStoreUtilError != null)
     {
         EditorGUILayout.HelpBox(GetSocialEditorUtils.KeyStoreUtilError,
                                 MessageType.Error);
     }
     if (!GetSocialEditorUtils.UserDefinedKeystore())
     {
         EditorGUILayout.HelpBox("You are using default Android keystore to sign your application. Are you sure this is what you want?",
                                 MessageType.Warning);
     }
 }
Exemplo n.º 7
0
        void DrawIosSettings()
        {
            var iosSettingsText = " iOS Settings";

            if (!ShowIosSettings && !GetSocialSettings.IsIosEnabled)
            {
                iosSettingsText += PlatformDisabledLabel;
            }
            var iosSettingsLabel = EditorGuiUtils.GetBoldLabel(iosSettingsText, "", GetSocialEditorUtils.IOSIcon);

            GetSocialEditorUtils.BeginSetSmallIconSize();
            ShowIosSettings = EditorGUILayout.Foldout(ShowIosSettings, iosSettingsLabel);
            GetSocialEditorUtils.EndSetSmallIconSize();

            if (ShowIosSettings)
            {
                EditorGUILayout.BeginVertical(GUI.skin.box);
                {
                    DrawDashboardSettingToogle("Platform status",
                                               GetSocialSettings.IsIosEnabled ? "✔️ Enabled [?]" : "✘ Disabled [?]");

                    DrawDashboardSettingToogle("Push notifications status",
                                               GetSocialSettings.IsIosPushEnabled ? "✔️ Enabled [?]" : "✘ Disabled [?]");

                    if (GetSocialSettings.IsIosPushEnabled)
                    {
#if UNITY_2018_1_OR_NEWER
                        var richNotificationsEnabled = new GUIContent("Enable Rich Notifications [?]", "If it is enabled, notifications with images/videos can be displayed.");
                        var enableRichNotifications  = EditorGUILayout.ToggleLeft(richNotificationsEnabled, GetSocialSettings.IsRichPushNotificationsEnabled);
                        SetRichNotificationsEnabled(enableRichNotifications);

                        // extension bundle id, only if UNITY_2018_1_OR_NEWER
                        EditorGUILayout.BeginHorizontal();
                        var extensionBundleIdLabel = new GUIContent("Notification Extension Bundle Id [?]", "Bundle id of the extension.");
                        EditorGUILayout.LabelField(extensionBundleIdLabel, EditorGuiUtils.OneThirdWidth);
                        var extensionBundleId = EditorGUILayout.TextField(GetSocialSettings.ExtensionBundleId, EditorGuiUtils.OneThirdWidth);
                        if (extensionBundleId.Length == 0)
                        {
                            extensionBundleId = PlayerSettings.applicationIdentifier + ".getsocialextension";
                        }
                        SetExtensionBundleId(extensionBundleId);
                        if (GUILayout.Button("More info", EditorStyles.miniButton, EditorGuiUtils.OneThirdWidth))
                        {
                            Application.OpenURL(string.Format("https://docs.getsocial.im/guides/notifications/setup-push-notifications/unity/#receiving-rich-push-notifications-and-badges-ios-only", BuildConfig.PublishTarget));
                        }
                        EditorGUILayout.EndHorizontal();

                        // extension provisioning profile
                        EditorGUILayout.BeginHorizontal();
                        var extensionProvisioningProfileLabel = new GUIContent("Notification Extension Provisioning Profile [?]", "Name of the provision profile used for signing the extension, or leave it empty if you use automatic signing");
                        EditorGUILayout.LabelField(extensionProvisioningProfileLabel, EditorGuiUtils.OneThirdWidth);
                        var extensionProvisioningProfile = EditorGUILayout.TextField(GetSocialSettings.ExtensionProvisioningProfile, EditorGuiUtils.OneThirdWidth);
                        SetExtensionProvisioningProfile(extensionProvisioningProfile);
                        if (GUILayout.Button("More info", EditorStyles.miniButton, EditorGuiUtils.OneThirdWidth))
                        {
                            Application.OpenURL(string.Format("https://docs.getsocial.im/guides/notifications/setup-push-notifications/unity/#receiving-rich-push-notifications-and-badges-ios-only", BuildConfig.PublishTarget));
                        }
                        EditorGUILayout.EndHorizontal();
#endif
                    }
                }
                EditorGUILayout.EndVertical();
            }
        }