Exemplo n.º 1
0
 /// <summary>
 /// Displays the Help Center view
 /// </summary>
 public static void ShowHelpCenter(HelpCenterOptions options)
 {
                 #if UNITY_IPHONE
     _ShowHelpCenterIos(options);
                 #elif UNITY_ANDROID
     _ShowHelpCenterAndroid(options);
                 #endif
 }
Exemplo n.º 2
0
 private static void _ShowHelpCenterAndroid(HelpCenterOptions options)
 {
     instance().DoAndroid("showHelpCenter",
                          options.CollapseSections,
                          options.ShowContactUsButton,
                          options.IncludeLabelNames,
                          options.IncludeSectionIds,
                          options.IncludeCategoryIds,
                          options.ContactConfiguration != null ? options.ContactConfiguration.Tags : null,
                          options.ContactConfiguration != null ? options.ContactConfiguration.AdditionalInfo : null,
                          options.ContactConfiguration != null ? options.ContactConfiguration.RequestSubject : null);
 }
Exemplo n.º 3
0
        // corresponds to _zendeskHelpCenterShowHelpCenter
        private static void _ShowHelpCenterIos(HelpCenterOptions options)
        {
            bool includeCategories = options.IncludeCategoryIds != null && options.IncludeCategoryIds.Length > 0;
            bool includeSections   = options.IncludeSectionIds != null && options.IncludeSectionIds.Length > 0;

            string[] ids = null;

            if (includeCategories)
            {
                ids = new string[options.IncludeCategoryIds.Length];

                for (int i = 0; i < options.IncludeCategoryIds.Length; i++)
                {
                    ids[i] = options.IncludeCategoryIds[i].ToString();
                }
            }
            else if (includeSections)
            {
                ids = new string[options.IncludeSectionIds.Length];

                for (int i = 0; i < options.IncludeSectionIds.Length; i++)
                {
                    ids[i] = options.IncludeSectionIds[i].ToString();
                }
            }

            bool includeAll = ids == null || ids.Length == 0;

            if (options.ContactConfiguration != null)
            {
                instance().DoIOS("configureZDKRequests", options.ContactConfiguration.RequestSubject,
                                 options.ContactConfiguration.Tags, options.ContactConfiguration.Tags != null ? options.ContactConfiguration.Tags.Length : 0,
                                 options.ContactConfiguration.AdditionalInfo);
            }
            // Will this conflict with the signature of Android?
            int contactUsInt = (int)options.ContactUsButtonVisibility;

            instance().DoIOS("showHelpCenterWithOptions",
                             options.IncludeLabelNames,
                             options.IncludeLabelNames != null ? options.IncludeLabelNames.Length : 0,
                             includeAll,
                             includeCategories,
                             includeSections,
                             ids,
                             ids != null ? ids.Length : 0,
                             contactUsInt,
                             options.ArticleVoting);
        }