void CreateLinkButton_Click(object sender, EventArgs e)
        {
            try
            {
                universalObject = new BranchUniversalObject();
                universalObject.canonicalIdentifier = "id12345";
                universalObject.title = "id12345 title";
                universalObject.contentDescription = "My awesome piece of content!";
                universalObject.imageUrl           = "https://s3-us-west-1.amazonaws.com/branchhost/mosaic_og.png";
                universalObject.metadata.Metadata.Add("foo", "bar");

                linkProperties = new BranchLinkProperties();
                linkProperties.tags.Add("tag1");
                linkProperties.tags.Add("tag2");
                linkProperties.feature = "sharing";
                linkProperties.channel = "facebook";
                linkProperties.controlParams.Add("$desktop_url", "http://example.com");

                BranchAndroid.GetInstance().GetShortURL(this, universalObject, linkProperties);
            }
            catch (Exception exc)
            {
                LogMessage(exc.ToString());
            }
        }
        void LastParamsButton_Click(object sender, EventArgs e)
        {
            logString  = BranchAndroid.GetInstance().GetLastReferringBranchUniversalObject().ToJsonString() + "\n\n";
            logString += BranchAndroid.GetInstance().GetLastReferringBranchLinkProperties().ToJsonString();

            TransitToLog();
        }
Beispiel #3
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());
        }
 void ContentAccessButton_Click(object sender, EventArgs e)
 {
     if (universalObject != null)
     {
         BranchAndroid.GetInstance().RegisterView(universalObject);
     }
 }
        void ShareButton_Click(object sender, EventArgs e)
        {
            try
            {
                if (universalObject == null)
                {
                    universalObject = new BranchUniversalObject();
                    universalObject.canonicalIdentifier = "id12345";
                    universalObject.title = "id12345 title";
                    universalObject.contentDescription = "My awesome piece of content!";
                    universalObject.imageUrl           = "https://s3-us-west-1.amazonaws.com/branchhost/mosaic_og.png";
                    universalObject.metadata.Metadata.Add("foo", "bar");
                }

                if (linkProperties == null)
                {
                    linkProperties = new BranchLinkProperties();
                    linkProperties.tags.Add("tag1");
                    linkProperties.tags.Add("tag2");
                    linkProperties.feature = "invite";
                    linkProperties.channel = "Twitter";
                    linkProperties.stage   = "2";
                    linkProperties.controlParams.Add("$desktop_url", "http://example.com");
                }

                BranchAndroid.GetInstance().ShareLink(this, universalObject, linkProperties, "hello there with short url");
            }
            catch (Exception exc)
            {
                LogMessage(exc.ToString());
            }
        }
 void SpotlightButton_Click(object sender, EventArgs e)
 {
     if (universalObject != null)
     {
         universalObject.metadata.Metadata.Add("deeplink_text", "This link was generated for Spotlight registration");
         BranchAndroid.GetInstance().ListOnSpotlight(universalObject);
     }
 }
Beispiel #7
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);
        }
Beispiel #8
0
        protected override void OnStart()
        {
            base.OnStart();

            BranchAndroid.GetAutoInstance(this);
            Branch branch = Branch.GetInstance();

            branch.InitSession(this);
        }
Beispiel #9
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);
        }
        void SendEventButton_Click(object sender, EventArgs e)
        {
            Dictionary <string, object> parameters = new Dictionary <string, object>();

            parameters.Add("name", "Alex");
            parameters.Add("boolean", true);
            parameters.Add("int", 1);
            parameters.Add("double", 0.13415512301);

            BranchAndroid.GetInstance().UserCompletedAction("buy", parameters);
            RefreshRewards();
        }
        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);
        }
Beispiel #12
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);
        }
        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);
        }
Beispiel #15
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            BranchAndroid.Init(this, Resources.GetString(Resource.String.branch_key), this);
        }
        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));
                }
            }
        }
Beispiel #17
0
 public override void OnCreate()
 {
     base.OnCreate();
     BranchAndroid.GetAutoInstance(this.ApplicationContext);
 }
Beispiel #18
0
 // Ensure we get the updated link identifier when the app is opened from the
 // background with a new link.
 protected override void OnNewIntent(Intent intent)
 {
     BranchAndroid.GetInstance().SetNewUrl(intent.Data);
 }
 public void RewardsRedeemed()
 {
     rewardText.Text = "Reward Points = " + BranchAndroid.GetInstance().GetCredits().ToString();
     LogMessage("Branch.loadRewards changed: " + BranchAndroid.GetInstance().GetCredits().ToString());
 }
 void RedeemButton_Click(object sender, EventArgs e)
 {
     BranchAndroid.GetInstance().RedeemRewards(this, 5);
 }
        private void RefreshRewards()
        {
            rewardText.Text = "Reward Points = " + "updating...";

            BranchAndroid.GetInstance().LoadRewards(this);
        }
 void BuyButton_Click(object sender, EventArgs e)
 {
     BranchAndroid.GetInstance().UserCompletedAction("buy");
     RefreshRewards();
 }
Beispiel #23
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            BranchAndroid.Init(this, BranchService.BranchKey, BranchService.Instance);
        }
 void LogoutButton_Click(object sender, EventArgs e)
 {
     BranchAndroid.GetInstance().Logout(this);
 }
 void SetUserButton_Click(object sender, EventArgs e)
 {
     BranchAndroid.GetInstance().SetIdentity("test_user_10", this);
 }
 void HistoryButton_Click(object sender, EventArgs e)
 {
     BranchAndroid.GetInstance().GetCreditHistory(this);
 }