@Crojach We haven't yet tested these libraries on Xamarin, and don't officially support the platform.
However, that being said, we'd like to support Xamarin, and I intend to do some work at some point to see what we'd need to do to make this work. We don't have any particular timeline for this though.
we were kind of hoping that it'd just work due to Xamarin now supporting netstandard, and our libraries targeting netstandard1.3. However, I guess it may not be quite that simple.
I know almost nothing about Xamarin. That being said I added an Android project to my Dev project which basically contains the Source for the core lib and a few of the Apis.
Its not able to find the Service for the API or GoogleWebAuthorizationBroker.
I might do a bit of Googling to see if i cant find a simple cause. As you said with netstandard support I really would have hoped it would work.
Having just had a quick look, it looks like GoogleWebAuthorizationBroker is only available on .NET4, which is why it can't be found.
If you try using a different auth mechanism, it might work? Maybe ServiceAccountCredential, that should be available.
I am leaving work now I can try that tomorrow but it doesn't explain why it couldn't find the YouTube scopes. I checked that project is 4.5
This project only has source for YouTube and Analytics i will dump in Calendar tomorrow might as well be consistent with testing.
Any news on this one?
@Crojach: Did you try ServiceAccountCredential as Chris suggested? It may not be a good fit for your final application, but it's worth trying just to see whether it works as a starting point. Presumably you'd like to eventually authenticate _as an end user_?
Didn't see that response. Will try it out and hopefully it will do the trick. There won't be a need to authenticate as and end user since everything I need to do (get the calendar, add/edit entries) can be done by just having the users permission up front.
Hmmm... but if it's the user's calendar, you'd need authentication which provides the authorization for that user. (You probably don't want your service credentials in the app, either.) Anyway, we can look at that part once we've found out whether ServiceAccountCredential at least works...
Works with service accounts. I can build it using my standard Service account code with Json file.
However I am using the term "works" loosely I added code it runs I see the emulator. However I am getting a deploy failed. I would need to spend sometime with the documentation to know more. I am guessing its not related to the client library. I kinda just dumped the code at the bottom of an onCreate method that came with the dummy project.
Hey!
Sorry for the late reply. Some things outside my control were going on so I wasn't able to respond. I have just tried to handle it using ServiceAccountCredential but I am getting a compile error
Failed to resolve assembly: 'crypto, Version=1.8.1.0, Culture=neutral, PublicKeyToken=0e9937e54769942' in file MTOUCH
Any ideas what the problem might be.
@LindaLawton Could you maybe attach your project so I can take it for a spin?
How about a tutorial Google Service Account Json Key file if it doesn't work with Xamarin let me know we can fix it
I am still getting the same error... There seems to be some kind of problem with System.dll but I am not sure what.
Hmmmm... Just tried to build it for Android and it Worked. It looks like this is an iOS build problem
Looks like you are having better luck then me. I am having issues deploying to the Android emulator today.
I have managed to create a calendar now and it's looking good but as John mentioned this doesn't allow me to handle the calendar as the end user. Is it possible to send and invite to someone to this calendar from code?
I guess it depends on what you are doing.
If you take the Service account email and add it as a user to which every calendar you were going to use it will have access to that and can invite people to that calendar. You are basically just sharing the calendar with another user. Kind of like what my boyfriend and i have done with our primary calendars.
Then your service account can invite people to events created on that calendar. I think they will also have the option to add the event to their own calendar. With Oauth2 you would be writing to their calendar for them and would bypass the option of having the main calendar showing all the events.
Hope that made at least a little scene.
That might work as an interim solution before the GoogleWebAuthorizationBroker starts working (fingers crossed) on Xamarin or some other library gets added to Xamarin to handle this.
The user will share his calendar with the app and then they will be able to handle entries inside the app and sync it across platforms.
Thanks for your effort!
There is just one more thing I would like to ask you. The error on Xamarin iOS I mentioned:
Failed to resolve assembly: 'crypto, Version=1.8.1.0, Culture=neutral, PublicKeyToken=0e9937e54769942' in file MTOUCH is still persistend even after updating all packages.
Any idea why?
Same problem here, GoogleWebAuthorizationBroker not found. I found that with Google.Apis.Auth.PlatformService.dll, found in ....\packages\Google.Apis.Auth.1.8.1\lib\net40\Google.Apis.Auth.PlatformServices.dll it works ! But with netstandard1.3, depedencies are not downloaded ...
GoogleWebAuthorizationBroker is now available for netstandard1.3, as of release v1.24
This may help, but please note that we still don't support Xamarin.
Hello,
I can't addthis package in my project-Google.API.calender.v3 when integrating google calendar in my App.Getting this error-Failed to add reference to 'Microsoft.CSharp'. Please make sure that it is in the Global Assembly Cache.Can't understand this issue.
@manalikundu: Please link to the exact NuGet package you're trying to add. Google.Apis.Calendar.v3 doesn't have a dependency on Microsoft.CSharp...
I have installed this package -Package Google.Apis.Calendar.v3 from package manager console and getting this error.What is the exact NuGet package for it then?
That should be fine. Please copy and paste the exact complete log of the package manager. It may be a badly-behaved child dependency.
Can you please give me the complete log of that package manager.
Thanks
@manalikundu: No, that's what we're asking you to do. Run the Install-Package command, and give us the complete log. Also, if you could include all the relevant information about the version of Xamarin you're using and your project configuration, that would be useful.
(Note that I don't think we've specifically tested with Xamarin yet, although we do want to support it.)
PM> Install-Package Google.Apis.Calendar.v3
Attempting to gather dependency information for package 'Google.Apis.Calendar.v3.1.26.2.866' with respect to project 'DemoArabic', targeting 'MonoAndroid,Version=v7.0'
Attempting to resolve dependencies for package 'Google.Apis.Calendar.v3.1.26.2.866' with DependencyBehavior 'Lowest'
Resolving actions to install package 'Google.Apis.Calendar.v3.1.26.2.866'
Resolved actions to install package 'Google.Apis.Calendar.v3.1.26.2.866'
Adding package 'Microsoft.CSharp.4.3.0' to folder 'PATH'
Added package 'Microsoft.CSharp.4.3.0' to folder 'PATH'
Install failed. Rolling back...
Package 'Microsoft.CSharp.4.3.0' does not exist in project 'DemoArabic'
Removing package 'Microsoft.CSharp.4.3.0' from folder 'PATH'
Removed package 'Microsoft.CSharp.4.3.0' from folder 'PATH'
Install-Package : Failed to add reference to 'Microsoft.CSharp'. Please make sure that it is in the Global Assembly Cache.
At line:1 char:1
PM>
XAMARIN VERSION 4.5
Right, thank you for the details. @chrisdunelm, which version of Xamarin have you got installed? Any idea which TFM "MonoAndroid v7.0" would resolve to?
I'm out of date, just updating my Mac to Xamarin Studio 6.3.0 with Xamarin.Android 7.3.1.1 now.
I can also install the Xamarin bits in my VS2017 if necessary.
@manalikundu Is this a project within Visual Studio or Xamarin Studio? Which version? On what version of Windows? (Assuming you're using VS/Windows)
But note that as @jskeet has said, we don't yet support Xamarin, and we haven't performed any testing on Xamarin. #984 will be our issue for tracking, once this work gets underway; we have no timeframe in mind for this yet.
Doing a bit of testing with TFM's here, it appears that the TFM monoandroid7.0 prefers to use monoandroid* targets, but will use netstandard1.? too.
So it should be picking up the netstandard1.3 target from the Google.Apis.Calendar.v3 v1.26.2 nupkg. This certainly shouldn't have anything to do with Microsoft.CSharp, unless there's some kind of magic import of Microsoft.CSharp from MonoAndroid projects when using netstandard libraries? I don't know.
I'll need to wait until I've got a working Xamarin setup before I can try to reproduce this myself.
Hello Sir,
My project is in Visual Studio 4.5.Windows 8
Thanks
Closing this issue in favour of issue #984, which is where all Xamarin investigation will be done.
Most helpful comment
That might work as an interim solution before the GoogleWebAuthorizationBroker starts working (fingers crossed) on Xamarin or some other library gets added to Xamarin to handle this.
The user will share his calendar with the app and then they will be able to handle entries inside the app and sync it across platforms.
Thanks for your effort!