public static DynamicLink.SocialMetaTagParameters ToNative(this SocialMetaTagParameters @this)
 {
     return(new DynamicLink.SocialMetaTagParameters.Builder()
            .SetTitle(@this.Title)
            .SetDescription(@this.DescriptionText)
            .SetImageUrl(@this.ImageUrl == null ? null : Uri.Parse(@this.ImageUrl))
            .Build());
 }
        public static DynamicLinkSocialMetaTagParameters ToNative(this SocialMetaTagParameters @this)
        {
            var parameters = new DynamicLinkSocialMetaTagParameters();

            parameters.Title           = @this.Title;
            parameters.DescriptionText = @this.DescriptionText;
            parameters.ImageUrl        = @this.ImageUrl == null ? null : NSUrl.FromString(@this.ImageUrl);
            return(parameters);
        }
Beispiel #3
0
        public void builds_long_dynamic_link()
        {
            var sut = CrossFirebaseDynamicLinks.Current;

            var iOSParameters = new iOSParameters(
                bundleId: "com.example.ios",
                appStoreId: "123456789",
                minimumAppVersion: "1.2.3");

            var androidParameters = new AndroidParameters(
                packageName: "com.example.android",
                minimumVersion: 123);

            var googleAnalyticsParameters = new GoogleAnalyticsParameters(
                source: "orkut",
                medium: "social",
                campaign: "example-promo");

            var itunesConnectAnalyticsParameters = new iTunesConnectAnalyticsParameters(
                providerToken: "123456",
                campaignToken: "example-promo");

            var socialMetaTagParameters = new SocialMetaTagParameters(
                title: "Example of dynamic link",
                descriptionText: "This link works whether the app is installed or not!",
                imageUrl: "https://www.example.com/my-image.jpg");

            var dynamicLink = sut
                              .CreateDynamicLink()
                              .SetLink("https://www.example.com/my-page")
                              .SetDomainUriPrefix("https://example.com/link")
                              .SetiOSParameters(iOSParameters)
                              .SetAndroidParameters(androidParameters)
                              .SetGoogleAnalyticsParameters(googleAnalyticsParameters)
                              .SetiTunesConnectAnalyticsParameters(itunesConnectAnalyticsParameters)
                              .SetSocialMetaTagParameters(socialMetaTagParameters)
                              .BuildDynamicLink();

            Assert.Equal(
                DeviceInfo.Platform == DevicePlatform.iOS
                    ? "https://example.com/link/?ibi=com.example.ios&utm_source=orkut&st=Example%20of%20dynamic%20link&amv=123&ct=example-promo&utm_medium=social&link=https:%2F%2Fwww.example.com%2Fmy-page&imv=1.2.3&utm_campaign=example-promo&isi=123456789&pt=123456&sd=This%20link%20works%20whether%20the%20app%20is%20installed%20or%20not!&si=https:%2F%2Fwww.example.com%2Fmy-image.jpg&apn=com.example.android"
                    : "https://example.com/link?utm_campaign=example-promo&ct=example-promo&pt=123456&sd=This%20link%20works%20whether%20the%20app%20is%20installed%20or%20not!&si=https%3A%2F%2Fwww.example.com%2Fmy-image.jpg&st=Example%20of%20dynamic%20link&amv=123&apn=com.example.android&ibi=com.example.ios&imv=1.2.3&isi=123456789&link=https%3A%2F%2Fwww.example.com%2Fmy-page&utm_medium=social&utm_source=orkut",
                dynamicLink.AbsoluteUri);
        }
Beispiel #4
0
 public IDynamicLinkBuilder SetSocialMetaTagParameters(SocialMetaTagParameters parameters)
 {
     _socialMetaTagParameters = parameters;
     return(this);
 }
Beispiel #5
0
 public IDynamicLinkBuilder SetSocialMetaTagParameters(SocialMetaTagParameters parameters)
 {
     _builder.SetSocialMetaTagParameters(parameters.ToNative());
     return(this);
 }
 public Builder()
 {
     param = new SocialMetaTagParameters();
 }
 public Builder SetSocialMetaTagParameters(SocialMetaTagParameters param)
 {
     link.socialMetaTagParams = param;
     return(this);
 }