Can a Meteor web app serve data to an iOS app? - ios

Pretty straight forward question i think. I have created a web app in meteor and its using mongoDB storage. I have UI to update the data in the backend through the web app.
The question then becomes, I have designed an iOS app that i would really love for it to read the data being served to the web app from the mongoDB. As it stands, the app takes a url to a JSON file that i update regularly and serializes it accordingly. I want to pass on the tasks of updating the backend but exposing company employees to the potential mess of JSON backend, where missing/deleting a bracket / brace causes the app to break is out of the question.
My question is, since the meteor web app stores data as JSON documents, is there a way i can access the same JSON from the iOS app? It would really help because then, the person updating the backend only deals with UI, not code. I know this is a pretty broad question, but any pointers would be fantastic. Links, tutorials, frameworks to learn... anything. I've been googling around but can't seem to find anything solid.
Thanks!

You'll want to look into using one of the many iOS based DDP clients, like this one. With these libraries you can connect native iOS apps to the backend of any deployed Meteor app.

As far as I understand, you are looking for a way to get/update the data of your meteor server from the IOS app.
To do that, you can expose an API, like a REST one. Basically, your IOS app will call your Meteor server via HTTP and send/receive JSON data. Like that, you can get your collections, update, add, delete their items as well. There is a lot of literature around REST.
I used a very old one that I do not recommend because it is not maintained anymore, I will put the link anyway Old Rest API.
I invite you to have a look at atmosphere, the meteor package library: Atmosphere. I did a quick search on it and I found this package that looks promising: Simple Rest.
Have a look at the packages on Atmosphere, you can use 'rest' as keyword and pick the one that fits your needs. I am especially thinking of security ;).

Related

How would I go about building and hosting my own backend for an iOS application?

As a preface: I want to do this as a learning exercise. I'm not trying to produce a commercially viable app.
What are the layers/abstractions of an iOS application that is connected to a custom, self hosted backend? What technologies are needed to build this stack?
This post has helped my understanding a bit. I'm currently using Firebase as my backend but have found its NoSQL structure wrong for my app. The data I'm storing is relational, so I think an SQL database storing JSON would work better. The data is modeling Vehicles shared between Users.
From my research, the Realm Platform looks like a good choice. Am I understanding the technologies correctly here? Does this sentence make sense?
General functionality:
Sign Up and Login of users
Upload/download vehicle data
Some server side logic
Pushing data updates to users in real time
So would the stack look like the following?
User Front End: iOS app written in Swift
Database: Realm Database (SQL)
Server: Realm Object Server
I'm really looking for an overview of the general architecture. I don't know anything about that, so I'm sure I have failed to provide many details that are necessary for a thorough answer.
I apologize if this question is redundant; most answers I've seen for similar questions typically end with "just use AWS, Firebase, etc".
Thanks!
For a start you want to build your own backend and you should create your own API's that your IOS application will connect to. in short this is called REST api
https://www.sitepoint.com/developers-rest-api/
you will need to use many more technologies more than just a server like Apache
once you create your backend API you will need to connect it to the IOS app which can be done using NSURLSession builtin framework form Apple or Alamofire which is based on NSURLSession but its easer to use if you are learning
you will need to learn how to do an http/https request to understand how the request is made
check this
https://medium.com/#MuraliKathir/build-a-simple-api-search-with-alamofire-and-swiftyjson-80286e833315
Now to Realm. Realm is a local database that will be inside of your IOS app which helps you save data downloaded online or even user generated
https://realm.io/docs/swift/latest/#queries

how to use external API with rails

After making a bunch of CRUD-like apps, I've decided to venture out a bit and play with APIS. The Riot game API seems pretty simple to implement, as it is just a link follow by my API key.
ex: https://na.api.pvp.net/api/lol/na/v1.4/summoner/by-name/RiotSchmick?api_key=<key>
after googling for quite a while yesterday, I am still at lost how I can integrate this information.
Where should I put the above link, how do I store the information from the JSON, and how exactly does the MVC structure fit into this?
If I'm not storing any data (no users, just instant display of info based on API) Do I even need a database?

Big Picture — What sort of feed for an iOS news app?

Alright — this sort of question shows my naïveté but I am asking it nonetheless so I don't venture down the wrong rabbit hole while trying out this app.
I'm making what amounts to a news app. Imagine taking a Wordpress blog and fitting it to iOS. Now, here's my question — what sort of feed / architecture should I be using to push information from my Wordpress server to my app? I would assume RSS using AFNetworking, but that seems to cause some rough edges, and all tutorials that I see end up pushing to a web view instead of a scrollview with nice, rendered text. Plus, none of the same tutorials seem to have anything further than the initial feed (loading more than the initial 10 stories given, for example).
I've already committed a few hours to trying the RSS / AFNetworking approach, but is there a significantly better alternative that I just haven't come across. (Note that I do have access to the back-end of my Wordpress site, i.e. it isn't somebody else's)
If you are building an iOS app that connects to WordPress, I suggest you to access the website data by an API instead of feed, then you can hit the API from your app and manipulate the data as you want.
If you have access to the WordPress backend, check the Thermal API which is a plugin that will probably solve your problem.
Cheers,
I would suggest that you look at https://wordpress.org/plugins/json-rest-api/ this is to be added to the core of wordpress so it would seem that is the way to go I think.
By the way I am working on the same type of thing as you.
I think the most popular Wordpress API is the one that comes with Jetpack. You can find its documentation here: https://developer.wordpress.com/docs/api/
If you just want read access, then i think the easiest way to do so is by using: https://github.com/evermeer/AlamofireJsonToObjects/blob/master/AlamofireJsonToObjectsTests/WordpressTest.swift
If you also want write access, then you have to implement Oauth2. For that you can select a library from: https://cocoapods.org/?q=oauth

How would I create an app for a website that does not have an API and uses ASP.NET?

Basically what I'm looking to do is to create an native interface for a website that does not have any sort of API. This would be a 3rd party app that would provide all the same functionality of the website, just optimized for iOS. The real problem I run into is in sending and getting user-entered data to the website as it is using ASP.NET which I am not at all familiar with and the user would need to log-in to the website.
This is kind of a convoluted question, but I am sitting at square one and not even really sure where to go from here.
It sounds like you are asking if you can create an iOS app that can interact with another website that doesn't have an API? If my understanding is correct, then there's really only one option I can think of.
You would have to make your iOS app make HTTP(S) calls to the ASP.NET based website and simulate GET/POST requests as if it were a "real" user. You would do this by using one of the native iOS HTTP clients (NSURLSession, for example) and would have to strip and parse the HTML you received back from the website in order to get the raw "data" required for your iOS app.
The situation you are describing is pretty complex and very brittle (you have to make a change to your iOS app every time any change is made to the ASP.NET website) and I would avoid this method of integration at all cost.

iOS app without API, alternatives?

Im thinking about learn to develop app for iOS. I had a lot of ideas, but most of them i would need the API of that website. For example: http://www.filmaffinity.com/en/main.html
The point is: is there any other possibility of collect/use information of a site without the API, anything else without the typical parsing or scraping?
Thanks you
To get the most up to date information to your users, you would need to use the API. If you want to store the data locally, you could do some initial scraping and build up your own database and distribute it within your app. This approach is not ideal because your data may become out of date quickly (unless you have a database update mechanism) and the owners of the sites you are scraping may not take too kindly on the matter

Resources