Ejemplo n.º 1
0
        public AndroidJavaObject ToAjo()
        {
            var activityPostContentBuilderAjo = new AndroidJavaObject("im.getsocial.sdk.activities.ActivityPostContent$Builder");

            if (_text != null)
            {
                activityPostContentBuilderAjo.CallAJO("withText", _text);
            }
            if (_buttonTitle != null)
            {
                if (_buttonAction != null)
                {
                    activityPostContentBuilderAjo.CallAJO("withButton", _buttonTitle, _buttonAction);
                }
                if (_action != null)
                {
                    activityPostContentBuilderAjo.CallAJO("withButton", _buttonTitle, _action.ToAjo());
                }
            }
            if (_mediaAttachment != null)
            {
                activityPostContentBuilderAjo.CallAJO("withMediaAttachment", _mediaAttachment.ToAjo());
            }
            return(activityPostContentBuilderAjo.CallAJO("build"));
        }
        public AndroidJavaObject ToAjo()
        {
            var notificationContentClass =
                new AndroidJavaClass("im.getsocial.sdk.pushnotifications.NotificationContent");
            var notificationContent = notificationContentClass.CallStaticAJO("notificationWithText", _text)
                                      .CallAJO("withTitle", _title)
                                      .CallAJO("withTemplateName", _templateName)
                                      .CallAJO("addTemplatePlaceholders", _templatePlaceholders.ToJavaHashMap())
                                      .CallAJO("addActionButtons", _actionButtons.ConvertAll(item => item.ToAjo()).ToJavaList());

            if (_action != null)
            {
                notificationContent.CallAJO("withAction", _action.ToAjo());
            }

            if (_mediaAttachment != null)
            {
                notificationContent.CallAJO("withMediaAttachment", _mediaAttachment.ToAjo());
            }

            if (_customization != null)
            {
                notificationContent.CallAJO("withCustomization", _customization.ToAjo());
            }
            if (_badge != null)
            {
                notificationContent.CallAJO("withBadge", _badge.ToAjo());
            }

            return(notificationContent);
        }
Ejemplo n.º 3
0
        public AndroidJavaObject ToAjo()
        {
            var inviteContentBuilderAJO = new AndroidJavaObject("im.getsocial.sdk.invites.InviteContent$Builder");

            if (Subject != null)
            {
                inviteContentBuilderAJO.CallAJO("withSubject", Subject);
            }
            if (Text != null)
            {
                inviteContentBuilderAJO.CallAJO("withText", Text);
            }
            if (_mediaAttachment != null)
            {
                inviteContentBuilderAJO.CallAJO("withMediaAttachment", _mediaAttachment.ToAjo());
            }
            return(inviteContentBuilderAJO.CallAJO("build"));
        }