2016-05-02 09:52:09 +03:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using XLabs.Ioc;
|
|
|
|
|
using XLabs.Ioc.Unity;
|
|
|
|
|
|
|
|
|
|
using Foundation;
|
|
|
|
|
using UIKit;
|
|
|
|
|
using Bit.App.Abstractions;
|
|
|
|
|
using Bit.App.Services;
|
|
|
|
|
using Microsoft.Practices.Unity;
|
|
|
|
|
using Bit.iOS.Services;
|
2016-05-03 09:08:50 +03:00
|
|
|
|
using Plugin.Connectivity;
|
|
|
|
|
using Acr.UserDialogs;
|
2016-05-06 07:17:38 +03:00
|
|
|
|
using Bit.App.Repositories;
|
2016-05-21 19:32:34 +03:00
|
|
|
|
using Plugin.Fingerprint;
|
|
|
|
|
using Plugin.Fingerprint.Abstractions;
|
|
|
|
|
using Plugin.Settings.Abstractions;
|
|
|
|
|
using System.Diagnostics;
|
|
|
|
|
using Xamarin.Forms;
|
2016-05-28 23:06:53 +03:00
|
|
|
|
using Bit.iOS.Core.Services;
|
2016-06-18 09:45:46 +03:00
|
|
|
|
using PushNotification.Plugin;
|
2016-06-22 05:29:29 +03:00
|
|
|
|
using Plugin.DeviceInfo;
|
2016-07-02 01:54:00 +03:00
|
|
|
|
using Plugin.Connectivity.Abstractions;
|
2016-07-05 06:11:44 +03:00
|
|
|
|
using Bit.App.Pages;
|
2016-07-20 01:46:39 +03:00
|
|
|
|
using PushNotification.Plugin.Abstractions;
|
2016-07-22 07:04:05 +03:00
|
|
|
|
using HockeyApp.iOS;
|
2016-07-23 00:55:11 +03:00
|
|
|
|
using Bit.iOS.Core;
|
2016-08-05 02:35:56 +03:00
|
|
|
|
using Google.Analytics;
|
2016-05-02 09:52:09 +03:00
|
|
|
|
|
|
|
|
|
namespace Bit.iOS
|
|
|
|
|
{
|
|
|
|
|
[Register("AppDelegate")]
|
|
|
|
|
public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
|
|
|
|
|
{
|
2016-08-05 02:35:56 +03:00
|
|
|
|
private GaiCompletionHandler _dispatchHandler = null;
|
|
|
|
|
|
2016-06-25 06:39:13 +03:00
|
|
|
|
public ISettings Settings { get; set; }
|
|
|
|
|
|
2016-05-02 09:52:09 +03:00
|
|
|
|
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
|
|
|
|
|
{
|
|
|
|
|
global::Xamarin.Forms.Forms.Init();
|
|
|
|
|
|
|
|
|
|
if(!Resolver.IsSet)
|
|
|
|
|
{
|
|
|
|
|
SetIoc();
|
|
|
|
|
}
|
|
|
|
|
|
2016-07-28 01:46:55 +03:00
|
|
|
|
var appIdService = Resolver.Resolve<IAppIdService>();
|
|
|
|
|
var crashManagerDelegate = new HockeyAppCrashManagerDelegate(
|
|
|
|
|
appIdService, Resolver.Resolve<IAuthService>());
|
2016-07-23 00:55:11 +03:00
|
|
|
|
var manager = BITHockeyManager.SharedHockeyManager;
|
|
|
|
|
manager.Configure("51f96ae568ba45f699a18ad9f63046c3", crashManagerDelegate);
|
2016-07-23 05:56:45 +03:00
|
|
|
|
manager.CrashManager.CrashManagerStatus = BITCrashManagerStatus.AutoSend;
|
2016-07-28 01:46:55 +03:00
|
|
|
|
manager.UserId = appIdService.AppId;
|
2016-07-23 00:55:11 +03:00
|
|
|
|
manager.StartManager();
|
|
|
|
|
manager.Authenticator.AuthenticateInstallation();
|
2016-08-14 07:15:47 +03:00
|
|
|
|
manager.DisableMetricsManager = manager.DisableFeedbackManager = manager.DisableUpdateManager = true;
|
2016-07-23 00:55:11 +03:00
|
|
|
|
|
2016-05-22 06:26:35 +03:00
|
|
|
|
LoadApplication(new App.App(
|
2016-05-21 19:32:34 +03:00
|
|
|
|
Resolver.Resolve<IAuthService>(),
|
2016-07-02 01:54:00 +03:00
|
|
|
|
Resolver.Resolve<IConnectivity>(),
|
|
|
|
|
Resolver.Resolve<IUserDialogs>(),
|
2016-05-21 19:32:34 +03:00
|
|
|
|
Resolver.Resolve<IDatabaseService>(),
|
2016-07-01 03:08:34 +03:00
|
|
|
|
Resolver.Resolve<ISyncService>(),
|
2016-05-21 19:32:34 +03:00
|
|
|
|
Resolver.Resolve<IFingerprint>(),
|
2016-07-20 01:46:39 +03:00
|
|
|
|
Resolver.Resolve<ISettings>(),
|
2016-08-04 07:06:09 +03:00
|
|
|
|
Resolver.Resolve<ILockService>(),
|
|
|
|
|
Resolver.Resolve<IGoogleAnalyticsService>()));
|
2016-05-02 09:52:09 +03:00
|
|
|
|
|
2016-07-12 06:55:16 +03:00
|
|
|
|
// Appearance stuff
|
|
|
|
|
|
|
|
|
|
var primaryColor = new UIColor(red: 0.24f, green: 0.55f, blue: 0.74f, alpha: 1.0f);
|
2016-07-13 01:59:09 +03:00
|
|
|
|
var grayLight = new UIColor(red: 0.47f, green: 0.47f, blue: 0.47f, alpha: 1.0f);
|
2016-07-12 06:55:16 +03:00
|
|
|
|
|
2016-06-14 07:19:18 +03:00
|
|
|
|
UINavigationBar.Appearance.ShadowImage = new UIImage();
|
|
|
|
|
UINavigationBar.Appearance.SetBackgroundImage(new UIImage(), UIBarMetrics.Default);
|
2016-07-12 06:55:16 +03:00
|
|
|
|
UIBarButtonItem.AppearanceWhenContainedIn(new Type[] { typeof(UISearchBar) }).TintColor = primaryColor;
|
2016-07-30 19:51:12 +03:00
|
|
|
|
UIButton.AppearanceWhenContainedIn(new Type[] { typeof(UISearchBar) }).SetTitleColor(primaryColor, UIControlState.Normal);
|
|
|
|
|
UIButton.AppearanceWhenContainedIn(new Type[] { typeof(UISearchBar) }).TintColor = primaryColor;
|
2016-07-13 01:59:09 +03:00
|
|
|
|
UIStepper.Appearance.TintColor = grayLight;
|
|
|
|
|
UISlider.Appearance.TintColor = primaryColor;
|
2016-06-14 07:19:18 +03:00
|
|
|
|
|
2016-07-05 06:11:44 +03:00
|
|
|
|
MessagingCenter.Subscribe<Xamarin.Forms.Application, ToolsExtensionPage>(Xamarin.Forms.Application.Current, "ShowAppExtension", (sender, page) =>
|
2016-07-02 22:20:06 +03:00
|
|
|
|
{
|
2016-07-27 05:28:02 +03:00
|
|
|
|
var itemProvider = new NSItemProvider(new NSDictionary(), iOS.Core.Constants.UTTypeAppExtensionSetup);
|
2016-07-02 22:20:06 +03:00
|
|
|
|
var extensionItem = new NSExtensionItem();
|
|
|
|
|
extensionItem.Attachments = new NSItemProvider[] { itemProvider };
|
|
|
|
|
var activityViewController = new UIActivityViewController(new NSExtensionItem[] { extensionItem }, null);
|
|
|
|
|
activityViewController.CompletionHandler = (activityType, completed) =>
|
|
|
|
|
{
|
2016-07-05 06:11:44 +03:00
|
|
|
|
page.EnabledExtension(completed && activityType == "com.8bit.bitwarden.find-login-action-extension");
|
2016-07-02 22:20:06 +03:00
|
|
|
|
};
|
|
|
|
|
|
2016-07-10 08:15:59 +03:00
|
|
|
|
var modal = UIApplication.SharedApplication.KeyWindow.RootViewController.ModalViewController;
|
|
|
|
|
if(activityViewController.PopoverPresentationController != null)
|
|
|
|
|
{
|
|
|
|
|
activityViewController.PopoverPresentationController.SourceView = modal.View;
|
|
|
|
|
var frame = UIScreen.MainScreen.Bounds;
|
|
|
|
|
frame.Height /= 2;
|
|
|
|
|
activityViewController.PopoverPresentationController.SourceRect = frame;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
modal.PresentViewController(activityViewController, true, null);
|
2016-07-02 22:20:06 +03:00
|
|
|
|
});
|
|
|
|
|
|
2016-07-23 22:32:11 +03:00
|
|
|
|
UIApplication.SharedApplication.StatusBarHidden = false;
|
|
|
|
|
UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.LightContent;
|
|
|
|
|
|
|
|
|
|
MessagingCenter.Subscribe<Xamarin.Forms.Application, bool>(Xamarin.Forms.Application.Current, "ShowStatusBar", (sender, show) =>
|
|
|
|
|
{
|
|
|
|
|
UIApplication.SharedApplication.SetStatusBarHidden(!show, false);
|
|
|
|
|
});
|
|
|
|
|
|
2016-05-02 09:52:09 +03:00
|
|
|
|
return base.FinishedLaunching(app, options);
|
|
|
|
|
}
|
|
|
|
|
|
2016-05-21 19:32:34 +03:00
|
|
|
|
public override void DidEnterBackground(UIApplication uiApplication)
|
|
|
|
|
{
|
2016-06-11 09:43:53 +03:00
|
|
|
|
var view = new UIView(UIApplication.SharedApplication.KeyWindow.Frame)
|
2016-05-21 19:32:34 +03:00
|
|
|
|
{
|
|
|
|
|
Tag = 4321
|
|
|
|
|
};
|
2016-06-11 09:43:53 +03:00
|
|
|
|
|
|
|
|
|
var backgroundView = new UIView(UIApplication.SharedApplication.KeyWindow.Frame)
|
|
|
|
|
{
|
2016-06-26 03:54:17 +03:00
|
|
|
|
BackgroundColor = new UIColor(red: 0.93f, green: 0.94f, blue: 0.96f, alpha: 1.0f)
|
2016-06-11 09:43:53 +03:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var imageView = new UIImageView(new UIImage("logo.png"))
|
|
|
|
|
{
|
2016-07-27 05:41:01 +03:00
|
|
|
|
Center = new CoreGraphics.CGPoint(view.Center.X, view.Center.Y - 30)
|
2016-06-11 09:43:53 +03:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
view.AddSubview(backgroundView);
|
|
|
|
|
view.AddSubview(imageView);
|
|
|
|
|
|
|
|
|
|
UIApplication.SharedApplication.KeyWindow.AddSubview(view);
|
|
|
|
|
UIApplication.SharedApplication.KeyWindow.BringSubviewToFront(view);
|
|
|
|
|
UIApplication.SharedApplication.KeyWindow.EndEditing(true);
|
2016-07-24 06:50:08 +03:00
|
|
|
|
UIApplication.SharedApplication.SetStatusBarHidden(true, false);
|
2016-05-22 05:50:15 +03:00
|
|
|
|
|
|
|
|
|
// Log the date/time we last backgrounded
|
2016-08-09 02:00:36 +03:00
|
|
|
|
Settings.AddOrUpdateValue(App.Constants.LastActivityDate, DateTime.UtcNow);
|
2016-06-25 06:39:13 +03:00
|
|
|
|
|
2016-08-05 02:35:56 +03:00
|
|
|
|
// Dispatch Google Analytics
|
|
|
|
|
SendGoogleAnalyticsHitsInBackground();
|
2016-05-21 19:32:34 +03:00
|
|
|
|
|
|
|
|
|
base.DidEnterBackground(uiApplication);
|
|
|
|
|
Debug.WriteLine("DidEnterBackground");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public override void OnResignActivation(UIApplication uiApplication)
|
|
|
|
|
{
|
|
|
|
|
base.OnResignActivation(uiApplication);
|
|
|
|
|
Debug.WriteLine("OnResignActivation");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void WillTerminate(UIApplication uiApplication)
|
|
|
|
|
{
|
|
|
|
|
base.WillTerminate(uiApplication);
|
|
|
|
|
Debug.WriteLine("WillTerminate");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void OnActivated(UIApplication uiApplication)
|
|
|
|
|
{
|
|
|
|
|
base.OnActivated(uiApplication);
|
|
|
|
|
Debug.WriteLine("OnActivated");
|
|
|
|
|
|
2016-07-23 22:09:00 +03:00
|
|
|
|
UIApplication.SharedApplication.ApplicationIconBadgeNumber = 0;
|
|
|
|
|
|
2016-05-21 19:32:34 +03:00
|
|
|
|
var view = UIApplication.SharedApplication.KeyWindow.ViewWithTag(4321);
|
|
|
|
|
if(view != null)
|
|
|
|
|
{
|
|
|
|
|
view.RemoveFromSuperview();
|
2016-07-24 06:50:08 +03:00
|
|
|
|
UIApplication.SharedApplication.SetStatusBarHidden(false, false);
|
2016-05-21 19:32:34 +03:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void WillEnterForeground(UIApplication uiApplication)
|
|
|
|
|
{
|
2016-07-01 03:08:34 +03:00
|
|
|
|
SendResumedMessage();
|
2016-08-05 02:35:56 +03:00
|
|
|
|
|
|
|
|
|
// Restores the dispatch interval because dispatchWithCompletionHandler
|
|
|
|
|
// has disabled automatic dispatching.
|
|
|
|
|
Gai.SharedInstance.DispatchInterval = 10;
|
|
|
|
|
|
2016-05-21 19:32:34 +03:00
|
|
|
|
base.WillEnterForeground(uiApplication);
|
|
|
|
|
Debug.WriteLine("WillEnterForeground");
|
|
|
|
|
}
|
|
|
|
|
|
2016-05-30 10:08:12 +03:00
|
|
|
|
public override bool OpenUrl(UIApplication application, NSUrl url, string sourceApplication, NSObject annotation)
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-18 09:45:46 +03:00
|
|
|
|
public override void FailedToRegisterForRemoteNotifications(UIApplication application, NSError error)
|
|
|
|
|
{
|
|
|
|
|
if(CrossPushNotification.Current is IPushNotificationHandler)
|
|
|
|
|
{
|
|
|
|
|
((IPushNotificationHandler)CrossPushNotification.Current).OnErrorReceived(error);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void RegisteredForRemoteNotifications(UIApplication application, NSData deviceToken)
|
|
|
|
|
{
|
|
|
|
|
if(CrossPushNotification.Current is IPushNotificationHandler)
|
|
|
|
|
{
|
|
|
|
|
((IPushNotificationHandler)CrossPushNotification.Current).OnRegisteredSuccess(deviceToken);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void DidRegisterUserNotificationSettings(UIApplication application, UIUserNotificationSettings notificationSettings)
|
|
|
|
|
{
|
|
|
|
|
application.RegisterForRemoteNotifications();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void DidReceiveRemoteNotification(UIApplication application, NSDictionary userInfo, Action<UIBackgroundFetchResult> completionHandler)
|
|
|
|
|
{
|
|
|
|
|
if(CrossPushNotification.Current is IPushNotificationHandler)
|
|
|
|
|
{
|
|
|
|
|
((IPushNotificationHandler)CrossPushNotification.Current).OnMessageReceived(userInfo);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void ReceivedRemoteNotification(UIApplication application, NSDictionary userInfo)
|
|
|
|
|
{
|
|
|
|
|
if(CrossPushNotification.Current is IPushNotificationHandler)
|
|
|
|
|
{
|
|
|
|
|
((IPushNotificationHandler)CrossPushNotification.Current).OnMessageReceived(userInfo);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-07-01 03:08:34 +03:00
|
|
|
|
private void SendResumedMessage()
|
2016-05-21 19:32:34 +03:00
|
|
|
|
{
|
2016-07-01 03:08:34 +03:00
|
|
|
|
MessagingCenter.Send(Xamarin.Forms.Application.Current, "Resumed", false);
|
2016-05-21 19:32:34 +03:00
|
|
|
|
}
|
|
|
|
|
|
2016-05-02 09:52:09 +03:00
|
|
|
|
private void SetIoc()
|
|
|
|
|
{
|
|
|
|
|
var container = new UnityContainer();
|
|
|
|
|
|
|
|
|
|
container
|
2016-05-06 07:17:38 +03:00
|
|
|
|
// Services
|
2016-05-02 09:52:09 +03:00
|
|
|
|
.RegisterType<IDatabaseService, DatabaseService>(new ContainerControlledLifetimeManager())
|
2016-05-06 07:17:38 +03:00
|
|
|
|
.RegisterType<ISqlService, SqlService>(new ContainerControlledLifetimeManager())
|
2016-05-02 09:52:09 +03:00
|
|
|
|
.RegisterType<ISecureStorageService, KeyChainStorageService>(new ContainerControlledLifetimeManager())
|
|
|
|
|
.RegisterType<ICryptoService, CryptoService>(new ContainerControlledLifetimeManager())
|
2016-08-02 03:23:46 +03:00
|
|
|
|
.RegisterType<IKeyDerivationService, CommonCryptoKeyDerivationService>(new ContainerControlledLifetimeManager())
|
2016-05-02 09:52:09 +03:00
|
|
|
|
.RegisterType<IAuthService, AuthService>(new ContainerControlledLifetimeManager())
|
|
|
|
|
.RegisterType<IFolderService, FolderService>(new ContainerControlledLifetimeManager())
|
2016-05-03 09:08:50 +03:00
|
|
|
|
.RegisterType<ISiteService, SiteService>(new ContainerControlledLifetimeManager())
|
2016-05-06 07:17:38 +03:00
|
|
|
|
.RegisterType<ISyncService, SyncService>(new ContainerControlledLifetimeManager())
|
2016-05-07 05:29:03 +03:00
|
|
|
|
.RegisterType<IClipboardService, ClipboardService>(new ContainerControlledLifetimeManager())
|
2016-06-18 09:45:46 +03:00
|
|
|
|
.RegisterType<IPushNotificationListener, PushNotificationListener>(new ContainerControlledLifetimeManager())
|
2016-06-22 05:29:29 +03:00
|
|
|
|
.RegisterType<IAppIdService, AppIdService>(new ContainerControlledLifetimeManager())
|
2016-07-02 09:01:47 +03:00
|
|
|
|
.RegisterType<IPasswordGenerationService, PasswordGenerationService>(new ContainerControlledLifetimeManager())
|
2016-07-03 09:57:09 +03:00
|
|
|
|
.RegisterType<IReflectionService, ReflectionService>(new ContainerControlledLifetimeManager())
|
2016-07-20 06:29:32 +03:00
|
|
|
|
.RegisterType<ILockService, LockService>(new ContainerControlledLifetimeManager())
|
2016-07-24 06:50:08 +03:00
|
|
|
|
.RegisterType<IAppInfoService, AppInfoService>(new ContainerControlledLifetimeManager())
|
2016-08-04 07:06:09 +03:00
|
|
|
|
.RegisterType<IGoogleAnalyticsService, GoogleAnalyticsService>(new ContainerControlledLifetimeManager())
|
2016-05-06 07:17:38 +03:00
|
|
|
|
// Repositories
|
|
|
|
|
.RegisterType<IFolderRepository, FolderRepository>(new ContainerControlledLifetimeManager())
|
|
|
|
|
.RegisterType<IFolderApiRepository, FolderApiRepository>(new ContainerControlledLifetimeManager())
|
|
|
|
|
.RegisterType<ISiteRepository, SiteRepository>(new ContainerControlledLifetimeManager())
|
|
|
|
|
.RegisterType<ISiteApiRepository, SiteApiRepository>(new ContainerControlledLifetimeManager())
|
|
|
|
|
.RegisterType<IAuthApiRepository, AuthApiRepository>(new ContainerControlledLifetimeManager())
|
2016-06-18 23:10:09 +03:00
|
|
|
|
.RegisterType<IDeviceApiRepository, DeviceApiRepository>(new ContainerControlledLifetimeManager())
|
2016-06-26 03:54:17 +03:00
|
|
|
|
.RegisterType<IAccountsApiRepository, AccountsApiRepository>(new ContainerControlledLifetimeManager())
|
2016-06-30 04:59:18 +03:00
|
|
|
|
.RegisterType<ICipherApiRepository, CipherApiRepository>(new ContainerControlledLifetimeManager())
|
2016-05-06 07:17:38 +03:00
|
|
|
|
// Other
|
2016-06-22 05:29:29 +03:00
|
|
|
|
.RegisterInstance(CrossDeviceInfo.Current, new ContainerControlledLifetimeManager())
|
2016-05-03 09:08:50 +03:00
|
|
|
|
.RegisterInstance(CrossConnectivity.Current, new ContainerControlledLifetimeManager())
|
2016-05-21 19:32:34 +03:00
|
|
|
|
.RegisterInstance(UserDialogs.Instance, new ContainerControlledLifetimeManager())
|
|
|
|
|
.RegisterInstance(CrossFingerprint.Current, new ContainerControlledLifetimeManager());
|
2016-05-02 09:52:09 +03:00
|
|
|
|
|
2016-06-25 06:39:13 +03:00
|
|
|
|
Settings = new Settings("group.com.8bit.bitwarden");
|
|
|
|
|
container.RegisterInstance(Settings, new ContainerControlledLifetimeManager());
|
|
|
|
|
|
2016-06-18 09:45:46 +03:00
|
|
|
|
CrossPushNotification.Initialize(container.Resolve<IPushNotificationListener>());
|
|
|
|
|
container.RegisterInstance(CrossPushNotification.Current, new ContainerControlledLifetimeManager());
|
|
|
|
|
|
2016-05-02 09:52:09 +03:00
|
|
|
|
Resolver.SetResolver(new UnityResolver(container));
|
|
|
|
|
}
|
2016-08-05 02:35:56 +03:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// This method sends any queued hits when the app enters the background.
|
|
|
|
|
/// ref: https://developers.google.com/analytics/devguides/collection/ios/v3/dispatch
|
|
|
|
|
/// </summary>
|
|
|
|
|
private void SendGoogleAnalyticsHitsInBackground()
|
|
|
|
|
{
|
|
|
|
|
var taskExpired = false;
|
|
|
|
|
var taskId = UIApplication.SharedApplication.BeginBackgroundTask(() =>
|
|
|
|
|
{
|
|
|
|
|
taskExpired = true;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if(taskId == UIApplication.BackgroundTaskInvalid)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_dispatchHandler = (result) =>
|
|
|
|
|
{
|
|
|
|
|
// Send hits until no hits are left, a dispatch error occurs, or the background task expires.
|
|
|
|
|
if(_dispatchHandler != null && result == DispatchResult.Good && !taskExpired)
|
|
|
|
|
{
|
|
|
|
|
Gai.SharedInstance.Dispatch(_dispatchHandler);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
UIApplication.SharedApplication.EndBackgroundTask(taskId);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Gai.SharedInstance.Dispatch(_dispatchHandler);
|
|
|
|
|
}
|
2016-05-02 09:52:09 +03:00
|
|
|
|
}
|
|
|
|
|
}
|