コード例 #1
0
        /// <summary>
        /// Allow the app to access the list of calls,  by UUID
        /// </summary>
        /// <param name="callManager"></param>
        public ProviderDelegate(ActiveCallManager callManager)
        {
            // Save connection to call manager
            CallManager = callManager;

            // Define handle types
            var handleTypes = new[] { (NSNumber)(int)CXHandleType.PhoneNumber };

            // Get Image Mask
            var maskImage = UIImage.FromFile("telephone_receiver.png");

            // Setup the initial configurations
            Configuration = new CXProviderConfiguration(localizedName: "MonkeyCall")
            {
                MaximumCallsPerCallGroup = 1,
                SupportedHandleTypes     = new NSSet <NSNumber>(handleTypes),
                //IconMaskImageData = maskImage.AsPNG(),
                RingtoneSound = "musicloop01.wav",

                //MaximumCallGroups = 3,
                //SupportsVideo = false
            };


            // TODO: WWDC 2016 11:12
            //if (CXProvider.authorization = Notddetermiened )
            // provider.requestAuthorization

            // Create a new provider
            Provider = new CXProvider(Configuration);

            // Attach this delegate
            Provider.SetDelegate(this, null);
        }
コード例 #2
0
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            // Override point for customization after application launch.
            // If not required for your application you can safely delete this method

            // Code to start the Xamarin Test Cloud Agent
#if ENABLE_TEST_CLOUD
            //	Xamarin.Calabash.Start();
#endif


            Console.WriteLine("Twilio Voice Version: " + TwilioVoice.SharedInstance.Version);

            NSDictionary appearanceProxy1 = GetNSDictionary(new Dictionary <string, object> {
                { RoundedButtonAppearanceKeys.CornerRadius, 40 },
                { RoundedButtonAppearanceKeys.BorderWidth, 2 },
                { RoundedButtonAppearanceKeys.BorderColor, UIColor.Clear },
                { RoundedButtonAppearanceKeys.ContentColor, UIColor.Black },
                { RoundedButtonAppearanceKeys.ContentAnimateToColor, UIColor.White },
                { RoundedButtonAppearanceKeys.ForegroundColor, UIColor.White },
                { RoundedButtonAppearanceKeys.ForegroundAnimateToColor, UIColor.Clear }
            });
            RoundedButtonAppearanceManager.RegisterAppearanceProxy(appearanceProxy1, "1");


            // Initialize the call handlers
            CallManager          = new ActiveCallManager();
            CallProviderDelegate = new ProviderDelegate(CallManager);

            SharedAppInstance = this;

            return(true);
        }