예제 #1
0
 /// <summary>
 /// Apps the request.
 /// </summary>
 /// <param name="message">The request string the recipient will see, maximum length 60 characters.</param>
 /// <param name="actionType">Request action type for structured request.</param>
 /// <param name="objectId">
 /// Open Graph object ID for structured request.
 /// Note the type of object should belong to this app.
 /// </param>
 /// <param name="to">A list of Facebook IDs to which to send the request.</param>
 /// <param name="data">
 /// Additional data stored with the request on Facebook,
 /// and handed back to the app when it reads the request back out.
 /// Maximum length 255 characters.</param>
 /// <param name="title">The title for the platform multi-friend selector dialog. Max length 50 characters..</param>
 /// <param name="callback">A callback for when the request completes.</param>
 public static void AppRequest(
     string message,
     OGActionType actionType,
     string objectId,
     IEnumerable <string> to,
     string data  = "",
     string title = "",
     FacebookDelegate <IAppRequestResult> callback = null)
 {
     FacebookImpl.AppRequest(message, actionType, objectId, to, null, null, null, data, title, callback);
 }
예제 #2
0
 /// <summary>
 /// Apps the request.
 /// </summary>
 /// <param name="message">The request string the recipient will see, maximum length 60 characters.</param>
 /// <param name="actionType">Request action type for structured request.</param>
 /// <param name="objectId">
 /// Open Graph object ID for structured request.
 /// Note the type of object should belong to this app.
 /// </param>
 /// <param name="filters">
 /// The configuration of the platform multi-friend selector.
 /// It should be a List of filter strings.
 /// </param>
 /// <param name="excludeIds">
 /// A list of Facebook IDs to exclude from the platform multi-friend selector dialog.
 /// This list is currently not supported for mobile devices.
 /// </param>
 /// <param name="maxRecipients">
 /// Platform-dependent The maximum number of recipients the sender should be able to
 /// choose in the platform multi-friend selector dialog.
 /// Only guaranteed to work in Unity Web Player app.
 /// </param>
 /// <param name="data">
 /// Additional data stored with the request on Facebook, and handed
 /// back to the app when it reads the request back out.
 /// Maximum length 255 characters.
 /// </param>
 /// <param name="title">
 /// The title for the platform multi-friend selector dialog. Max length 50 characters.
 /// </param>
 /// <param name="callback">A callback for when the request completes.</param>
 public static void AppRequest(
     string message,
     OGActionType actionType,
     string objectId,
     IEnumerable <object> filters    = null,
     IEnumerable <string> excludeIds = null,
     int?maxRecipients = null,
     string data       = "",
     string title      = "",
     FacebookDelegate <IAppRequestResult> callback = null)
 {
     FacebookImpl.AppRequest(message, actionType, objectId, null, filters, excludeIds, maxRecipients, data, title, callback);
 }
예제 #3
0
 /// <summary>
 /// Apps the request.
 /// </summary>
 /// <param name="message">The request string the recipient will see, maximum length 60 characters.</param>
 /// <param name="actionType">Request action type for structured request.</param>
 /// <param name="objectId">
 /// Open Graph object ID for structured request.
 /// Note the type of object should belong to this app.
 /// </param>
 /// <param name="filters">
 /// The configuration of the platform multi-friend selector.
 /// It should be a List of filter strings.
 /// </param>
 /// <param name="excludeIds">
 /// A list of Facebook IDs to exclude from the platform multi-friend selector dialog.
 /// This list is currently not supported for mobile devices.
 /// </param>
 /// <param name="maxRecipients">
 /// Platform-dependent The maximum number of recipients the sender should be able to
 /// choose in the platform multi-friend selector dialog.
 /// Only guaranteed to work in Unity Web Player app.
 /// </param>
 /// <param name="data">
 /// Additional data stored with the request on Facebook, and handed
 /// back to the app when it reads the request back out.
 /// Maximum length 255 characters.
 /// </param>
 /// <param name="title">
 /// The title for the platform multi-friend selector dialog. Max length 50 characters.
 /// </param>
 /// <param name="callback">A callback for when the request completes.</param>
 public static void AppRequest(
     string message,
     OGActionType actionType,
     string objectId,
     IEnumerable<object> filters = null,
     IEnumerable<string> excludeIds = null,
     int? maxRecipients = null,
     string data = "",
     string title = "",
     FacebookDelegate<IAppRequestResult> callback = null)
 {
     FacebookImpl.AppRequest(message, actionType, objectId, null, filters, excludeIds, maxRecipients, data, title, callback);
 }
예제 #4
0
 /// <summary>
 /// Apps the request.
 /// </summary>
 /// <param name="message">The request string the recipient will see, maximum length 60 characters.</param>
 /// <param name="actionType">Request action type for structured request.</param>
 /// <param name="objectId">
 /// Open Graph object ID for structured request.
 /// Note the type of object should belong to this app.
 /// </param>
 /// <param name="to">A list of Facebook IDs to which to send the request.</param>
 /// <param name="data">
 /// Additional data stored with the request on Facebook,
 /// and handed back to the app when it reads the request back out.
 /// Maximum length 255 characters.</param>
 /// <param name="title">The title for the platform multi-friend selector dialog. Max length 50 characters..</param>
 /// <param name="callback">A callback for when the request completes.</param>
 public static void AppRequest(
     string message,
     OGActionType actionType,
     string objectId,
     IEnumerable<string> to,
     string data = "",
     string title = "",
     FacebookDelegate<IAppRequestResult> callback = null)
 {
     FacebookImpl.AppRequest(message, actionType, objectId, to, null, null, null, data, title, callback);
 }
        protected void ValidateAppRequestArgs(
            string message,
            OGActionType? actionType,
            string objectId,
            IEnumerable<string> to = null,
            IEnumerable<object> filters = null,
            IEnumerable<string> excludeIds = null,
            int? maxRecipients = null,
            string data = "",
            string title = "",
            FacebookDelegate<IAppRequestResult> callback = null)
        {
            if (string.IsNullOrEmpty(message))
            {
                throw new ArgumentNullException("message", "message cannot be null or empty!");
            }

            if (!string.IsNullOrEmpty(objectId) && !(actionType == OGActionType.ASKFOR || actionType == OGActionType.SEND))
            {
                throw new ArgumentNullException("objectId", "Object ID must be set if and only if action type is SEND or ASKFOR");
            }

            if (actionType == null && !string.IsNullOrEmpty(objectId))
            {
                throw new ArgumentNullException("actionType", "You cannot provide an objectId without an actionType");
            }
        }
 public abstract 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);
        protected void ValidateAppRequestArgs(
            string message,
            OGActionType? actionType,
            string objectId,
            IEnumerable<string> to = null,
            IEnumerable<object> filters = null,
            IEnumerable<string> excludeIds = null,
            int? maxRecipients = null,
            string data = "",
            string title = "",
            FacebookDelegate<IAppRequestResult> callback = null)
        {
            if (string.IsNullOrEmpty(message))
            {
                throw new ArgumentNullException("message", "message cannot be null or empty!");
            }

            if (!string.IsNullOrEmpty(objectId) && !(actionType == OGActionType.ASKFOR || actionType == OGActionType.SEND))
            {
                throw new ArgumentNullException("objectId", "objectId must be set if and only if action type is SEND or ASKFOR");
            }

            if (actionType == null && !string.IsNullOrEmpty(objectId))
            {
                throw new ArgumentNullException("actionType", "actionType must be specified if objectId is provided");
            }

            if (to != null && to.Any(toWhom => string.IsNullOrEmpty(toWhom)))
            {
                throw new ArgumentNullException("to", "'to' cannot contain any null or empty strings");
            }
        }
 public abstract void AppRequest(
     string message,
     OGActionType actionType,
     string objectId,
     string[] to,
     List<object> filters,
     string[] excludeIds,
     int? maxRecipients,
     string data,
     string title,
     FacebookDelegate<IAppRequestResult> callback);