Sending PFUsers images from Parse - ios

This is the last thing I need to develop my client based app but have seriously hit a hard rock.
I am trying to send Users images directly from Parse and have a handful of images displayed to them. What is the best way to go about this? I already have a User Login & Registration completely set up. I also have a UIViewController filed as ConceptPage and a PFImageView filed as Concept1.
Ideally I would like to have these images stored in the "User" Class by adding "File" Columns. I've already went ahead and made one file column called "concept1"
Any help would be greatly appreciated at this point considering I'm now 2 weeks in of research on this topic.

Related

Post on a different page in ruby on rails

I have been trying to solve a problem for some time in ruby on rails, but I haven't been able to achieve it and I can't seem to find a solution online (it must be easy but I am not sure what is the write thing to search for)
So, in my web application, I have a CURD table and I use modal to create new items in there:
Image 1
Image 2
This is working perfectly fine. What I would like to do is that when this is created I'd like to post in a different page that " ABC have been created by X User"
In my case that would be the chatbox container:
Image 3
So in my case, the green box is where I would like to say of what has been created and who has created it. I know that it is not a complex problem but I just can't seem to find the solution and I have been trying this for days.
Would really appreciate your help. Please let me know if you don't understand the problem and I can elaborate.
Thanks in advance.
Kind Regards,
Usman
You can create a separate model Notification (or similar name), and use an after_create hook in your original model to automatically create an instance of Notification. The Notification could store the information you want to display as attributes. From there, you'd have to figure out how to display the notification in the correct place on the 3rd page. One approach would be to query all your posts and notifications and sort them by created_at. There's other ways, it's up to you.
I get what you're saying.. but I am a little confused on the first part. So I have a model called Solr that has all the records associated with its User. What do I put in the after_create hook method to display records according to the timestamp in my Chat Box/ Events Log? Do you have an example of a similar implementation?
PS - Why do you say that I need to create a new model why can't I use the same model?
Thanks.

Local storage on Rails

I've built a Rails app, basically a CRUD app for memos/notes.
A notes title must be unique. If a user enters a name already taken a warning message is shown prompting them to chose another.
My question is how to make this latency for this feedback as close to zero as possible. When creating a note little UX speed bumps like this will get annoying for user quickly.
Of course the main bottleneck is the network. Inspired by Meteor (and mini-mongo) I was thinking some kind of local storage could be a solution?
I.E. When app first loads, send ALL JSON to the client with ALL note titles. The app (front end is Angular JS) could check LocalStorage (or App Cache, Web SQL?) instead of incurring a network round trip. The feedback would be instant.
I've used LocalStorage in the past to augment an app, but in the scenario it'd really seriously depend on it. I'm not sure how confident I'd be building on something that user might not have. Also as the number of user Notes/Memos I have doubts how feasible it is to send a JSON object down the wire with ALL the note titles. That might get pretty big. On the other hand MeteorJS seems to do this with no probs.
Has anyone done something similar or have any pointers? Thanks!
I don't know how Meteor works here, but you're right that storing all note titles in localStorage is not a good idea. Actually, you don't need localStorage here, you can just put it in a JS array, because you need this data only once (when checking new note title).
I think, there could be 2 possible solutions:
You can change your business requirements and allow non-unique title. Is there really a necessity for titles to be unique?
You can verify note title when user submits form. In this case you can provide suggestions for users, so they not spend time guessing vacant title.
Or, if titles must be unique only within a user (two users can have same title for their notes), you can really load all note titles in JS array and check uniqueness while users types in a title.
Or you can send an AJAX request checking title uniqueness as soon as user finished typing the title. In this case you can win some seconds.
Or you can send an AJAX request as soon as user typed in 3 symbols. The request will return all titles that begin with these 3 symbols, so you don't need to load all the titles.

Creating you own database with Parse for an iOS app in Swift

I need to know if I can use Parse for what i need. Let me give you some context. I am new to coding for iOS in Swift. I am creating an app, and a big part of it is displaying info to the user depending on what country they select.
So at the start of the app, they will select a country. I have used Parse a little bit through an online course, so I know how to signup and create users etc.
What i want to know if i can do?
Can i use Parse to create my own database? So have a Class called country_data, and then in that class, have all the countries with info about them. As an example of what i mean, see the table below:
Then, in the app, i can check that if the user selects 'Spain' for example, I can display all the Info for Spain.
Everything i've done in Parse so far had been about sending info to Parse that Ive created from the code in Xcode. But i need to know if i can go into my app in Parse and create this database myself.
Is this possible and is it the right way to do what i'm looking for. Any suggestions welcome, and thanks! Please ask questions if you need me to explain more.
Nick
Good news OP,
(1) yes Parse is absolutely perfect for this.
Parse is now at http://back4app.com
Here...
It literally took me less time to do that, than it took to answer your question!
It's almost unbelievable to understand how much time "BAAS" services save, in the new "BAAS" era.
(2) 196 countries. You should be OK :) Anything up to a few million countries will work fine. After that Parse will get a little slow on searches.
(3) "But I need to know if i can go into my app in Parse and create this database myself."
Yes, using the internet and a computer,
just go to back4app.com, log in, and click on your project. Click on "Core". (Parse software also offers features like Analytics, etc. For the database system, just click on "Core".)
Notice the button "Add Class", click that and type in "Country". Add a column called "name" which is a "String".
Make another new class "City". Again make a "String" column "name", and also make a column that is a "Pointer" to "Country".
You're completely done.
It is far quicker than me typing it here, heh

Xcode Parse.com save to csv/any file?

I pretty much finished my project. It's ticket booking app based on Parse.com written in objective c in Xcode. Also i want to mention i'm pretty new in objective C world.
One functionality is TableView which shows user his order history, it is followed by ViewController which shows orders details.
Now one of requirements of this app was "save and load data". My lecturer says that it HAS to have this function(no matter if it's really that useful). So i figured i could make "save" for order history. Then when app has no access to internet user could load csv file(previously saved) and look up his order history with details(again in tableview > view controller).
I'm pretty tired and i have no idea how to come around this. I think that best file format would be CSV, but i've never worked with these in Xcode. I'm looking for any advice or an idea on how to handle that.

Ideas to store an TableView for different Users on Parse

I have an application where the user needs to sign in first. Now in my application there is an table view which can be filled with different events for example: a user adds an Title for a new event and an yellow icon. Now the Title and the yellow icon appears in the tableview.
Now i want the app to sync with Parse so that this user can see it's Title and it's yellow icon on every device he's logged in.
I'm sorry that i need to ask, i hope you can help me :/
Actually there is already a lot of content regarding your question and the Parse SDK is very well documented.
For example have a look at this: Save App Data to Parse Backend
You should do the following steps:
Create an App on Parse
Create User Table
Create AppData Table
Reference the User with the AppData entry via column type : "Pointer"
Whenever a entry was added to your tableview or whenever the app is closed save the current data to your parse backend
Whenever the tableview is shown or whenever your application starts retrieve the information from your Parse backend and show them in your tableview accordingly
I hope the link I gave you can give you some insight, however nobody knows whether you are coding in Swift or Objective-C because you added both tags.
If you need more information on how to design your backend in order to retrieve the right entries for the specific user I recommend reading this:
find-all-objects-belonging-to-a-user-with-objectid
or reading about relational queries in the Parse SDK.

Resources