multiuser capable and search option available in app - iphone

I need to make my app such that
the first screen will have the option : NEW and SEARCH.
2.Clicking NEW should allow the user to create a new profile,
3.but clicking search should allow to access one of the stored profiles by searching for the user number.
These profiles will actually be some data about the person, his name etc. and then yes/no answers to some questions.
At the moment my app works such that I can type in my name, and do the yes/no checks and I am using plists to save the info. this means that when the I start the app the next time the app loads with the saved info. So I have got half the task done.
Now how do I make it multi-user capable so that it has the option of creating a new file or providing a search option to access existing data?
also, I am creating the plist in application directory, using the code on apple's website, but I have no clue how to access these files directly..is it possible to access these files, if I want to show the information on a desktop? Thanks.

The key phrase you want for searching Apple's docs is: Data Management.
Specifically, I would recommend the Data Management Starting Point.
Handling data can be as simple as writing a string or array to disk or as complex as a big Core Data data model. If you plan on writing and maintaining several Apple API apps, I strongly recommend eventually learning Core Data.

Related

How to download a csv file from Google Drive to show the content in a mobile app

I am totally new in mobile app development and consequently very confused about how to get going (independent from how much I have read Google Drive API documentation over and over again.)
The way I would like to implement my (initially "android") mobile app (which I will develop by using ionic):
I will have a Google Drive account where I will have 1 CSV file. I will periodically renew the content of the file in the background (possibly twice a week).
The mobile app that I will develop will just retrieve the file from Google Drive, process the content and show it to the user in a more readable (easy to understand) format.
My app will not upload any data/file from the user device to the Google Drive. The app will only retrieve a file from Google Drive to show the content to the user.
Question 1) Does this approach make sense? I ideally would like to eliminate the work for back-end development. Or would you suggest another approach to do the same thing (with or without Google Drive)?
Question 2) The authorization process looks quite confusing to me as it is explained in Google's documentation. I could not find relevant information only addressing the scenario I have in my use case. Requirements: The mobile apps can fetch the corresponding file (or the content of it) and process it to show to the end user, but mobile apps (or any other client) may not update/edit/delete the file, cannot add a new file either. The only purpose of using the Google Drive will be to enable the mobile app fetching the data that will be shown to the user. How can this problem be solved by using Google's OAuth framework? A step by step action plan would really be appreciated.
ADDENDUM
You are also welcome to share your view if I should instead consider using Firebase for my problem, which I guess will be more costly.
Based on discussing the requirements with you, I would recommend against trying to do this with Google Drive API.
There are no tutorials out there for Ionic 4 + Google Drive API, and only a few for older versions. It will be an uphill struggle to create a solution that isn't going to scale well.
Instead you should start looking into using Firebase.
There are lots of tutorials which show you the basics: setting up a login system, and reading some data from the database.
The free limits are quite generous.
You can implement caching into your app so that you store a copy of the data on the device, and only refresh it either weekly, or more advanced, put a second table in that records the last updated date for the main table.
Firebase charges by reads so if you can set it up so that you only read one record (last updated) instead of downloading the whole database every time, then you can stretch your free tier a lot further.
If you do outgrow the free tier and the app is not generating enough to cover the costs then you have the option of investing time instead of money. There are guides in the docs about exporting the users and they provide tools so that the passwords can be put into another system without requiring the users to reset their passwords. The database can be similarly exported.

Sharing File Data Between Applications in Swift/iOS [duplicate]

This question already has an answer here:
Sharing data in between apps in IOS
(1 answer)
Closed 7 years ago.
I've been doing research on how to share data between applications securely. I'd like to get some info on the correct way to handle this before I do a deep dive on implementation using the wrong method. Just cause you can do something does not necessarily mean you should.
User Case: I am working on a suite of language learning apps that have a shared audio file base of several hundred audio files and json files containing important data corresponding to a language. I'd prefer to allow the user to not have to re-download the language bundle when they use another app in our suite.
1. App Extensions - Document Provider Non-UI Variant
According to the documentation:
The File Provider extension grants access to files outside the host app’s sandbox with the open and move actions. This extension (sometimes shortened here to file provider) also allows the host app to download files without presenting a document picker view controller. This feature lets the host app access previously opened documents using secure URL bookmarks, even if those files are no longer stored on the device.
On the surface this seems like a really solid solution. My main concern stems from the last couple lines where it state that the application can download the files no longer stored on the device. I want the files to be stored locally on the device to prevent constant downloading. If the Document Provider does store the files locally and allow the various applications in the group to access the files, then I think this could work.
2. Shared Keychain Access
Allows you to securely store data to a shared keychain that other applications that are part of a suite of applications can access. All applications that share keychain access must use the same app ID prefix. For an example of shared keychain access in action.
I've looked a little into the documentation of this one, and I think this might be the best fit. My major concern with this solution is whether or not there is a size limit to the data uploaded and if mp3/ogg/json file types are allowed. Most the examples/uses I have found with this solution point to sharing strings and small data, I am not sure if it will handle large data like json or audio files.
I also found this repo that apparently makes dealing with Keychain easier:
3. Custom Pasteboards
The custom pasteboard is best for the purpose of semi-privately sharing custom data between two applications. Custom pasteboards are identified using unique names. They can persist data beyond the application that creates them, allowing a pasteboard to hold onto data after the application is terminated or even after rebooting the device.
When writing or reading data to and from a pasteboard, you must specify a pasteboard type. Pasteboard types typically use a uniform type identifier (UTI) to identify the type of data going into and being retrieved from the pasteboard. See Apple’s UIPasteboard Class Reference documentation for additional information.
Above documentation pulled from this post
My main concern with this solution is that perhaps it is a bit of a hack. Logically a pasteboard seems like something that temporarily holds data and allows sharing between apps, whereas the solution I am looking for needs to be more of a permanent solution.
I'd appreciate any info on best practices towards sharing these types of files between apps. I assume there are plenty of other solutions I've omitted here, so if there is a better alternative I'd love some info on it. If it happens one of the listed solutions I have placed here is a good way to solve this problem I'd love to have some more info on your experience with working with them and if my concerns with them are valid, or nothing to worry about.
Thx in advance. As always, well written answers get up-votes ;)
I believe the best approach would be to enable data sharing by setting up an app group. This is Apple's recommended solution for sharing data between applications and extensions, and I believe for sharing data between apps in general.
See the section "Sharing Data with Your Containing App"
Also see "Adding an App to an App Group":

iOS data sharing to Google Apps for social features: Workable?

I'm putting on my thinking cap for this one, looking for a high level overview of possibility. I'm the author of an iPhone app that tracks user generated statistics. Data is essentially stored in a table on the device, with each entry having several fields/columns. Users can then sort that data, view graphs, and do other nerdy number crunching stuff. I want to take it farther and incorporate a sharing platform online. Game Center, Open Feint and other third party platforms are too narrow in scope. I'm interested in writing a web app, that users can visit to do three things:
Post New Table entries (automated by device)
View own entries and share via web (read only)
View other members table entries (read only)
Is Google App Engine a viable solution for this? My iOS app will require a POST URL, and the web app will need to save that authenticated user's data, and possibly return an "identifier" value to be referenced in the future in case the user needs to modify the item on the web. It will also require a GET URL to retrieve the authenticated user's statistics one by one or in total.
Next, the user will be able to visit the website and type in a "username" (probably email address) and see read-only statistics that have been submitted.
Thank you in advance for your input.
Sure, you could do all that with App Engine. If you wanted to, you could even make that local table of data sync with your app on GAE.
Really, there's not much on GAE that you can't do, although sometimes the database layer take some time to get used to.
My personal preference would be to set up a Django instance, but you could use any Python or Java-based app, depending on what you're comfortable with.
In short, yeah, you won't have any trouble doing basic REST work with GAE, and you could probably push it harder to do some more number crunching on those stats.

Pre-existing Core-Data data

I've looked around for this but haven't found what I'm looking for. I need some data to basically come pre-loaded in the app. I know that I could just put it all in on the first launch but would like to stay away from a long load time on the first launch and have it already loaded.
Is it possible to insert entities into core-data so that they are hard-coded in?
Yeah, you include a a pre-filled data store in your app bundle and copy it from the bundle to the documents directory as part of the app launch process - check if the data store exists and, if not, do the copy. You do this prior to accessing the Core Data stack for the first time.
There are a few ways you could do this. The lazy programmer way is to enter your default data into the app, either on the phone or in the simulator, grab the data store file, and include it in your Xcode project. The downside is it doesn't work well if you need to go back and edit the data model later.
The other option is to create an editor app on the Mac that uses the same Core Data model as your iPhone app (they're compatible) and edit the data in your Mac app. Jeff Lamarche talks a bit about this in one of his blog postings. I've done something similar, except I wrote a command line tool to download the latest data from a web site (in my case, XML data) and parse the XML into NSManagedObjects.
This StackOverflow post talks about a bit more complex option of having two data stores - one for your system data and one for your user data - and letting Core Data use both stores at runtime.

How do I create a development tool to create custom object instances for iphone os

I'm setting out to create an app where it will use 7-10 instances of a custom class, lets call them "books" each class will consist of a number of pages, a title, a int of how many pages a book contains and possibly some notes of the author associated with a specific page.
My question is what is the best way of creating these objects. it seems weak to just hard-code all the books together programatically, and if there are more added after the initial release I'd almost like to have the author be able to construct them with a simple desktop app.
So I guess what I'm looking for is a way to a create a small app to create instances of a custom class on a desktop, then bring those instances into the iphone app.
I only have an iphone dev license as far as I know. Obviously you don't have to be super specific but I'm looking for ways to accomplish this type of task. Maybe if there is a good way to go about hard coding them I would like to hear about that as well.
I guess an equivalent would be a game developer making like a level editor for his game so he doesn't have to create the boards programatically.
Provide your data in XML or JSON
format (or whatever flavour of file
format you prefer), this is to transfer data to/from application.
Parse your data file (xml/json) and store in permanent storage (file,sqlite,core data) on phone. This is the data that your application will regularly use from now on.
Offer user the option to get updates over network
If user selects to get updates, download updated xml/jason file over network, parse and update your permanent store
Use SQLite. You could easily create a sqlite database editor, or use some of the free ones out there. The iPhone can read a sqlite database natively, just include the library.