Пример #1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            Console.WriteLine("MainActivity: OnCreate() !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");

            // Replace font with our own
            TypefaceUtil.SetDefaultFont(this.ApplicationContext, "MONOSPACE", "fonts/Lato-Regular.ttf");

            global::Xamarin.Forms.Forms.Init(this, bundle);
            global::Xamarin.FormsMaps.Init(this, bundle);
            Refractored.XamForms.PullToRefresh.Droid.PullToRefreshLayoutRenderer.Init();
            RoundedBoxView.Forms.Plugin.Droid.RoundedBoxViewRenderer.Init();

            // init Branch
            BranchAndroid.Init(this, "key_live_iebJ0jOkqjzp4Co7nYiEAhlbEDolNjJe", Intent.Data);

            The = this;
            initializeTheApp();

            try
            {
                // Start the registration intent service; try to get a token:
                var intent = new Intent(this, typeof(RegistrationIntentService));
                StartService(intent);
            }
            catch (Exception) {
            }

            LoadApplication(new Awpbs.Mobile.App());
        }
Пример #2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);
            BranchAndroid.GetAutoInstance(this.ApplicationContext);
            BranchAndroid.Init(this, "Branch key", this);
        }
Пример #3
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.SplashScreen);
            splashLAyout = FindViewById <RelativeLayout>(Resource.Id.SplashLayout);
            BranchAndroid.Init(this, "Android_Live_Key", this);
            Handler handler = new Handler();

            handler.PostDelayed(CallMainActivity, SPLASH_TIME_OUT);
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);

            //App app = new App ();
            //BranchAndroid.Init (this, GetString(Resource.String.branch_key), app);
            //LoadApplication (app);

            // uncomment to try BranchUniversalObject
            AppBUO appBUO = new AppBUO();

            BranchAndroid.Init(this, GetString(Resource.String.branch_key), appBUO);
            LoadApplication(appBUO);
        }
Пример #5
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);

            BranchAndroid.Debug = true;

            App app = new App();

            BranchAndroid.Init(this, "key_live_ldiGkEEvtTY7EUAc3vmochkmFvpL178f", app);
            LoadApplication(app);

            // uncomment to try BranchUniversalObject
//			AppBUO appBUO = new AppBUO ();
//			BranchAndroid.Init (this, "Your Branch key here", appBUO);
//			LoadApplication (appBUO);
        }
Пример #6
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);

            TestXamarinFormsAppBUO linkData = new TestXamarinFormsAppBUO();

            BranchAndroid.Init(this, GetString(Resource.String.branch_key), linkData);
            LoadApplication(linkData);

            // latest
            System.Collections.Generic.Dictionary <string, object> sessionParams = Branch.GetInstance().GetLastReferringParams();

            // first
            System.Collections.Generic.Dictionary <string, object> installParams = Branch.GetInstance().GetFirstReferringParams();
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);

            //App app = new App ();
            //BranchAndroid.Init (this, GetString(Resource.String.branch_key), app);
            //LoadApplication (app);

            // uncomment to try BranchUniversalObject
            AppBUO appBUO = new AppBUO();

            BranchAndroid.Init(this, GetString(Resource.String.branch_key), appBUO);

            // enable tracking of user data
            BranchAndroid.getInstance().SetTrackingDisabled(false);

            LoadApplication(appBUO);
        }
Пример #8
0
        protected override async void OnCreate(Bundle savedInstanceState)
        {
            RequestWindowFeature(WindowFeatures.NoTitle);

            base.OnCreate(savedInstanceState);
            //SetContentView(Resource.Layout.FirstRun);
            SetContentView(Resource.Layout.ConnectionChecklist);

            BranchAndroid.Init(this, Resources.GetString(Resource.String.BRANCHKEY), this);

            IsPlayServicesAvailable();

            var allprefs = GetSharedPreferences(WhiteLabelConfig.BUILD_VARIANT.ToLower(), FileCreationMode.Private);


            if (WhiteLabelConfig.LOCAL_SERVER)
            {
                Uri connectionuri = new Uri("http://10.10.10.1");
                Bootlegger.BootleggerClient.StartWithLocal(connectionuri);
            }

            var firstrun = true;

            var prefs = allprefs.GetBoolean("firstrun", false);

            firstrun = prefs;

            //detect wanting to go straight to uploads
            if (Intent.Extras != null && Intent.Extras.ContainsKey("upload"))
            {
                (Application as BootleggerApp).ReturnState = new BootleggerApp.ApplicationReturnState()
                {
                    ReturnsTo = BootleggerApp.ReturnType.OPEN_UPLOAD, Payload = Intent.Extras.GetString("eventid")
                };
                firstrun = true;
            }

            if (Intent.Extras != null && Intent.Extras.ContainsKey("advert"))
            {
                (Application as BootleggerApp).ADVERT = Intent.Extras.GetString("advert");
                firstrun = true;
            }
            else
            {
                (Application as BootleggerApp).ADVERT = "";
            }

            //detect login intent:
            //Console.WriteLine(Intent.Data?.Scheme);
            //Console.WriteLine(Intent.Data?.Host);

            if (Intent.Data != null && Intent.Data.Scheme == WhiteLabelConfig.DATASCHEME && Intent.Data.Host != "open")
            {
                var url = Intent.Data;

                if (!url.QueryParameterNames.Contains("eventid"))
                {
                    var session = url.Query;
                    session = session.TrimEnd('=');

                    //(Application as BootleggerApp).loginsession = HttpUtility.UrlEncode(session);

                    (Application as BootleggerApp).ReturnState.Session = HttpUtility.UrlEncode(session);
                    var returnstate = (Application as BootleggerApp).ReturnState;
                    //(Application as BootleggerApp).ReturnState = new BootleggerApp.ApplicationReturnState() { ReturnsTo = BootleggerApp.ReturnType.SIGN_IN_ONLY, Session = HttpUtility.UrlEncode(session) };

                    firstrun = true;
                }
                else
                {
                    //if its a create new shoot connect:
                    var eventid = url.GetQueryParameter("eventid");
                    (Application as BootleggerApp).ReturnState = new BootleggerApp.ApplicationReturnState()
                    {
                        ReturnsTo = BootleggerApp.ReturnType.OPEN_SHOOT, Payload = eventid
                    };
                }
            }

            //edit invite:
            if (Intent.Data != null && Intent.Data.Host == WhiteLabelConfig.SERVERHOST && Intent.Data.PathSegments.Contains("watch"))
            {
                var editid = Intent.Data.PathSegments.Last();
                (Application as BootleggerApp).ReturnState = new BootleggerApp.ApplicationReturnState()
                {
                    ReturnsTo = BootleggerApp.ReturnType.OPEN_EDIT, Payload = editid
                };
            }

            string state = Android.OS.Environment.ExternalStorageState;

            if (state != Android.OS.Environment.MediaMounted)
            {
                AlertDialog.Builder builder = new AlertDialog.Builder(this);
                builder.SetMessage(Resource.String.nostorageavail);
                builder.SetNeutralButton(Android.Resource.String.Ok, new EventHandler <DialogClickEventArgs>((o, q) =>
                {
                    Finish();
                }));
                builder.SetCancelable(false);
                builder.Show();
            }
            else
            {
                (Application as BootleggerApp).Start();
                Bootlegger.BootleggerClient.OnSessionLost += Comms_OnSessionLost;

                //check for firstrun:
                if (!firstrun && Bootlegger.BootleggerClient.CurrentUser == null && WhiteLabelConfig.ONBOARDING)
                {
                    FindViewById(Resource.Id.theroot).Visibility   = ViewStates.Visible;
                    FindViewById <Button>(Resource.Id.skip).Click += SplashActivity_Click;
                    FindViewById <Button>(Resource.Id.ok).Click   += OkActivity_Click;
                    FindViewById <Button>(Resource.Id.next).Click += NextActivity_Click;
                    var       mAdapter = new WizardPagerAdapter();
                    ViewPager mPager   = FindViewById <ViewPager>(Resource.Id.pager);
                    mPager.OffscreenPageLimit = 4;
                    //mPager.SetOnPageChangeListener(this);

                    mPager.Adapter       = mAdapter;
                    mPager.PageSelected += MPager_PageSelected;
                }
                else
                {
                    //StartActivity(typeof(Login));
                }
            }
        }
Пример #9
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            BranchAndroid.Init(this, BranchService.BranchKey, BranchService.Instance);
        }
Пример #10
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            BranchAndroid.Init(this, Resources.GetString(Resource.String.branch_key), this);
        }