コード例 #1
0
        /// <summary>
        /// To show the ZDKRMA dialog in a view, call this methed
        /// </summary>
        /// <param name="config">A ZDKRMAConfigObject to configure the Rate My App interface.</param>
        public static void Show(ZDKRMAConfigObject config)
        {
                        #if UNITY_ANDROID
            //An array of booleans that represent which button to include in the dialog
            bool[] dialogBools = new bool[3];
            if (config.DialogActions != null)
            {
                for (int i = 0; i < config.DialogActions.Length; i++)
                {
                    if (config.DialogActions [i] == ZDKRMAAction.ZDKRMARateApp)
                    {
                        dialogBools [0] = true;
                    }
                    else if (config.DialogActions [i] == ZDKRMAAction.ZDKRMASendFeedback)
                    {
                        dialogBools [1] = true;
                    }
                    else if (config.DialogActions [i] == ZDKRMAAction.ZDKRMADontAskAgain)
                    {
                        dialogBools [2] = true;
                    }
                }
            }
            //If the config.DialogActions was null then the default is to add all the buttons
            else
            {
                for (int i = 0; i < dialogBools.Length; i++)
                {
                    dialogBools[i] = true;
                }
            }

            if (config.AdditionalTags == null)
            {
                config.AdditionalTags = new string[0];
            }
            instance().Do("showInViewWithConfig", config.Always,
                          config.AdditionalTags,
                          config.AdditionalRequestInfo,
                          dialogBools,
                          config.RequestSubject);
                        #else
            if (config.AdditionalTags == null)
            {
                config.AdditionalTags = new string[0];
            }
            if (config.DialogActions == null)
            {
                config.DialogActions = new ZDKRMAAction[0];
            }
            instance().Do("showInViewWithConfig", config.AdditionalTags,
                          config.AdditionalTags.Length,
                          config.AdditionalRequestInfo,
                          config.DialogActions,
                          config.DialogActions.Length,
                          config.SuccessImageName,
                          config.ErrorImageName,
                          config.Always);
                        #endif
        }
コード例 #2
0
ファイル: ZDKRMA.cs プロジェクト: Jannizzle/ZENDESK
		public static void Show(ZDKRMAConfigObject config) {
			_zendeskRMAShowInViewWithConfiguration(config.AdditionalTags,
			                              		   config.AdditionalTags.Length,
			                               	 	   config.AdditionalRequestInfo,
			                             		   config.DialogActions,
			                                 	   config.DialogActions.Length,
			                                 	   config.SuccessImageName,
			                                 	   config.ErrorImageName);
		}
コード例 #3
0
ファイル: ZendeskTester.cs プロジェクト: Jannizzle/ZENDESK
	void OnGUI() {
		GUI.matrix = Matrix4x4.Scale (new Vector3 (5, 5, 5));

		GUI.DrawTexture(new Rect(0.0f,0.0f,60.0f,60.0f), avatarTexture, ScaleMode.ScaleToFit, true);

		if (GUILayout.Button ("Initialize SDK")) {
			ZendeskSDK.ZDKConfig.Instance.InitializeWithAppId ("e5dd7520b178e21212f5cc2751a28f4b5a7dc76698dc79bd",
			                                                  "https://rememberthedate.zendesk.com",
			                                                  "client_for_rtd_jwt_endpoint");
			//ZendeskSDK.ZDKConfig.Instance.AuthenticateAnonymousIdentity("","","");
			ZendeskSDK.ZDKConfig.Instance.AuthenticateJwtUserIdentity ("MyTestID");
		}

		if (GUILayout.Button ("Show Help Center")) {
			ZendeskSDK.ZDKHelpCenter.ShowHelpCenter ();
			//ZendeskSDK.ZDKHelpCenter.ShowHelpCenterFilterByArticleLabels(new string[]{"test", "test2"});
		}

		if (GUILayout.Button ("Show Request Creation")) {
			ZendeskSDK.ZDKRequests.ShowRequestCreation ();
		}

		if (GUILayout.Button ("Show Request Creation Config")) {
			string[] tags = new string[2];
			tags[0] = "Additional Config Tag 0";
			tags[1] = "Additional Config Tag 1";
			ZDKRequestCreationConfig config = new ZDKRequestCreationConfig();
			config.Tags = tags;
			config.AdditionalRequestInfo= "AdditionalRequestInfo TEST";
			ZendeskSDK.ZDKRequests.ShowRequestCreation (config);
		}

		if (GUILayout.Button ("Show Requests List")) {
			ZendeskSDK.ZDKRequests.ShowRequestList ();
		}

		if (GUILayout.Button ("Show Rate My App")) {
			ZendeskSDK.ZDKRMA.ShowAlways ();
		}

		if (GUILayout.Button ("Show Rate My App Config")) {
			string[] additionalTags = new string[2];
			additionalTags[0] = "Additional Config Tag 0";
			additionalTags[1] = "Additional Config Tag 1";
			ZDKRMAAction[] dialogActions = new ZDKRMAAction[3];
			dialogActions[0] = ZDKRMAAction.ZDKRMARateApp;
			dialogActions[1] = ZDKRMAAction.ZDKRMASendFeedback;
			dialogActions[2] = ZDKRMAAction.ZDKRMADontAskAgain;

			ZDKRMAConfigObject config = new ZDKRMAConfigObject();
			config.AdditionalTags = additionalTags;
			config.AdditionalRequestInfo = "AdditionalRequestInfo TEST";
			config.DialogActions = dialogActions;
			config.SuccessImageName = null;
			config.ErrorImageName = null;
			ZendeskSDK.ZDKRMA.Show (config);
		}

		if (GUILayout.Button ("Run Provider Tests")) {
			RunProviderTests ();
		}

		if (GUILayout.Button ("Run Appearance Tests")) {
			RunAppearanceTests ();
		}

		if (GUILayout.Button ("Run SDK Tests")) {
			ZendeskSDK.ZDKLogger.Enable(true);
			ZendeskSDK.ZDKDispatcher.SetDebugLoggingiOS(true);

			// ZDKDeviceInfo Tests
			Debug.Log (string.Format ("Device Type: {0}", ZendeskSDK.ZDKDeviceInfo.DeviceTypeiOS ()));
			Debug.Log (string.Format ("Total Device Memory: {0}", ZendeskSDK.ZDKDeviceInfo.TotalDeviceMemoryiOS ()));
			Debug.Log (string.Format ("Free Disk Space: {0}", ZendeskSDK.ZDKDeviceInfo.FreeDiskspaceiOS ()));
			Debug.Log (string.Format ("Total Disk Space: {0}", ZendeskSDK.ZDKDeviceInfo.TotalDiskspaceiOS ()));
			Debug.Log (string.Format ("Battery Level: {0}", ZendeskSDK.ZDKDeviceInfo.BatteryLeveliOS ()));
			Debug.Log (string.Format ("Region: {0}", ZendeskSDK.ZDKDeviceInfo.RegioniOS ()));
			Debug.Log (string.Format ("Language: {0}", ZendeskSDK.ZDKDeviceInfo.LanguageiOS ()));
			Debug.Log (string.Format ("Device Info String: {0}", ZendeskSDK.ZDKDeviceInfo.DeviceInfoString ()));
			Hashtable deviceInfoDict = ZendeskSDK.ZDKDeviceInfo.DeviceInfoDictionary ();
			Debug.Log (string.Format ("Device Info Dictionary:"));
			foreach (string key in deviceInfoDict.Keys) {
				Debug.Log (string.Format ("{0}: {1}", key, deviceInfoDict [key]));
			}

			// ZDKStringUtil Tests
			string[] strings = new string[2];
			strings [0] = "one";
			strings [1] = "second";
			Debug.Log (string.Format ("CSVStringFromArray: {0}", ZendeskSDK.ZDKStringUtil.CsvStringFromArray (strings)));

			// ZDKLogger Tests
			ZendeskSDK.ZDKLogger.Enable (true);
		}
	}
コード例 #4
0
ファイル: ZDKRMA.cs プロジェクト: Jannizzle/ZENDESK
		public static void Show(ZDKRMAConfigObject config) {

			//An array of booleans that represent which button to include in the dialog
			bool[] dialogBools = new bool[3];
			if (config.DialogActions != null) {
				for (int i = 0; i < config.DialogActions.Length; i++) {
					if (config.DialogActions [i] == ZDKRMAAction.ZDKRMARateApp) {
						dialogBools [0] = true;
					} else if (config.DialogActions [i] == ZDKRMAAction.ZDKRMASendFeedback) {
						dialogBools [1] = true;
					} else if (config.DialogActions [i] == ZDKRMAAction.ZDKRMADontAskAgain) {
						dialogBools [2] = true;
					}
				}
			}
			//If the config.DialogActions was null then the default is to add all the buttons
			else {
				for (int i = 0; i < dialogBools.Length; i++) {
					dialogBools[i] = true;
				}
			}
			using(var pluginClass = new AndroidJavaClass("com.zendesk.unity.ZDK_Plugin")) {
				_plugin = pluginClass.CallStatic<AndroidJavaObject>("instance");
			}
			_plugin.Call("showInViewWithConfig", false, config.AdditionalTags,
			             config.AdditionalRequestInfo,
			             dialogBools,
			             config.RequestSubject);
		}
コード例 #5
0
ファイル: ZDKRMA.cs プロジェクト: Jannizzle/ZENDESK
		/// <summary>
		/// To show the ZDKRMA dialog in a view, call this methed
		/// </summary>
		/// <param name="config">A ZDKRMAConfigObject to configure the Rate My App interface.</param>
		public static void Show(ZDKRMAConfigObject config) {
			Log("Unity : ShowWithConfiguration");
		}