Search code examples
.netparse-platformwindows-phone-8migrationback4app

Set API server with Parse SDK for Windows Phone


I am using Parse as a backend for my Windows Phone applications. Since Parse is shutting down, I am trying to migrate my apps with back4app service.

I updated Parse SDK for Windows Phone via NuGet Package Manager to Parse SDK 1.7 and I should now point my app to another server like this

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

});

but there is no such method in Parse SDK 1.7 for .NET. There is only Initialize method like this

  ParseClient.Initialize(appid, key);  

How can I overcome this last step?

Thanks


Solution

  • I looked at this code and it looks like it's there.

    if you will go to line number 35 you will see the configuration struct

    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; }
          }
    

    and if you will go to line number 144 you will see a static method that you can initialise the parse client SDK with the configuration struct

       /// <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();
          }
        }
    

    So maybe you are using a wrong version or maybe it's some issue with your NuGet configuration..