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 LastParamsButton_Click(object sender, EventArgs e)
        {
            logString  = BranchAndroid.GetInstance().GetLastReferringBranchUniversalObject().ToJsonString() + "\n\n";
            logString += BranchAndroid.GetInstance().GetLastReferringBranchLinkProperties().ToJsonString();

            TransitToLog();
        }
        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 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);
     }
 }
        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();
        }
 public void RewardsRedeemed()
 {
     rewardText.Text = "Reward Points = " + BranchAndroid.GetInstance().GetCredits().ToString();
     LogMessage("Branch.loadRewards changed: " + BranchAndroid.GetInstance().GetCredits().ToString());
 }
 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);
 }
 void BuyButton_Click(object sender, EventArgs e)
 {
     BranchAndroid.GetInstance().UserCompletedAction("buy");
     RefreshRewards();
 }
 void RedeemButton_Click(object sender, EventArgs e)
 {
     BranchAndroid.GetInstance().RedeemRewards(this, 5);
 }
        private void RefreshRewards()
        {
            rewardText.Text = "Reward Points = " + "updating...";

            BranchAndroid.GetInstance().LoadRewards(this);
        }
예제 #14
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);
 }