Ejemplo n.º 1
0
        public override void AppRequest(
            string message,
            OGActionType?actionType,
            string objectId,
            IEnumerable <string> to,
            IEnumerable <object> filters,
            IEnumerable <string> excludeIds,
            int?maxRecipients,
            string data,
            string title,
            FacebookDelegate <IAppRequestResult> callback)
        {
            this.ValidateAppRequestArgs(
                message,
                actionType,
                objectId,
                to,
                filters,
                excludeIds,
                maxRecipients,
                data,
                title,
                callback);

            MethodArguments args = new MethodArguments();

            args.AddString("message", message);
            args.AddCommaSeparatedList("to", to);
            args.AddString("action_type", actionType != null ? actionType.ToString() : null);
            args.AddString("object_id", objectId);
            args.AddList("filters", filters);
            args.AddList("exclude_ids", excludeIds);
            args.AddNullablePrimitive("max_recipients", maxRecipients);
            args.AddString("data", data);
            args.AddString("title", title);
            var call = new CanvasUIMethodCall <IAppRequestResult>(this, MethodAppRequests, Constants.OnAppRequestsCompleteMethodName);

            call.Callback = callback;
            call.Call(args);
        }
Ejemplo n.º 2
0
        public override void AppRequest(
            string message,
            OGActionType actionType,
            string objectId,
            string[] to,
            List <object> filters,
            string[] excludeIds,
            int?maxRecipients,
            string data,
            string title,
            FacebookDelegate <IAppRequestResult> callback)
        {
            ValidateAppRequestArgs(
                message,
                actionType,
                objectId,
                to,
                filters,
                excludeIds,
                maxRecipients,
                data,
                title,
                callback
                );

            MethodArguments args = new MethodArguments();

            args.addNonNullOrEmptyParameter("message", message);
            args.addCommaSeperateListNonNull("to", to);
            args.addNonNullOrEmptyParameter("action_type", actionType != null ? actionType.ToString() : null);
            args.addNonNullOrEmptyParameter("object_id", objectId);
            args.addNonNullParameter("filters", filters);
            args.addNonNullParameter("exclude_ids", excludeIds);
            args.addNonNullOrEmptyParameter("max_recipients", maxRecipients);
            args.addNonNullOrEmptyParameter("data", data);
            args.addNonNullOrEmptyParameter("title", title);
            var call = new CanvasUIMethodCall <IResult>(this, MethodAppRequests, Constants.OnAppRequestsCompleteMethodName);

            call.call(args);
        }
Ejemplo n.º 3
0
        public override void FeedShare(
            string toId,
            Uri link,
            string linkName,
            string linkCaption,
            string linkDescription,
            Uri picture,
            string mediaSource,
            FacebookDelegate <IShareResult> callback)
        {
            MethodArguments args = new MethodArguments();

            args.AddString("to", toId);
            args.AddUri("link", link);
            args.AddString("name", linkName);
            args.AddString("caption", linkCaption);
            args.AddString("description", linkDescription);
            args.AddUri("picture", picture);
            args.AddString("source", mediaSource);
            var call = new CanvasUIMethodCall <IShareResult>(this, MethodFeed, Constants.OnShareCompleteMethodName);

            call.Callback = callback;
            call.Call(args);
        }
        public override void ShareLink(
            Uri contentURL,
            string contentTitle,
            string contentDescription,
            Uri photoURL,
            string hashtag,
            FacebookDelegate <IShareResult> callback)
        {
            if (hashtag != null)
            {
                throw new NotImplementedException("ShareLink with hashtag is only implemented for iOS and Android for now. Set it to null.");
            }

            MethodArguments args = new MethodArguments();

            args.AddUri("link", contentURL);
            args.AddString("name", contentTitle);
            args.AddString("description", contentDescription);
            args.AddUri("picture", photoURL);
            var call = new CanvasUIMethodCall <IShareResult>(this, MethodFeed, Constants.OnShareCompleteMethodName);

            call.Callback = callback;
            call.Call(args);
        }