2015-10-30 93 views
7

嗨,我们正在开发Xamarin应用程序,我们希望监视有多少人从我们的推荐ID安装应用程序。我可以在哪里添加google-services.json在xamarin应用程序

我找到这份文件https://developers.google.com/analytics/devguides/collection/android/v4/ 它说:“将刚刚下载的google-services.json文件复制到您的Android Studio项目的应用程序/或移动/目录中。”。

我有Visual Studio(2013)项目,当然这些文件夹丢失。问题是,我在Visual Studio项目中添加google-services.json文件?

在此先感谢

+0

现在有文件,在“添加谷歌服务JSON文件”,https://developer.xamarin.com/guides/android/application_fundamentals/notifications/remote-notifications- with-fcm /。 –

回答

-1

我不相信文件是necessary对Xamarin项目。

+0

谢谢,真的不需要该文件... :) – puko

+4

这可能是一次真实的,它不再是真的。 –

+0

对,对不起!不得不倒退,因为它不再相关。 –

8

我不知道什么时候它变得有必要,但正如我发布(2017年5月),这是必要的。我将它放在我的Android .csproj文件所在的目录中。然后我将它添加到项目中,并确保Xamarin.GooglePlayServices.Base.targets在我的.csproj中。我读到重建将足以让正确的构建行为出现,但构建和重新启动XS对我来说是什么。最终的结果在我的.csproj是这样的:

<ItemGroup> 
    <GoogleServicesJson Include="google-services.json" /> 
</ItemGroup> 
+0

这取决于您使用的Xamarin.GooglePlayServices的版本。例如在29.0.2中,GoogleServicesJson任务不存在。只有在更新的版本中。 – jzeferino

+0

嗨,是否有可能通过'.csproj'中的'Condition'语句使用多个'GoogleServicesJson'' ItemGroup'? – david

相关问题