Permalink
Browse files

Add Firebase Analytics to iOS app.

  • Loading branch information...
ilanolkies committed May 31, 2018
1 parent 5dd09c2 commit f4f297fc3a8fae2536979c58699f872fac595af5
Showing with 56 additions and 11 deletions.
  1. +9 −10 GAExample.iOS/AppDelegate.cs
  2. +7 −1 GAExample.iOS/GAExample.iOS.csproj
  3. +40 −0 GAExample.iOS/GoogleService-Info.plist
@@ -1,16 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;

using Foundation;
using Foundation;
using UIKit;

namespace GAExample.iOS
{
// The UIApplicationDelegate for the application. This class is responsible for launching the
// User Interface of the application, as well as listening (and optionally responding) to
// application events from iOS.
[Register("AppDelegate")]
// The UIApplicationDelegate for the application. This class is responsible for launching the
// User Interface of the application, as well as listening (and optionally responding) to
// application events from iOS.
[Register("AppDelegate")]
public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
{
//
@@ -22,9 +18,12 @@ public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsAppli
//
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
global::Xamarin.Forms.Forms.Init();
global::Xamarin.Forms.Forms.Init();
LoadApplication(new App());

Firebase.Core.App.Configure();
Firebase.Analytics.Analytics.LogEvent("app_open", null);

return base.FinishedLaunching(app, options);
}
}
@@ -27,6 +27,7 @@
<MtouchArch>x86_64</MtouchArch>
<MtouchLink>None</MtouchLink>
<MtouchDebug>true</MtouchDebug>
<MtouchExtraArgs>--registrar:static</MtouchExtraArgs>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
<DebugType>none</DebugType>
@@ -37,6 +38,7 @@
<MtouchLink>None</MtouchLink>
<MtouchArch>x86_64</MtouchArch>
<ConsolePause>false</ConsolePause>
<MtouchExtraArgs>--registrar:static</MtouchExtraArgs>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
<DebugSymbols>true</DebugSymbols>
@@ -90,10 +92,10 @@
</PropertyGroup>
<ItemGroup>
<Compile Include="Main.cs" />
<Compile Include="AppDelegate.cs" />
<None Include="Entitlements.plist" />
<None Include="Info.plist" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="AppDelegate.cs" />
</ItemGroup>
<ItemGroup>
<InterfaceDefinition Include="Resources\LaunchScreen.storyboard" />
@@ -150,6 +152,9 @@
<PackageReference Include="Xamarin.Forms">
<Version>3.0.0.482510</Version>
</PackageReference>
<PackageReference Include="Xamarin.Firebase.iOS.Analytics">
<Version>4.0.5.1</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
<ItemGroup>
@@ -160,5 +165,6 @@
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\events.png" />
<BundleResource Include="GoogleService-Info.plist" />
</ItemGroup>
</Project>
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AD_UNIT_ID_FOR_BANNER_TEST</key>
<string>ca-app-pub-3940256099942544/2934735716</string>
<key>AD_UNIT_ID_FOR_INTERSTITIAL_TEST</key>
<string>ca-app-pub-3940256099942544/4411468910</string>
<key>CLIENT_ID</key>
<string>508995298724-ukm9m485qj7csmuiku2iag4amo5n051l.apps.googleusercontent.com</string>
<key>REVERSED_CLIENT_ID</key>
<string>com.googleusercontent.apps.508995298724-ukm9m485qj7csmuiku2iag4amo5n051l</string>
<key>API_KEY</key>
<string>AIzaSyCTj6tMt0sfTmOxw83CgFMfHOdsT4bhkQM</string>
<key>GCM_SENDER_ID</key>
<string>508995298724</string>
<key>PLIST_VERSION</key>
<string>1</string>
<key>BUNDLE_ID</key>
<string>com.ilanolkies.GAExample</string>
<key>PROJECT_ID</key>
<string>xamarin-example-19586</string>
<key>STORAGE_BUCKET</key>
<string>xamarin-example-19586.appspot.com</string>
<key>IS_ADS_ENABLED</key>
<true/>
<key>IS_ANALYTICS_ENABLED</key>
<true/>
<key>IS_APPINVITE_ENABLED</key>
<false/>
<key>IS_GCM_ENABLED</key>
<true/>
<key>IS_SIGNIN_ENABLED</key>
<true/>
<key>GOOGLE_APP_ID</key>
<string>1:508995298724:ios:8f0beab4bafb48a0</string>
<key>DATABASE_URL</key>
<string>https://xamarin-example-19586.firebaseio.com</string>
</dict>
</plist>

0 comments on commit f4f297f

Please sign in to comment.