public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
 {
     GDLibrary          = GDiOS.SharedInstance();
     GDLibrary.Delegate = this;
     GDLibrary.Authorize();
     Window = GDLibrary.GetWindow();
     Window.MakeKeyAndVisible();
     return(true);
 }
Пример #2
0
        private void OnRemoteSettingsUpdated()
        {
            NSDictionary settings = GDLibrary.GetApplicationConfig();

            NSString appConfig      = (NSString)settings.ValueForKey(GDiOS.GDAppConfigKeyConfig);
            NSNumber copyPasteOn    = (NSNumber)settings.ValueForKey(GDiOS.GDAppConfigKeyCopyPasteOn);
            NSNumber detailedLogsOn = (NSNumber)settings.ValueForKey(GDiOS.GDAppConfigKeyDetailedLogsOn);
            NSString userEmail      = (NSString)settings.ValueForKey(GDiOS.GDAppConfigKeyUserId);

            GDAppServer firstServer = null;
            NSArray     allServers  = (NSArray)settings.ValueForKey(GDiOS.GDAppConfigKeyServers);

            if (allServers != null && allServers.Count > 0)
            {
                firstServer = allServers.GetItem <GDAppServer> (0);
            }

            NSString server   = null;
            NSNumber port     = null;
            NSNumber priority = null;

            if (firstServer != null)
            {
                if (firstServer.Server != null)
                {
                    server = new NSString(firstServer.Server);
                    Console.Write(String.Format("Server Host: {0}", server));
                }
                if (firstServer.Port != null)
                {
                    port = firstServer.Port;
                    Console.WriteLine(String.Format("Server Port: {0}", port.NIntValue));
                }
                if (firstServer.Priority != null)
                {
                    priority = firstServer.Priority;
                    Console.WriteLine(String.Format("Server Priority: {0}", priority.NIntValue));
                }
            }

            bool result = StoreRemoteSettings(server, port, priority, appConfig, copyPasteOn, detailedLogsOn, userEmail);

            if (!result)
            {
                Console.WriteLine("Error storing settings");
            }

            ShowCurrentSettings();
        }
Пример #3
0
 public NSArray GetProvidersForService(NSString serviceId)
 {
     return(GDLibrary.GetServiceProviders(serviceId, null, GDServiceProviderType.GDServiceProviderApplication));
 }