parse-community / Parse-SDK-dotNET

Parse SDK for .NET, Xamarin, Unity.
http://parseplatform.org
Apache License 2.0
324 stars 260 forks source link

Unity3D ParseInitializeBehavior should allow you to specify the ParseServer URL #166

Closed prodigga closed 5 years ago

prodigga commented 8 years ago

So that we can migrate our apps to privately hosted servers.

richardjrossiii commented 8 years ago

Yep. This is forthcoming, after the previously discussed modularization for this SDK completes.

huang1196 commented 8 years ago

+1

mcijsouw commented 8 years ago

+1

jaganjan commented 8 years ago

:+1:

jaganjan commented 8 years ago

+1

gfosco commented 8 years ago

There were several bug reports that the .net SDK (not unity specific) was requiring a trailing / be added to the server URL. This should be done automatically. Noting this here and closing the issue there.

https://github.com/ParsePlatform/parse-server/issues/81

richardjrossiii commented 8 years ago

@gfosco it's actually more difficult than that due to how URIBuilder works on .NET, as it treats multiple slashes as root, and paths without a relative path as relative to that. I'll continue working on it, but no ETA on a fix for that specific part.

richardjrossiii commented 8 years ago

Hey guys, this has been fixed in #169. The next version will include this fix, or if you're ambitious you can compile the SDK from the source itself.

sghamaty commented 8 years ago

@richardjrossiii when do we think the next compiled version will be posted? Im having some issues compiling the SDK on my mac.

richardjrossiii commented 8 years ago

@sghamaty Yep, there's an issue with how XBuild searches for paths that differs from MSBuild, which means you can only compile through VS.

Not sure on release time yet for 1.8.0, probably still a little ways away as we still need to fix up the Nuget packages in order to support all of these different platforms.

sghamaty commented 8 years ago

It blocks parse migration for anyone thats using the Unity and C# sdks.

Any idea when the official version will be ready?

huang1196 commented 8 years ago

@gfosco Can I compile the Unity sdk by myself? I've downloaded & built the project, but I didn't know which is the Unity sdk file. (no file named Parse.Unity.dll)

sghamaty commented 8 years ago

There was no Parse.Unity.dll either when I compiled in VS. I ended up including all the Release DLLs in the unity project. Core, Analytics, etc. That worked for me.

There's probably a script that packages it up. Can someone post instructions on how to do that?

On Mon, Feb 15, 2016 at 1:26 AM, huang1196 notifications@github.com wrote:

@gfosco https://github.com/gfosco Can I compile the Unity sdk by myself? I've downloaded & built the project, but I didn't know which is the Unity sdk file. (no file named Parse.Unity.dll)

— Reply to this email directly or view it on GitHub https://github.com/ParsePlatform/Parse-SDK-dotNET/issues/166#issuecomment-184129787 .

Avatarchik commented 8 years ago

Someone was working unity3d sdk?I can not continue working because of this ...

sghamaty commented 8 years ago

Which issue is blocking you Sergey?

On Mon, Feb 29, 2016 at 1:08 PM, Sergey notifications@github.com wrote:

Someone was working unity3d sdk?I can not continue working because of this ...

— Reply to this email directly or view it on GitHub https://github.com/ParsePlatform/Parse-SDK-dotNET/issues/166#issuecomment-190395371 .

Avatarchik commented 8 years ago

I carried on my server, but I can not specify serverUrl version (1.7.0), I can see already that there is support in the source code, but I can not compile (MAC OS)

ghost commented 8 years ago

I have this issue too, I need to be able to specify server URL in order to move my app to privately hosted server. Is this achievable somehow at the moment? Will simply building the source and importing all of the separate DLLs allow me to do that, or do I have to wait for the asset store package update?

Avatarchik commented 8 years ago

Hello! Who can collect the dll from the source?

Avatarchik commented 8 years ago

Hi! I compiled the sources, https://drive.google.com/file/d/0B5nWjiXFR3UDR0M4a01hVV9sdEk/view?usp=sharing


This download is not official or endorsed by Parse in any way. Use at your own risk.

richardjrossiii commented 8 years ago

@Avatarchik thanks for sharing - I'll have to add a CYA disclaimer to your post to prevent confusion for people downloading this :).

Remember also that as with any build based off of master, it may not be fully working.

infosekr commented 8 years ago

Hi @Avatarchik, I get the following errors with your .dlls:

FileNotFoundException: Could not load file or assembly 'UnityEditor.iOS.Extensions.Xcode' or one of its dependencies. The system cannot find the file specified. System.AppDomain.Load (System.Reflection.AssemblyName assemblyRef, System.Security.Policy.Evidence assemblySecurity) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System/AppDomain.cs:692) (wrapper remoting-invoke-with-check) System.AppDomain:Load (System.Reflection.AssemblyName,System.Security.Policy.Evidence) System.AppDomain.Load (System.Reflection.AssemblyName assemblyRef) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System/AppDomain.cs:657) (wrapper remoting-invoke-with-check) System.AppDomain:Load (System.Reflection.AssemblyName) System.Reflection.Assembly.Load (System.Reflection.AssemblyName assemblyRef) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/Assembly.cs:589) AssemblyLister.Lister.DeepWalkReferences (System.Reflection.Assembly assembly, System.Collections.Generic.HashSet1 seen) AssemblyLister.Lister+<>c__DisplayClass1.b0 (System.Reflection.Assembly asm) System.Linq.Enumerable+cIterator122[System.Reflection.Assembly,System.Reflection.Assembly].MoveNext () System.Linq.Enumerable+<CreateSelectManyIterator>c__Iterator122[System.Reflection.Assembly,Parse.Common.Internal.ParseModuleAttribute].MoveNext () System.Linq.Enumerable+cIterator10`2[Parse.Common.Internal.ParseModuleAttribute,System.Type].MoveNext () System.Linq.Enumerable+cIterator1D1[System.Type].MoveNext () Parse.Common.Internal.ParseModuleController.ScanForModules () Parse.ParseClient..cctor () Rethrow as TypeInitializationException: An exception was thrown by the type initializer for Parse.ParseClient Parse.ParseInitializeBehaviour.Initialize () Parse.ParseInitializeBehaviour.Awake ()

infosekr commented 8 years ago

@Avatarchik after installing the Android and Xamarin resources that VS 2015 prompts for when loading the solution I was able to correctly build a single Parse.Unity.dll (rather than getting the 9 files that you posted before). I added the missing serverURL field to ParseInitializeBehaviour that is needed for Unity so now Parse is contacting my server running on an EC2 box.

One point to note in case anyone else runs into this, I needed a trailing "/" at the end of my url to make it work correctly. So my url looks like: http://hostname:1337/parse/

I've attached my dll if anyone cannot get the build working. Parse.Unity.zip

ghost commented 8 years ago

@infosekr i solved the extension.xcode problem by copying that file from unity installation folder over to my project's plugins.

Did you guys test it on mobile devices? That's the only thing we're worried about now, since we can't test it yet duo to a refactor our app is going through?

Avatarchik commented 8 years ago

There must be unity module installed ios, or throw this one file in the Plugins folder https://dl.dropboxusercontent.com/u/8463900/UnityEditor.iOS.Extensions.Xcode.dll

huang1196 commented 8 years ago

@infosekr

Hi, could you tell us how to build a single Parse.Unity.dll? It seems that this version has a bug as https://github.com/ParsePlatform/parse-server/issues/448 and I wonder if they have fixed this issue now

infosekr commented 8 years ago

Hi there, The single Parse.Unity.dll is for the client side though, you are referencing a bug on the server.To build the client into a single dll, I had to make sure that I downloaded all the plugins that Visual Studios requested (Android SDK, Xamarin tools, etc), and I got the source projects from the release page rather than the main github page.  Regards,Aaron

On Thursday, March 17, 2016 12:07 AM, huang1196 <notifications@github.com> wrote:

@infosekr Hi, could you tell us how to build a single Parse.Unity.dll? It seems that this version has a bug as ParsePlatform/parse-server#448 and I wonder if they have fixed this issue now— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub

RogueRocketGames commented 8 years ago

I just want to follow up on this issue, as it's marked closed, yet following this thread, it seems like it wasn't actually officially resolved by the lovely people at Parse. And in fact, earlier there was a warning that any changelist beyond the official release of 1.7 was not necessarily approved as stable. What is the expected status of Unity support going forward?

noosxe commented 8 years ago

This thing is really a blocking issue, when it will be ready ?

ghost commented 8 years ago

@noosxe what is blocking you? Just clone source and build, and import that instead of the asset store one. It will have a server URL field. And look into my comment on extension.xcode.

I did it and it works perfectly. No need to wait for anything.

noosxe commented 8 years ago

I can't even build the solution right now, getting some errors

steven-supersolid commented 8 years ago

What I did was branch from 1.7.0, modify a couple of lines of code to add serverURL as a parameter in ParseInitializeBehaviour and built that. Parse.Unity.dll builds fine in VS Community Edition on 1.7.0

Here is my fork, use at your own risk :) https://github.com/supersolid/Parse-SDK-dotNET/tree/release/1.7.0

noosxe commented 8 years ago

Thanks for your link, though that does not build ok for me again, I'm getting same errors. Trying to build with VS 2015 community from IDE and from cmd with MSBuild

steven-supersolid commented 8 years ago

@noosxe you will have to provide more details, e.g. what kind of errors. As other people in this thread can build fine for either version then the problem is likely to be on your end.

noosxe commented 8 years ago

nuget.targets(72,9): error MSB4175: The task factory "CodeTaskFacto ry" could not be loaded from the assembly "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Build.Tasks.v4.0. dll". Could not load file or assembly 'file:///C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Build.Tasks.v 4.0.dll' or one of its dependencies. The system cannot find the file specified. [C:\Users\noosxe\projects\pars esdk\ParseCore\Test\ParseCore.Test.Unit.NetFx45.csproj]

nuget.targets(72,9): error MSB4175: The task factory "CodeTaskFacto ry" could not be loaded from the assembly "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Build.Tasks.v4.0. dll". Could not load file or assembly 'file:///C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Build.Tasks.v 4.0.dll' or one of its dependencies. The system cannot find the file specified. [C:\Users\noosxe\projects\pars esdk\ParseAnalytics\Test\ParseAnalytics.Test.Unit.NetFx45.csproj]

nuget.targets(72,9): error MSB4175: The task factory "CodeTaskFacto ry" could not be loaded from the assembly "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Build.Tasks.v4.0. dll". Could not load file or assembly 'file:///C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Build.Tasks.v 4.0.dll' or one of its dependencies. The system cannot find the file specified. [C:\Users\noosxe\projects\pars esdk\ParseCommon\Test\ParseCommon.Test.Unit.NetFx45.csproj]

and couple of more errors like this for other subprojects inside solution.

Errors happen, though the files, system cannot find, actually exist in their places.

noosxe commented 8 years ago

I did a change in my path to take MSBuild from other directory and started to get other errors Specifically 26 errors like this

error CS0012: The type 'Task<>' is defined in an assembly that is not referenced. You must add a reference to assembly 'Unity.Tasks, Version= 0.0.0.0, Culture=neutral, PublicKeyToken=null'. [C:\Users\noosxe\projects\parsesdk\ParseCore\Test\ParseCore.Test.Unit.NetFx45.csproj]

neoshamangames commented 8 years ago

Hi steven-supersolid, I'm also having trouble compiling in Visual Studio 2015. I am getting the following errors when I attempt to build:

Error Metadata file '\Parse-SDK-dotNET\ParseCore\bin\Debug\Unity\Parse.Core.dll' could not be found

Error CS0120 An object reference is required for the non-static field, method, or property 'DeviceInfoController.Initialize()' ParsePush.Unity.Android

\Parse-SDK-dotNET\ParsePush\Internal\DeviceInfo\Unity.Android\DeviceInfoController.cs 46 Active Is it possible for someone to supply a .dll with this feature in place? This is also holding up our development. Thank you. UPDATE: I managed to build by opening the Configuration Manager in VS and checking ParseCore.Unity that was unchecked for some reason. The build succeeded but now I am trying to locate the file Parse.Unity.dll to swap into my project. It does not seem to have been created. Please advice.
steven-supersolid commented 8 years ago

To build, I did the following:

  1. Opened the solution file Parse.sln
  2. Switched the configuration to Release
  3. Select mixed platforms
  4. Build The dll was put in: C:...\Parse-SDK-dotNET\Parse\bin\Release\Unity\Parse.Unity.dll

You could also load the project file C:...\Parse-SDK-dotNET\Parse\Parse.Unity.csproj and do the same. The build location is the same.

If building debug instead the build location is: C:...\Parse-SDK-dotNET\Parse\bin\Debug\Unity\Parse.Unity.dll

steven-supersolid commented 8 years ago

I just updated the branch with a couple of fixes for documentation warnings

neoshamangames commented 8 years ago

Hi again steven-supersolid,

After building, the directory C:...\Parse-SDK-dotNET\Parse is not present on my machine. There is ParseAnalytics, ParseCommon, ParseCore, ParsePush, Unity.Compact, and Unity.Tasks. Still stuck.

steven-supersolid commented 8 years ago

Parse-SDK-dotNET is the base directory where I cloned to, it may be something else on your system. It looks like you are working from master which has the new directory structure (unreleased 1.8.x) and something I've not looked at getting working yet. Instead you should switch to my branch 1.7.0 which is a branch I made from the 1.7.0 release tag and then updated to work with a custom server URL.

neoshamangames commented 8 years ago

I managed to get it to work using your branch. Thank you. Will the parse team integrate this change into their next official release?

peterwilli commented 8 years ago

Can someone please give me a pre-built binary? I know this is a bit of a weird request, but I cant compile this stuff with MonoDevelop/Xamarin and I dont want to run Windows in a VM just to compile 1 assembly. Thanks in advance!

AndrewKeplinger commented 8 years ago

Trying to migrate my Unity App from Parse hosting to my own, but I'm going to need the Unity plugin updated to do this. Read the conversation and it looks like until Parse puts out a new DLL I'll be flying the the seat of my pants. This isn't something I want to be telling my clients. I would rather tell them that the updated plugin will be ready be some upcoming date. Is that possible? Even if I do work out all of the errors that I'm seeing when I try to compile I'll still be replacing my code with the official plugin, so I'd rather go through the transition just one time. If anybody from Parse wants some useful Beta testing for their new release, we would be glad to report with that.

echeg commented 8 years ago

Any news about new official Parse DLL for Unity?

wootangs commented 8 years ago

We are working on Unity 4.7 so we are using Facebook 6.2.2 and Parse 1.5.3.0 During DB and server migration to Heroku, we can't change server url as below.

ParseClient.Initialize(new ParseClient.Configuration { ApplicationId = "YOUR_APP_ID", Server = "http://localhost:1337/parse/“ });

Cause ParseClient Class 1.5.3 uri is originally included in dll.

public static void Initialize(string applicationId, string dotnetKey) { object obj; Monitor.Enter(obj = ParseClient.mutex); try { ParseClient.HostName = (ParseClient.HostName ?? new Uri("https://api.parse.com/")); ParseClient.ApplicationId = applicationId; . . . } finally { Monitor.Exit(obj); } }

Is there any solution for that? This is so important issue for migration.

peterwilli commented 8 years ago

@wootangs I even tried reflection to force custom url in but it didn't work either, I really hope they are going to release a new DLL soon :(

steven-supersolid commented 8 years ago

@wootangs Unity 4 support was dropped in 1.6.2 and the earliest open source version is 1.6.0. So you only have a couple of options as far as I can see:

  1. Update to whichever Unity 4 compatible version works for you (1.6.x), branch the SDK and modify the SDK code to pass a custom serverURL
  2. Update to Unity 5 - this is your best bet as you can use the official version 1.8.x when it is released, or my branch of 1.7.0
  3. Branch from my branch of 1.7.0 and modify the code to become Unity 4 compatible
wootangs commented 8 years ago

@steven-supersolid I tried to build your 1.7.0 with xamarin(MacOS) but got error.

Progress.cs line 14 private SynchronizedEventHandler progressChanged = new SynchronizedEventHandler();
error : The type or namespace name ‘SynchronizedEventHandler’ could not be found. Are you missing an assembly reference?

Do I need to build with VisualStudio in window?

steven-supersolid commented 8 years ago

I've only built in Visual Studio on Windows. Did not try on a Mac. Visual Studio does need to download a few libraries and updates to build so perhaps Xamarin is not doing the same.

peterwilli commented 8 years ago

@steven-supersolid can you give me a built DLL? I can't compile because I run linux and there is some bug with xamarin over there :(