Code Monkey home page Code Monkey logo

parsehelper's Introduction

ParseHelper

A light-weight wrapper for Parse

Install

Copy the ParseHelper.swift file into your Xcode Project

Then in your AppDelegate.swift file under didFinishLaunchingWithOptions add

// [Optional] Power your app with Local Datastore. For more info, go to
// https://parse.com/docs/ios_guide#localdatastore/iOS
Parse.enableLocalDatastore()

// Initialize Parse.
Parse.setApplicationId("YOUR PARSE APP ID", clientKey: "YOUR PARSE CLIENT KEY")

If you want to use Facebook or Twitter

// Facebook
// Go to https://parse.com/docs/ios/guide#users-facebook-users to help setup Facebook with Parse
PFFacebookUtils.initializeFacebookWithApplicationLaunchOptions(launchOptions)

// Twitter 
// Go to https://parse.com/docs/ios/guide#users-twitter-users to help setup Twitter with Parse
PFTwitterUtils.initializeWithConsumerKey("YOUR CONSUMER KEY",  consumerSecret:"YOUR CONSUMER SECRET")

Usage

First create an instance of ParseHelper:

Make the parseHelper instance as a global variable so you don't have to create it over and over again

let parseHelper = ParseHelper.sharedInstance

Log a user in

parseHelper.logInUser("[email protected]", password: "password") { (success, errorMesssage) -> Void in
        // Handle Error
    }

Create a new user

parseHelper.createUser("[email protected]", password: "password", confirmPassword: "confirmPassword", parameters: ["fullName":"Example Name"]) { (success, errorMesssage) -> Void in
        // Handle Error
    }

Send reset password email

parseHelper.sendForgotPasswordEmail("[email protected]", completion: { (success, errorMesssage) -> Void in
        // Handle Error
    })

Log user in via Facebook with Read Permissions

parseHelper.loginUserUsingFacebookReadPermissions(permissions, completion: { (success, errorMesssage) -> Void in
        // Handle Error
    })

Log user in via Facebook with Write Permissions

parseHelper.loginUserUsingFacebookWritePermissions(permissions, completion: { (success, errorMesssage) -> Void in
        // Handle Error
    })

Log user in via Twitter

parseHelper.loginUserUsingTwitter { (success, errorMesssage) -> Void in
        // Handle Error
    }

Link user to Facebook with Read Permissions

parseHelper.linkFacebookToUserUsingReadPermissions(permissions, completion: { (success, errorMesssage) -> Void in
        // Handle Error
    })

Link user to Facebook with Write Permissions

parseHelper.linkFacebookToUserUsingWritePermissions(permissions, completion: { (success, errorMesssage) -> Void in
        // Handle Error
    })

Link user to Twitter

parseHelper.linkTwitterToUser { (success, errorMesssage) -> Void in
        // Handle Error
    }

parsehelper's People

Contributors

vasularoiya avatar

Stargazers

Julian Engel avatar Thanasi Stratigakis avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.