为 Windows Phone 使用 Parse SDK 设置 API 服务器

Set API server with Parse SDK for Windows Phone

我正在使用 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 中没有这样的方法。只有这样的 Initialize 方法

  ParseClient.Initialize(appid, key);  

我该如何克服这最后一步?

谢谢

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

如果您转到第 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 配置有问题..