Ideas to store an TableView for different Users on Parse - ios

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.

Related

Priority of documents in elasticsearch

I have rails app witch collect mobile data and use elastic search as search engine in my app, As result that my app is very simple I use elastic as my db, every things goes fine till I found something amazing
In my case each user have two kind of document with different attributes, First one is profile that it's about user profile only and Second one is events that is user actions in mobile app. I have to say، user could update his/her profile and each user just have to one document in my system, that is about profile details. each time user update his profile I delete previous document and create new document for him but assume he send profile twice at same time unconsciously for example push register bottom twice at this point i get two document that are completely same so elastic save both but as i say i need to delete old one and create new one, I know I could handle this problem in mobile layer but I'm looking for some way witch make me sure at this situation document have their priorities.
Basically you need a versioning of your documents and using that you can control whether you need to create a new document or update existing document. this official Elasticsearch version control blog should help you design and implement this use-case.
I really hope I got your point correctly, consider the following points
prevent users from submitting twice in your front end.
update the document instead of deleting the previous one then creates a new document so that you don't have to worry about document priorities because of a single file.

How can I access/fetch all the details of a particular contact, if I already have his/her name with me?

Basically, I've a tableview which displays all the contact names (just like built-in contacts app in ios) stored on the device, in my app. I want to add a page which shows up when I click a cell in the tableview, and in that page I want to display all the details of that particular contact tapped in the tableview.
I've fetched all the contacts in the tableview using Contacts() in swift5. It was very easy. But now I want to retrieve (and show on new page) all details of any particular contact, which maybe variable for different contacts, for example some may have 3 numbers, some may have 4, some may have birthday some may not.
I tried searching on the internet a lot, but couldn't find anything suiting to me scenario. Any help will be much appreciated.

How do I update my iOS app's content with background downloading?

TL;DR: I want to add images to the app over the internet through background downloading of some sort, but don't know where to start, or what the best method is.
My app displays images to the users which can be filtered etc. I have a "Cards" class that has fields for name, image, etc. I then have a huge area directly in my code where I create instances of the Cards class for each image. There is then an array of these class instances, which helps with displaying them.
My issue is that now I want to be able to update this block of class instances without having to push another build to the iTunes store. Essentially, I want to add "Cards" to the app (images with appropriate names and keywords associated with them). I need to be able to update the app every month (sometimes less) with new cards as quickly as possible.
I have heard suggestions here and there about JSON files and background downloading, but can't figure out which method I need for my situation.
As per my understanding you just want to update your app content in future without uploading a new build to App Store. Right ?
If you want to do so, make your app so flexible that you can show updated contents in your app.
Here is a short instruction which you can follow...
Develop an admin panel if you are aware of any backend scripting language like php. And you can add contents from this panel into your database.
Create an API which will fetch the content from your database
Make your app flexible so that it can show all the updated content getting from the API. If you have a list of content then you can use TableView/CollectionView with pagination.
If you still face any problem then let me know. I will see deep into your problem.

Change JSON values from iphone app (possible API needed?)

I have an app with tutorials. I also have a tab where users can suggest tutorials. Right now, the app loads a table view with an JSON array taken from my website. Every tutorial object in the array looks like this:
{"string" : "Tutorial Name", "value":1, "devices":["deviceid1","deviceid2"]}
The string is the name of the tutorial they want to see. The value is how many people have voted for it. The devices is an array of strings where I would save the device ID of each user who votes for that tutorial. This is to make sure they do not vote more than once.
Now, what I want the app to do is to change the value key to add one and to add its deviceID to the array.
How do I do that in xcode? I am assuming I might have problems with 2 users trying to change the values at the same time. Should I maybe create a small API for this? Possible create a file that would get the values for me and change them as well?
If so, how do I go about doing this?
Thanks!
If you are making changes to the JSON from your app, you are only changing the values locally. This means that the changes won't be updated on the devices of other users who are accessing the app. I think the best way to do this would be to create a small API.
1) You will need to setup a MySQL database that has keys for "string" and "value".
2) Create a PHP script that takes in a string and then adds one to the value field of the database row. This script will be called when a user "votes" for a tutorial.
3) Create a PHP script that queries the data from the database and converts it to JSON format. When loading the app, this script would be called and your app would parse the JSON data and display it into a tableview with the updated values.
Hope this sets you off in the right direction!

Sending PFUsers images from Parse

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.

Resources