Ejemplo n.º 1
0
 /// <summary>
 /// Get a short url with specified tags, params, channel, feature, stage, and match duration.
 /// </summary>
 /// <param name="callback">The callback that is called once the request has completed.</param>
 /// <param name="parameters">Dictionary of parameters to include in the link.</param>
 /// <param name="channel">The channel for the link. Examples could be Facebook, Twitter, SMS, etc.</param>
 /// <param name="stage">The stage used for the generated link, indicating what part of a funnel the user is in.</param>
 /// <param name="tags">An array of tags to associate with this link, useful for tracking.</param>
 /// <param name="feature">The feature this is utilizing. Examples could be Sharing, Referring, Inviting, etc.</param>
 /// <param name="duration">How long to keep an unmatched link click in the Branch backend server's queue before discarding.</param>
 abstract public void GetShortUrl(IBranchUrlInterface callback,
                                  Dictionary <String, dynamic> parameters = null,
                                  string channel            = "",
                                  string stage              = "",
                                  ICollection <String> tags = null,
                                  string feature            = "",
                                  int duration              = 0);
Ejemplo n.º 2
0
 /// <summary>
 /// Get a short url with specified tags, params, channel, feature, stage, and type.
 /// </summary>
 /// <param name="callback">The callback that is called once the request has completed.</param>
 /// <param name="type">The type of link this is, one of Single Use or Unlimited Use. Single use means once *per user*, not once period.</param>
 /// <param name="parameters">Dictionary of parameters to include in the link.</param>
 /// <param name="channel">The channel for the link. Examples could be Facebook, Twitter, SMS, etc.</param>
 /// <param name="stage">The stage used for the generated link, indicating what part of a funnel the user is in.</param>
 /// <param name="tags">An array of tags to associate with this link, useful for tracking.</param>
 /// <param name="feature">The feature this is utilizing. Examples could be Sharing, Referring, Inviting, etc.</param>
 abstract public void GetShortUrl(IBranchUrlInterface callback,
                                  int type = Constants.URL_TYPE_UNLIMITED,
                                  Dictionary <String, dynamic> parameters = null,
                                  string channel            = "",
                                  string stage              = "",
                                  ICollection <String> tags = null,
                                  string feature            = "");
Ejemplo n.º 3
0
        public override void GetShortURL(IBranchUrlInterface callback,
                                         BranchUniversalObject universalObject,
                                         BranchLinkProperties linkProperties)
        {
            BranchUrlListener obj = new BranchUrlListener(callback);

            callbacksList.Add(obj as Object);

            IO.Branch.Indexing.BranchUniversalObject resBuo =
                IO.Branch.Indexing.BranchUniversalObject.CreateInstance(BranchAndroidUtils.ToJSONObject(universalObject.ToDictionary()));

            IO.Branch.Referral.Util.LinkProperties resBlp =
                new IO.Branch.Referral.Util.LinkProperties();

            foreach (string tag in linkProperties.tags)
            {
                resBlp.AddTag(tag);
            }

            foreach (string key in linkProperties.controlParams.Keys)
            {
                resBlp.AddControlParameter(key, linkProperties.controlParams[key]);
            }

            resBlp.SetAlias(linkProperties.alias);
            resBlp.SetChannel(linkProperties.channel);
            resBlp.SetDuration(linkProperties.matchDuration);
            resBlp.SetFeature(linkProperties.feature);
            resBlp.SetStage(linkProperties.stage);

            resBuo.GenerateShortUrl(appContext, resBlp, obj);
        }
Ejemplo n.º 4
0
        public override void GetShortURL(IBranchUrlInterface callback,
                                         BranchUniversalObject universalObject,
                                         BranchLinkProperties linkProperties)
        {
            BranchUrlListener obj = new BranchUrlListener(callback);

            callbacksList.Add(obj as Object);

            IO.Branch.Indexing.BranchUniversalObject resBuo = BranchAndroidUtils.ToNativeBUO(universalObject);
            IO.Branch.Referral.Util.LinkProperties   resBlp = BranchAndroidUtils.ToNativeBLP(linkProperties);

            resBuo.GenerateShortUrl(appContext, resBlp, obj);
        }
Ejemplo n.º 5
0
        public override void GetShortURL(IBranchUrlInterface callback,
                                         BranchUniversalObject universalObject,
                                         BranchLinkProperties linkProperties)
        {
            BranchUrlListener obj = new BranchUrlListener(callback);

            callbacksList.Add(obj as Object);

            IOSNativeBranch.BranchUniversalObject buo = BranchIOSUtils.ToNativeUniversalObject(universalObject);
            IOSNativeBranch.BranchLinkProperties  blp = BranchIOSUtils.ToNativeLinkProperties(linkProperties);

            buo.GetShortUrlWithLinkProperties(blp, obj.GetShortUrlCallback);
        }
Ejemplo n.º 6
0
        public override void GetShortUrl(IBranchUrlInterface callback,
                                         int type = Constants.URL_TYPE_UNLIMITED,
                                         Dictionary <String, dynamic> parameters = null,
                                         string channel            = "",
                                         string stage              = "",
                                         ICollection <String> tags = null,
                                         string feature            = "")
        {
            BranchUrlListener obj = new BranchUrlListener(callback);

            callbacksList.Add(obj as Object);

            NativeBranch.GetShortUrl(type, tags, channel, feature, stage, BranchAndroidUtils.ToJSONObject(parameters), obj);
        }
Ejemplo n.º 7
0
        public override void GetShortUrl(IBranchUrlInterface callback,
                                         Dictionary <String, dynamic> parameters = null,
                                         string channel            = "",
                                         string stage              = "",
                                         ICollection <String> tags = null,
                                         string feature            = "",
                                         int duration              = 0)
        {
            BranchUrlListener obj = new BranchUrlListener(callback);

            callbacksList.Add(obj as Object);

            NativeBranch.GetShortUrlWithParams(BranchIOSUtils.ToNSDictionary(parameters),
                                               BranchIOSUtils.ToNSObjectArray(tags), "", (nuint)duration, channel, feature, stage, obj.GetShortUrlCallback);
        }
Ejemplo n.º 8
0
        public override void GetShortUrl(IBranchUrlInterface callback,
                                         int type = Constants.URL_TYPE_UNLIMITED,
                                         Dictionary <String, dynamic> parameters = null,
                                         string channel            = "",
                                         string stage              = "",
                                         ICollection <String> tags = null,
                                         string feature            = "")
        {
            BranchUrlListener obj = new BranchUrlListener(callback);

            callbacksList.Add(obj as Object);

            NativeBranch.GetShortURLWithParams(BranchIOSUtils.ToNSDictionary(parameters),
                                               BranchIOSUtils.ToNSObjectArray(tags), channel, feature, stage,
                                               (IOSNativeBranch.BranchLinkType)type, obj.GetShortUrlCallback);
        }
Ejemplo n.º 9
0
 /// <summary>
 /// Get a short url with specified universal object and link properties.
 /// </summary>
 /// <param name="callback">The callback that is called once the request has completed.</param>
 /// <param name="universalObject">Universal object.</param>
 /// <param name="linkProperties">Link properties.</param>
 abstract public void GetShortURL(IBranchUrlInterface callback,
                                  BranchUniversalObject universalObject,
                                  BranchLinkProperties linkProperties);
Ejemplo n.º 10
0
 public BranchUrlListener(IBranchUrlInterface callback)
 {
     this.callback = callback;
 }