Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
using System;
using MonoTouch.Foundation;
using MonoTouch.ObjCRuntime;
using MonoTouch.UIKit;
namespace Parse
public delegate void PFBooleanResult (bool succeeded, NSError error);
public delegate void PFIntegerResult (int number, NSError error);
public delegate void PFArrayResult (NSArray objects, NSError error);
public delegate void PFObjectResult (PFObject theObject, NSError error);
public delegate void PFSetResult(NSSet channels, NSError error);
public delegate void PFUserResult (PFUser user, NSError error);
public delegate void PFDataResult (NSData data, NSError error);
public delegate void PFDataStreamResult (NSInputStream data, NSError error);
public delegate void PFProgress (int percentDone);
[BaseType (typeof (NSObject))]
public interface Parse {
[Export ("setApplicationId:clientKey:")]
void SetApplicationIdclientKey (string applicationId, string clientKey);
[Export ("offlineMessagesEnabled:")]
void OfflineMessagesEnabled (bool enabled);
[Export ("errorMessagesEnabled:")]
void ErrorMessagesEnabled (bool enabled);
[Export ("getApplicationId")]
string ApplicationId{get;}
[Export ("getClientKey")]
string ClientKey{get;}
[BaseType (typeof (NSObject))]
public interface PFACL {
[Export ("ACL")]
[Export ("ACLWithUser:")]
PFACL ACL (PFUser user);
[Export ("setPublicReadAccess:")]
void SetPublicReadAccess (bool allowed);
[Export ("getPublicReadAccess")]
bool GetPublicReadAccess ();
[Export ("setPublicWriteAccess:")]
void SetPublicWriteAccess (bool allowed);
[Export ("getPublicWriteAccess")]
bool GetPublicWriteAccess ();
[Export ("setReadAccess:forUserId:")]
void SetReadAccess (bool allowed, string userId);
[Export ("getReadAccessForUserId:")]
bool GetReadAccess (string userId);
[Export ("setWriteAccess:forUserId:")]
void SetWriteAccess (bool allowed, string userId);
[Export ("getWriteAccessForUserId:")]
bool GetWriteAccess (string userId);
[Export ("setReadAccess:forUser:")]
void SetReadAccess (bool allowed, PFUser user);
[Export ("getReadAccessForUser:")]
bool GetReadAccess (PFUser user);
[Export ("setWriteAccess:forUser:")]
void SetWriteAccess (bool allowed, PFUser user);
[Export ("getWriteAccessForUser:")]
bool GetWriteAccess (PFUser user);
[Export ("getReadAccessForRoleWithName:")]
bool GetReadAccessForRoleName (string name);
[Export ("setReadAccess:forRoleWithName:")]
void SetReadAccessforRoleName (bool allowed, string name);
[Export ("getWriteAccessForRoleWithName:")]
bool GetWriteAccessForRoleName (string name);
[Export ("setWriteAccess:forRoleWithName:")]
void SetWriteAccessforRoleName (bool allowed, string name);
[Export ("getReadAccessForRole:")]
bool GetReadAccess (PFRole role);
[Export ("setReadAccess:forRole:")]
void SetReadAccess (bool allowed, PFRole role);
[Export ("getWriteAccessForRole:")]
bool GetWriteAccess (PFRole role);
[Export ("setWriteAccess:forRole:")]
void SetWriteAccess (bool allowed, PFRole role);
[Export ("setDefaultACL:withAccessForCurrentUser:")]
void SetDefaultACLAccess (PFACL acl, bool currentUserAccess);
[BaseType (typeof (NSObject))]
public interface PFFile {
[Export ("name")]
string Name { get; }
[Export ("url")]
string Url { get; }
[Export ("isDirty")]
bool IsDirty { get; }
[Export ("isDataAvailable")]
bool IsDataAvailable { get; }
[Export ("fileWithData:")]
PFFile FromData (NSData data);
[Export ("fileWithName:data:")]
PFFile FromData (string name, NSData data);
[Export ("fileWithName:contentsAtPath:")]
PFFile FromPath (string name, string path);
[Export ("save")]
bool Save ();
[Export ("save:")]
bool Save (NSError error);
[Export ("saveInBackground")]
void SaveAsync ();
[Export ("saveInBackgroundWithBlock:")]
void SaveAsync (PFBooleanResult result);
[Export ("saveInBackgroundWithBlock:progressBlock:")]
void SaveInBackgroundWithBlockprogressBlock (PFBooleanResult result, PFProgress progress);
[Export ("saveInBackgroundWithTarget:selector:")]
void SaveAsync (NSObject target, Selector selector);
[Export ("getData")]
NSData GetData ();
[Export ("getDataStream")]
NSInputStream GetDataStream ();
[Export ("getData:")]
NSData GetData (NSError error);
[Export ("getDataStream:")]
NSInputStream GetDataStream (NSError error);
[Export ("getDataInBackgroundWithBlock:")]
void GetDataAsync (PFDataResult result);
[Export ("getDataStreamInBackgroundWithBlock:")]
void GetDataStreamAsync (PFDataStreamResult block);
[Export ("getDataInBackgroundWithBlock:progressBlock:")]
void GetDataAsync (PFDataResult result, PFProgress progress);
[Export ("getDataStreamInBackgroundWithBlock:progressBlock:")]
void GetDataStreamAsync (PFDataStreamResult result, PFProgress progress);
[Export ("getDataInBackgroundWithTarget:selector:")]
void GetDataAsync (NSObject target, Selector selector);
[Export ("cancel")]
void Cancel ();
[BaseType (typeof (PFObject))]
public interface PFRole {
[Export ("initWithName:")]
PFRole InitWithName (string name);
[Export ("initWithName:acl:")]
PFRole InitWithNameacl (string name, PFACL acl);
[Export ("roleWithName:")]
PFRole RoleWithName (string name);
[Export ("roleWithName:acl:")]
PFRole RoleWithNameacl (string name, PFACL acl);
[Export ("name")]
string name {get;set;}
[Export ("users")]
PFRelation Users ();
[Export ("roles")]
PFRelation Roles ();
[Export ("query")]
PFQuery Query ();
[BaseType (typeof (NSObject))]
public interface PFRelation {
[Export ("targetClass")]
string TargetClass { get; set; }
[Export ("key")]
string Key { get; }
[Export ("query")]
PFQuery Query ();
[Export ("addObject:")]
void AddObject (PFObject obj);
[Export ("removeObject:")]
void RemoveObject (PFObject obj);
[BaseType (typeof (NSObject))]
public interface PFObject {
[Export ("objectId")]
string ObjectId { get; set; }
[Export ("updatedAt")]
NSDate UpdatedAt { get; }
[Export ("createdAt")]
NSDate CreatedAt { get; }
[Export ("initWithClassName:")]
IntPtr Constructor (string newClassName);
[Export ("objectWithClassName:")]
PFObject FromName (string className);
[Export ("address")]
PFPointer Address ();
//[Export ("save")]
//bool Save ();
[Export ("save:")]
bool Save (out NSError error);
[Export ("saveInBackground")]
void SaveInBackground ();
[Export ("saveInBackgroundWithTarget:selector:")]
void SaveInBackgroundWithTargetselector (NSObject target, Selector selector);
//[Export ("refresh")]
//void Refresh ();
[Export ("refresh:")]
void Refresh (NSError error);
[Export ("refreshInBackgroundWithTarget:selector:")]
void RefreshInBackgroundWithTargetselector (NSObject target, Selector selector);
//[Export ("delete")]
//bool Delete ();
[Export ("delete:")]
bool Delete (NSError error);
[Export ("deleteInBackground")]
void DeleteInBackground ();
[Export ("deleteInBackgroundWithTarget:selector:")]
void DeleteInBackgroundWithTargetselector (NSObject target, Selector selector);
//[Export ("deleteInBackgroundWithBlock:")]
//void DeleteInBackgroundWithBlock (PFBooleanResultBlock block);
//[Export ("saveInBackgroundWithBlock:")]
//void SaveInBackgroundWithBlock (PFBooleanResultBlock block);
//[Export ("refreshInBackgroundWithBlock:")]
//void RefreshInBackgroundWithBlock (PFObjectResultBlock block);
[Export ("objectForKey:")]
NSObject ObjectForKey (string key);
[Export ("setObject:forKey:")]
void SetObjectforKey (NSObject inObject, string key);
[Export ("removeObjectForKey:")]
void RemoveObjectForKey (string key);
[Export ("saveAll:")]
bool SaveAll (NSArray objects);
[Export ("saveAll:error:")]
bool SaveAllerror (NSArray objects, NSError error);
[Export ("saveAllInBackground:")]
void SaveAllInBackground (NSArray objects);
[Export ("saveAllInBackground:withTarget:selector:")]
void SaveAllInBackgroundwithTargetselector (NSArray objects, NSObject target, Selector selector);
[Export ("isDirty")]
bool IsDirty ();
[Export ("initWithClassName:result:")]
IntPtr Constructor (string newClassName, NSDictionary result);
[BaseType (typeof (NSObject))]
public interface PFPointer {
[Export ("objectId")]
string ObjectId { get; set; }
[Export ("className")]
string ClassName { get; set; }
[Export ("proxyForJson")]
NSObject ProxyForJson ();
[Export ("initWithClassName:objectId:")]
IntPtr Constructor (string newClassName, string newObjectId);
[Export ("pointerWithClassName:objectId:")]
PFPointer PointerWithClassNameobjectId (string newClassName, string newObjectId);
//[Export ("copyWithZone:")]
//NSObject CopyWithZone (NSZone zone);
[BaseType (typeof (NSObject))]
public interface PFPush {
[Export ("subscribeToChannel:withError:")]
bool Subscribe (string channel,out NSError error);
[BaseType (typeof (NSObject))]
public interface PFQuery {
[Export ("className")]
string ClassName { get; set; }
[Export ("limit")]
NSNumber Limit { get; set; }
[Export ("skip")]
NSNumber Skip { get; set; }
//[Export ("cachePolicy")]
//PFCachePolicy CachePolicy { get; set; }
[Export ("order")]
string Order { get; set; }
[Export ("initWithClassName:")]
IntPtr Constructor (string newClassName);
[Export ("orderByAscending:")]
void OrderByAscending (string key);
[Export ("orderByDescending:")]
void OrderByDescending (string key);
[Export ("whereKey:equalTo:")]
void WhereKeyequalTo (string key, NSObject inObject);
[Export ("whereKey:lessThan:")]
void WhereKeylessThan (string key, NSObject inObject);
[Export ("whereKey:lessThanOrEqualTo:")]
void WhereKeylessThanOrEqualTo (string key, NSObject inObject);
[Export ("whereKey:greaterThan:")]
void WhereKeygreaterThan (string key, NSObject inObject);
[Export ("whereKey:greaterThanOrEqualTo:")]
void WhereKeygreaterThanOrEqualTo (string key, NSObject inObject);
[Export ("whereKey:notEqualTo:")]
void WhereKeynotEqualTo (string key, NSObject inObject);
[Export ("whereKey:containedIn:")]
void WhereKeycontainedIn (string key, NSArray array);
//[Export ("findObjects")]
//NSArray FindObjects ();
[Export ("findObjects:")]
NSArray FindObjects (NSError error);
[Export ("findObjectsInBackgroundWithTarget:selector:")]
void FindObjectsAsync (NSObject target, Selector selector);
//[Export ("countObjects")]
//int CountObjects ();
[Export ("countObjects:")]
int CountObjects (NSError error);
[Export ("countObjectsInBackgroundWithTarget:selector:")]
void CountObjectsAsync (NSObject target, Selector selector);
[Export ("getObjectWithId:")]
PFObject GetObject (string objectId);
[Export ("getObjectWithId:error:")]
PFObject GetObject (string objectId, NSError error);
[Export ("getObjectInBackgroundWithId:target:selector:")]
void GetObjectAsync (string objectId, NSObject target, Selector selector);
[Export ("getObjectOfClass:objectId:")]
PFObject GetObject(string objectClass, string objectId);
[Export ("getObjectOfClass:objectId:error:")]
PFObject GetObject (string objectClass, string objectId, NSError error);
[Export ("queryWithClassName:")]
PFQuery Query (string className);
[Export ("getUserObjectWithId:")]
PFUser GetUserObject (string objectId);
[Export ("getUserObjectWithId:error:")]
PFUser GetUserObject (string objectId, NSError error);
[Export ("queryForUser")]
PFQuery QueryForUser ();
//[Export ("findObjectsInBackgroundWithBlock:")]
//void FindObjectsInBackgroundWithBlock (PFArrayResultBlock block);
//[Export ("countObjectsInBackgroundWithBlock:")]
//void CountObjectsInBackgroundWithBlock (PFIntegerResultBlock block);
//[Export ("getObjectInBackgroundWithId:block:")]
//void GetObjectInBackgroundWithIdblock (string objectId, PFObjectResultBlock block);
[BaseType (typeof (PFObject))]
public interface PFUser {
[Export ("password")]
string Password { get; set; }
[Export ("sessionToken")]
string SessionToken { get; set; }
[Export ("facebookAccessToken")]
string FacebookAccessToken { get; }
[Export ("facebookExpirationDate")]
NSDate FacebookExpirationDate { get; }
[Export ("facebookId")]
string FacebookId { get; }
[Export ("isNew")]
bool IsNew { get; }
[Export ("username")]
string Username { get; set; }
[Export ("email")]
string Email { get; set; }
[Export ("user")]
PFUser User ();
[Export ("currentUser")]
NSObject CurrentUser ();
[Export ("logInWithUsername:password:")]
PFUser LogIn (string username, string password);
[Export ("logInWithUsername:password:error:")]
PFUser LogIn (string username, string password, NSError error);
[Export ("logInWithUsernameInBackground:password:")]
void LogInAsycnc (string username, string password);
[Export ("logInWithUsernameInBackground:password:target:selector:")]
void LogInAsync (string username, string password, NSObject target, Selector selector);
[Export ("facebook")]
PF_Facebook Facebook ();
[Export ("facebookWithDelegate:")]
PF_Facebook Facebook (PF_FBSessionDelegate fbDelegate);
[Export ("logInWithFacebook:target:selector:")]
void LogInWithFacebook (NSArray permissions, NSObject target, Selector selector);
[Export ("linkToFacebook:target:selector:")]
void LinkToFacebook (NSArray permissions, NSObject target, Selector selector);
[Export ("unlinkFromFacebook")]
bool UnlinkFromFacebook ();
[Export ("unlinkFromFacebookWithError:")]
bool UnlinkFromFacebook (NSError error);
[Export ("unlinkFromFacebookInBackgroundWithTarget:selector:")]
void UnlinkFromFacebookAsync (NSObject target, Selector selector);
[Export ("requestPasswordResetForEmail:")]
bool RequestPasswordReset (string email);
[Export ("requestPasswordResetForEmail:error:")]
bool RequestPasswordReset (string email, NSError error);
[Export ("requestPasswordResetForEmailInBackground:")]
void RequestPasswordResetAsync (string email);
[Export ("requestPasswordResetForEmailInBackground:withTarget:selector:")]
void RequestPasswordResetAsync (string email, NSObject target, Selector selector);
[Export ("logOut")]
void LogOut ();
[Export ("isAuthenticated")]
bool IsAuthenticated ();
[Export ("hasFacebook")]
bool HasFacebook ();
//[Export ("signUp")]
//bool SignUp ();
[Export ("signUp:")]
bool SignUp (NSError error);
[Export ("signUpInBackground")]
void SignUpAsync ();
[Export ("signUpInBackgroundWithTarget:selector:")]
void SignUpAsync (NSObject target, Selector selector);
//[Export ("logInWithUsernameInBackground:password:block:")]
//void LogIn (string username, string password, PFUserResultBlock block);
//[Export ("requestPasswordResetForEmailInBackground:block:")]
//void RequestPassword (string email, PFBooleanResultBlock block);
//[Export ("signUpInBackgroundWithBlock:")]
//void SignUp (PFBooleanResultBlock block);
//[Export ("logInWithFacebook:block:")]
//void LogInWithFacebook (NSArray permissions, PFUserResultBlock block);
//[Export ("linkToFacebook:block:")]
//void LinkToFacebook (NSArray permissions, PFBooleanResultBlock block);
//[Export ("unlinkFromFacebookWithBlock:")]
//void UnlinkFromFacebook (PFBooleanResultBlock block);
#region Facebook
[BaseType (typeof (NSObject))]
public interface PF_Facebook {
[Export ("accessToken")]
string AccessToken { get; set; }
[Export ("expirationDate")]
NSDate ExpirationDate { get; set; }
[Export ("sessionDelegate")]
PF_FBSessionDelegate SessionDelegate { get; set; }
[Export ("localAppId")]
string LocalAppId { get; set; }
[Export ("initWithAppId:andDelegate:")]
IntPtr Constructor (string appId, PF_FBSessionDelegate fbDelegate);
[Export ("authorize:")]
void Authorize (NSArray permissions);
[Export ("authorize:localAppId:")]
void AuthorizeLocalApp (NSArray permissions, string localAppId);
[Export ("handleOpenURL:")]
bool OpenURL (NSUrl url);
[Export ("logout:")]
void Logout (PF_FBSessionDelegate fbDelegate);
[Export ("requestWithParams:andDelegate:")]
PF_FBRequest GetRequest (NSMutableDictionary parameters, PF_FBRequestDelegate fbDelegate);
[Export ("requestWithMethodName:andParams:andHttpMethod:andDelegate:")]
PF_FBRequest GetRequest (string methodName, NSMutableDictionary parameters, string httpMethod, PF_FBRequestDelegate fbDelegate);
[Export ("requestWithGraphPath:andDelegate:")]
PF_FBRequest GetGraphRequest (string graphPath, PF_FBRequestDelegate fbDelegate);
[Export ("requestWithGraphPath:andParams:andDelegate:")]
PF_FBRequest GetGraphRequest (string graphPath, NSMutableDictionary parameters, PF_FBRequestDelegate fbDelegate);
[Export ("requestWithGraphPath:andParams:andHttpMethod:andDelegate:")]
PF_FBRequest GetGraphRequest (string graphPath, NSMutableDictionary parameters, string httpMethod, PF_FBRequestDelegate fbDelegate);
[Export ("dialog:andDelegate:")]
void Dialog (string action, PF_FBDialogDelegate fbDelegate);
[Export ("dialog:andParams:andDelegate:")]
void Dialog (string action, NSMutableDictionary parameters, PF_FBDialogDelegate fbDelegate);
[Export ("isSessionValid")]
bool IsSessionValid ();
[BaseType (typeof (NSObject))]
public interface PF_FBSessionDelegate {
[Export ("fbDidLogin")]
void DidLogin ();
[Export ("fbDidNotLogin:")]
void DidNotLogin (bool cancelled);
[Export ("fbDidLogout")]
void DidLogout ();
[BaseType (typeof (UIView))]
public interface PF_FBDialog {
[Export ("delegate")]
PF_FBDialogDelegate Delegate { get; set; }
[Export ("params")]
NSMutableDictionary Params { get; set; }
[Export ("title")]
string Title { get; set; }
[Export ("getStringFromUrl:urlneedle:needle")]
string GetString (string url, string urlNeedle , string needle );
[Export ("initWithURL:loadingURLparams:paramsdelegate:delegate")]
IntPtr Constructor (string url, NSMutableDictionary parameters , PF_FBDialogDelegate theDelegate );
[Export ("show")]
void Show ();
[Export ("load")]
void Load ();
[Export ("loadURL:get:")]
void LoadURLget (string url, NSDictionary getParams);
[Export ("dismissWithSuccess:animated:")]
void Dismiss (bool success, bool animated);
[Export ("dismissWithError:animated:")]
void Dismiss (NSError error, bool animated);
[Export ("dialogWillAppear")]
void DialogWillAppear ();
[Export ("dialogWillDisappear")]
void DialogWillDisappear ();
[Export ("dialogDidSucceed:")]
void DialogDidSucceed (NSUrl url);
[Export ("dialogDidCancel:")]
void DialogDidCancel (NSUrl url);
[BaseType (typeof (NSObject))]
public interface PF_FBDialogDelegate {
[Export ("dialogDidComplete:")]
void DialogComplete (PF_FBDialog dialog);
[Export ("dialogCompleteWithUrl:")]
void DialogComplete (NSUrl url);
[Export ("dialogDidNotCompleteWithUrl:")]
void DialogDidNotComplete (NSUrl url);
[Export ("dialogDidNotComplete:")]
void DialogDidNotComplete (PF_FBDialog dialog);
[Export ("dialog:didFailWithError:")]
void DialogDidFail (PF_FBDialog dialog, NSError error);
[Export ("dialog:shouldOpenURLInExternalBrowser:")]
bool DialogShouldOpenURLInExternalBrowser (PF_FBDialog dialog, NSUrl url);
[BaseType (typeof (NSObject))]
public interface PF_FBRequest {
[Export ("delegate")]
PF_FBRequestDelegate Delegate { get; set; }
[Export ("url")]
string Url { get; set; }
[Export ("httpMethod")]
string HttpMethod { get; set; }
[Export ("params")]
NSMutableDictionary Params { get; set; }
[Export ("connection")]
NSUrlConnection Connection { get; set; }
[Export ("responseText")]
NSMutableData ResponseText { get; set; }
[Export ("serializeURL:params:")]
string SerializeURL (string baseUrl, NSDictionary parameters);
[Export ("serializeURL:params:httpMethod:")]
string SerializeURL (string baseUrl, NSDictionary parameters, string httpMethod);
[Export ("getRequestWithParams:paramshttpMethod:httpMethoddelegate:requestURL:url")]
PF_FBRequest GetRequest (NSMutableDictionary parameters, string httpMethod, PF_FBRequestDelegate requestDelegate, string url );
[Export ("loading")]
bool Loading ();
[Export ("connect")]
void Connect ();
[BaseType (typeof (NSObject))]
public interface PF_FBRequestDelegate {
[Export ("requestLoading:")]
void Loading (PF_FBRequest request);
[Export ("request:didReceiveResponse:")]
void ReceiveResponse (PF_FBRequest request, NSUrlResponse response);
[Export ("request:didFailWithError:")]
void DidFailWithError (PF_FBRequest request, NSError error);
[Export ("request:didLoad:")]
void DidLoad (PF_FBRequest request, NSObject result);
[Export ("request:didLoadRawResponse:")]
void DidLoadRawResponse (PF_FBRequest request, NSData data);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.