0

我使用 Parse 作为我的 Windows Phone 应用程序的后端。由于 Parse 正在关闭,我正在尝试使用 back4app 服务迁移我的应用程序。

我通过 NuGet 包管理器将 Windows Phone 的 Parse SDK 更新为 Parse SDK 1.7,现在我应该将我的应用程序指向另一个这样的服务器

ParseClient.Initialize(new ParseClient.Configuration {
ApplicationId = "YOUR_APP_ID",
WindowsKey = "YOUR_DOTNET_KEY",
Server = "https://parseapi.back4app.com"

});

但是 Parse SDK 1.7 for .NET 中没有这样的方法。只有这样的初始化方法

  ParseClient.Initialize(appid, key);  

我怎样才能克服这最后一步?

谢谢

4

1 回答 1

0

我查看了这段代码,它看起来就在那里。

如果您转到第 35 行,您将看到配置结构

public struct Configuration {
      /// <summary>
      /// In the event that you would like to use the Parse SDK
      /// from a completely portable project, with no platform-specific library required,
      /// to get full access to all of our features available on Parse.com
      /// (A/B testing, slow queries, etc.), you must set the values of this struct
      /// to be appropriate for your platform.
      ///
      /// Any values set here will overwrite those that are automatically configured by
      /// any platform-specific migration library your app includes.
      /// </summary>
      public struct VersionInformation {
        /// <summary>
        /// The build number of your app.
        /// </summary>
        public String BuildVersion { get; set; }

        /// <summary>
        /// The human friendly version number of your happ.
        /// </summary>
        public String DisplayVersion { get; set; }

        /// <summary>
        /// The operating system version of the platform the SDK is operating in..
        /// </summary>
        public String OSVersion { get; set; }
      }

如果您转到第 144 行,您将看到一个静态方法,您可以使用配置结构初始化解析客户端 SDK

   /// <summary>
    /// Authenticates this client as belonging to your application. This must be
    /// called before your application can use the Parse library. The recommended
    /// way is to put a call to <c>ParseFramework.Initialize</c> in your
    /// Application startup.
    /// </summary>
    /// <param name="configuration">The configuration to initialize Parse with.
    /// </param>
    public static void Initialize(Configuration configuration) {
      lock (mutex) {
        configuration.Server = configuration.Server ?? "https://api.parse.com/1/";
        CurrentConfiguration = configuration;

        ParseObject.RegisterSubclass<ParseUser>();
        ParseObject.RegisterSubclass<ParseRole>();
        ParseObject.RegisterSubclass<ParseSession>();

        ParseModuleController.Instance.ParseDidInitialize();
      }
    }

所以也许你使用了错误的版本,或者你的 NuGet 配置有问题..

于 2016-08-23T20:18:09.927 回答