This is what I presented on the first Parse Developer meetup in NYC on October 2nd, 2013.
Sketchio is a fun, free and easy way to quickly make drawings and share with your friends on Facebook, Twitter, Instagram and via email.
1. sketchioapp.com
Building a drawing mobile app using parse
Sketchio is a fun and easy way to quickly make
drawings and share them with friends on Facebook,
Twitter, Instagram or via email.
15. Parse: Save sketch (continue)
// create a photo object
PFObject *photo = [PFObject objectWithClassName:@”Photo”];
[photo setObject:[PFUser currentUser] forKey:@”user”];
[photo setObject:photoFile forKey:@”image”];
// photos are public, but may only be modified by the user who uploaded them
PFACL *photoACL = [PFACL ACLWithUser:[PFUser currentUser]];
[photoACL setPublicReadAccess:YES];
photo.ACL = photoACL;
[photo saveInBackground];
}
22. Website - login
https://gist.github.com/jtubert/6759029
Parse.initialize(KEY, SECRET);
window.fbAsyncInit = function() {
// init the FB JS SDK
Parse.FacebookUtils.init({
appId : '1386686244890246', // App ID from the app dashboard
channelUrl : 'channel.html', // Channel file for x-domain comms
status : false, // check login status
cookie : true, // enable cookies to allow Parse to access the session
xfbml : true // parse XFBML
});
};
….
23. Website - login (continue)
$('#signin').click(function (e) {
Parse.FacebookUtils.logIn(null, {
success: function (user) {
console.log("login successful”);
},
error: function (user, error) {
console.log("Oops, something went wrong.");
}
});
24. Website - get sketches
https://gist.github.com/jtubert/6747749
Parse.initialize(KEY, SECRET);
var Photo = Parse.Object.extend("Photo");
var query = new Parse.Query(Photo);
query.equalTo("user", Parse.User.current());
query.descending("createdAt");
query.find({
success: function(photosArr) {
//show images
},
error: function(object, error) {
//console.log(error);
}
});
25. Website: Testing
This is a personal projects, and I don’t have many different
devices/computers/systems.
Hello Browserstack!
http://www.browserstack.com/screenshots/471a15bfb6a36a4581d812e2c157fbad0d1c8c38