forked from microsoft/app-innovation-workshop
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainActivity.cs
More file actions
72 lines (62 loc) · 2.89 KB
/
MainActivity.cs
File metadata and controls
72 lines (62 loc) · 2.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
using Android.App;
using Android.Content;
using Android.Content.PM;
using Android.OS;
using Android.Runtime;
using CarouselView.FormsPlugin.Android;
using ContosoFieldService.Services;
using FFImageLoading.Forms.Platform;
using Firebase;
using Lottie.Forms.Droid;
using Microsoft.AppCenter.Push;
using Microsoft.Identity.Client;
using Xamarin;
using Xamarin.Forms.Platform.Android.AppLinks;
namespace ContosoFieldService.Droid
{
[Activity(
Label = "Contoso",
Icon = "@mipmap/icon",
RoundIcon = "@mipmap/icon_round",
Theme = "@style/MyTheme",
MainLauncher = true,
ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation,
ResizeableActivity = true)]
[IntentFilter(new[] { Intent.ActionView }, Categories = new[] { Intent.CategoryBrowsable, Intent.CategoryDefault }, DataScheme = "http", DataHost = "contosomaintenance.azurewebsites.net", DataPathPrefix = "/part/")]
[IntentFilter(new[] { Intent.ActionView }, Categories = new[] { Intent.CategoryBrowsable, Intent.CategoryDefault }, DataScheme = "https", DataHost = "contosomaintenance.azurewebsites.net", DataPathPrefix = "/part/")]
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
{
protected override void OnCreate(Bundle bundle)
{
TabLayoutResource = Resource.Layout.Tabbar;
ToolbarResource = Resource.Layout.Toolbar;
base.OnCreate(bundle);
// Use Android Fast Renderers
Xamarin.Forms.Forms.SetFlags("FastRenderers_Experimental");
global::Xamarin.Forms.Forms.Init(this, bundle);
CachedImageRenderer.Init(false);
AnimationViewRenderer.Init();
FormsMaps.Init(this, bundle);
CarouselViewRenderer.Init();
Xamarin.Essentials.Platform.Init(this, bundle);
// Configure App Center Push
//Push.SetSenderId("597659151602");
// Initialize App Indexing and Deep Links
FirebaseApp.InitializeApp(this);
AndroidAppLinks.Init(this);
// Configure Authentication
AuthenticationService.UIParent = new UIParent(this);
LoadApplication(new App());
}
public override void OnRequestPermissionsResult(int requestCode, string[] permissions, [GeneratedEnum] Android.Content.PM.Permission[] grantResults)
{
Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults);
base.OnRequestPermissionsResult(requestCode, permissions, grantResults);
}
protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)
{
base.OnActivityResult(requestCode, resultCode, data);
AuthenticationContinuationHelper.SetAuthenticationContinuationEventArgs(requestCode, resultCode, data);
}
}
}