Exemplo n.º 1
0
        /// <summary>
        /// Configures the HockeyAppSDK
        /// </summary>
        /// <param name="appIdentifier">Identifier of the app</param>
        /// <param name="appVersionInformation">version of the app</param>
        /// <param name="userID">optional user id - e.g. the logged in user</param>
        /// <param name="contactInformation">optional contact information like an email adress</param>
        /// <param name="descriptionLoader">optional delegate for attaching description information like event logs etc. Can be null.</param>
        /// <param name="apiBase">optional: apiBase - if not the standard is used</param>
        public void Configure(string appIdentifier,
                              string appVersionInformation,
                              string userID             = null,
                              string contactInformation = null,
                              Func <Exception, string> descriptionLoader = null,
                              string apiBase         = "https://rink.hockeyapp.net",
                              string userAgentString = null)

        {
            if (String.IsNullOrWhiteSpace(apiBase))
            {
                throw new Exception("ApiBase must not be empty!");
            }

            logger.Info("Configure HockeyClientWPF with appIdentifier={0}, userID={1}, contactInformation={2}, descriptionLoader available{3}, sendCrashesAutomatically={4}, apiBase={5}",
                        new object[] { appIdentifier, userID, contactInformation, (descriptionLoader != null).ToString(), apiBase });

            HockeyClient.ConfigureInternal(appIdentifier,
                                           appVersionInformation,
                                           apiBase: apiBase,
                                           userID: userID,
                                           contactInformation: contactInformation,
                                           userAgentName: "",
                                           sdkName: Constants.SDKNAME,
                                           sdkVersion: Constants.SDKVERSION);

            this._crashHandler = new CrashHandler(HockeyClient.Instance, descriptionLoader);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Configures the HockeyAppSDK
        /// </summary>
        /// <param name="appIdentifier">Identifier of the app</param>
        /// <param name="appVersionInformation">optional version of the app. If null the executing assembly version is used</param>
        /// <param name="userID">optional user id - e.g. the logged in user</param>
        /// <param name="contactInformation">optional contact information like an email adress</param>
        /// <param name="descriptionLoader">optional delegate for attaching description information like event logs etc. Can be null.</param>
        /// <param name="apiBase">optional: apiBase - if not the standard is used</param>
        /// <param name="userAgentString">The user agent string.</param>
        /// <param name="keepRunning">optional: if an unhandled exception is thrown on the dispatcher thread, the system can be kept alive - default is false</param>
        /// <exception cref="System.Exception">ApiBase must not be empty!</exception>
        public void Configure(string appIdentifier,
                              string appVersionInformation = null,
                              string userID             = null,
                              string contactInformation = null,
                              Func <Exception, string> descriptionLoader = null,
                              string apiBase         = "https://rink.hockeyapp.net",
                              string userAgentString = null,
                              bool keepRunning       = false)

        {
            if (String.IsNullOrWhiteSpace(apiBase))
            {
                throw new Exception("ApiBase must not be empty!");
            }

            logger.Info("Configure HockeyClientWPF with appIdentifier={0}, userID={1}, contactInformation={2}, descriptionLoader available{3}, sendCrashesAutomatically={4}, apiBase={5}",
                        new object[] { appIdentifier, userID, contactInformation, (descriptionLoader != null).ToString(), apiBase });

            string myAppVersion = string.IsNullOrEmpty(appVersionInformation)?
                                  Assembly.GetCallingAssembly().GetName().Version.ToString()
                :appVersionInformation;

            HockeyClient.ConfigureInternal(appIdentifier,
                                           myAppVersion,
                                           apiBase: apiBase,
                                           userID: userID,
                                           contactInformation: contactInformation,
                                           userAgentName: Constants.USER_AGENT_STRING,
                                           sdkName: Constants.SDKNAME,
                                           sdkVersion: Constants.SDKVERSION,
                                           os: Environment.OSVersion.Platform.ToString(),
                                           osVersion: Environment.OSVersion.Version.ToString() + Environment.OSVersion.ServicePack);
            this._crashHandler = new CrashHandler(HockeyClient.Instance, descriptionLoader, keepRunning);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Configures the HockeyAppSDK
        /// </summary>
        /// <param name="appIdentifier">Identifier of the app</param>
        /// <param name="appVersionInformation">version of the app</param>
        /// <param name="userID">optional user id - e.g. the logged in user</param>
        /// <param name="contactInformation">optional contact information like an email adress</param>
        /// <param name="descriptionLoader">optional delegate for attaching description information like event logs etc. Can be null.</param>
        /// <param name="rootFrame">optional: rootFrame - if the rootframe is provided async void exception handling is improved</param>
        public void Configure(string appIdentifier,
                              string appVersionInformation,
                              string userID             = null,
                              string contactInformation = null,
                              Func <Exception, string> descriptionLoader = null,
                              string apiBase  = "https://rink.hockeyapp.net/api/2/",
                              Frame rootFrame = null)
        {
            if (String.IsNullOrWhiteSpace(apiBase))
            {
                throw new Exception("ApiBase must not be empty!");
            }

            logger.Info("Configure HockeyClientWPF with appIdentifier={0}, userID={1}, contactInformation={2}, descriptionLoader available{3}, sendCrashesAutomatically={4}, apiBase={5}",
                        new object[] { appIdentifier, userID, contactInformation, (descriptionLoader != null).ToString(), apiBase });

            HockeyClient.ConfigureInternal(appIdentifier,
                                           appVersionInformation,
                                           apiBase: apiBase,
                                           userID: userID,
                                           contactInformation: contactInformation,
                                           userAgentName: "",
                                           sdkName: Constants.SDKNAME,
                                           sdkVersion: Constants.SDKVERSION);

            this._crashHandler = new CrashHandler(HockeyClient.Instance, descriptionLoader);

            if (rootFrame != null)
            {
                //Idea based on http://www.markermetro.com/2013/01/technical/handling-unhandled-exceptions-with-asyncawait-on-windows-8-and-windows-phone-8/
                AsyncSynchronizationContext.RegisterForFrame(rootFrame, this._crashHandler);
            }
        }
Exemplo n.º 4
0
        public void Configure(Application application,
                              string identifier,
                              Frame rootFrame = null,
                              Func <Exception, string> descriptionLoader = null,
                              string apiBase            = null,
                              string userId             = null,
                              string contactInformation = null)
        {
            if (this._application == null)
            {
                this._crashLogInfo = new CrashLogInformation()
                {
                    PackageName  = application.GetType().Namespace,
                    ProductID    = ManifestHelper.GetProductID(),
                    Version      = ManifestHelper.GetAppVersion(),
                    WindowsPhone = Environment.OSVersion.Version.ToString(),
                    Manufacturer = GetDeviceManufacturer(),
                    Model        = GetDeviceModel()
                };


                this._application = application;
                this._application.UnhandledException += OnUnhandledException;
                HockeyClient.ConfigureInternal(identifier,
                                               ManifestHelper.GetAppVersion(),
                                               userID: userId,
                                               apiBase: apiBase,
                                               contactInformation: contactInformation,
                                               userAgentName: Constants.UserAgentString,
                                               sdkName: Constants.SdkName,
                                               sdkVersion: Constants.SdkVersion,
                                               descriptionLoader: descriptionLoader,
                                               os: Environment.OSVersion.Platform.ToString(),
                                               osVersion: Environment.OSVersion.Version.ToString(),
                                               device: GetDeviceModel(),
                                               oem: GetDeviceManufacturer());
                if (rootFrame != null)
                {
                    //Idea based on http://www.markermetro.com/2013/01/technical/handling-unhandled-exceptions-with-asyncawait-on-windows-8-and-windows-phone-8/
                    AsyncSynchronizationContext.RegisterForFrame(rootFrame, this);
                }
            }
            else
            {
                throw new InvalidOperationException("CrashHandler was already configured!");
            }
        }