Using sockets to build real time chat for iOS? - ios

If I wanted to build a real time chat app for iOS using Objective-C, what would be the best way of going about it?

Assuming you've got your server side things setup, you can use Square's Socket Rocket to implement the client side https://github.com/square/SocketRocket
If you're using socket.io at the backend, there are plenty of iOS libraries available for those as well. SIOSocket is one such library.

Maybe I am just lazy, but I do not see a point in building it all from scratch.
There are a plenty of backend providers who will be happy to provide you with ready backend and a library for building your app.
So, you'll just need to connect the solution to your project and make UI according to your needs.
Here are some backend providers you might consider:
ConnectyCube
Firebase
Sendbird
Layer
etc.
They provide different set of features, so I'd recommend checking those they provide first.
This article might be of some help as well.
Some of them like ConnectyCube can provide you also with development services, so you can order UI development according to your mockup design from them too.

Related

How to use Google Tag Manager for iOS (swift) with GCP Recommendations AI?

We are planning to make a recommendations engine for the features in the app and we were thinking about using GCP Recommendations AI. Then, we ran into some unclear areas due to lack of examples.
Can we use Google Tag Manager for iOS (with Firebase Analytics) to send real-time event data to GCP Recommendations AI? Could you please provide some docs/examples/articles that explains how (We are using Swift to code the app)? It is possible for web sites, according to the docs.
You can not. Unless it's not a native app.
If it is a web-app, then sure you can use the power of JS to send whatever you need to any endpoint. We use Segment for real time personalization, but even that requires quite a lot of involvement from the app teams. And no, GTM is not helpful for native apps.
If you already have custom analytics tracking implemented in your app, then there's a high chance that the devs used a wrapper around the firebase/gtm sdk to send events in a more comfortable way or add adequate logging. In that wrapper then, the devs could implement the event streaming to your GCP recommendations AI in case it has the capability to store data.
If it does not, you can still set up a neat app engine (or a differnet endpoint) and stream data to it. The app engine would allow you to tweak, sanitize and debug the data, after which you can stream them to something like Big Query, which your Recommendation AI would likely to be happy to work with.
I'm talking about app engine and big query because there's a nice repo I've used a few years ago... Here: https://github.com/MarkEdmondson1234/ga-bq-stream
This repo is attempting to use front-end GTM to stream events, but you won't be able to use it (unless you're dealing with a web app). So instead, you stream them in a very similar way from your analytics wrapper.

Blocking all connections to a specific domain only

I've been struggling to find how I could potentially implement a simple (iOS) app that would be able to block all connections to a specific domain (to prevent the user from accessing a specific social media platform for example, even from another app).
The information that I have found so far is that I should probably create a Packet Tunnel Provider within a Network Extension and ask the user to add VPN configurations, but I haven't found any example code that would show exactly how to implement this.
Do you have any idea how I could do that in a simple way (block all connections to a specific domain)? Is there a framework/library that I could use to do it easily?
Thank you!
Well, it would not be easy, but you can do it.
Sample code from Apple could be found here and here. This project is for iOS, but it may be on deprecated Swift version, so you will need to do some work to launch it now.
The part you are interested in the SimpleTunnel sample is FilterDataProvider and FilterControlProvider, other things you can omit, because the purpose of this sample is to demonstrate a lot of abilities.
There is also a sample for macOS that is more focused on your needs, and macOS SDK is alike to iOS, but less powerful.
You may want to see this video to sort things up in mind.
There are a lot of firewalls solutions for ios and mac, and some of them are opensource
The part you are interested in the SimpleTunnel sample is FilterDataProvider and FilterControlProvider, other things you can omit, because the purpose of this sample is to demonstrate a lot of abilities.
You will need a developer account, a network extension capability assigned to an application identity, and proper network extension entitlement file a to run things up.
There is a way to sign it manually for development without account&capability, but to distribute you will need it anyway.
For some restrictions you may be needed to install MDM profile on the device.

How to get everyone to see everyone else's photos in an instagram-like app

I am a first time iOS developer trying to build an iOS app from the ground up. It is for a photo-sharing startup that will have similar functionality to Instagram.
I am not sure how to approach the sharing/viewing aspect. Would I use something like Parse or Google cloud storage? It is an iOS only app, if that helps. Given that we are just a startup, a long trial or a cost per GB is fine, but I don't want to be stuck with something expensive if we start getting a lot of photo uploads.
Given that I'm the only developer, I'm hoping for something that doesn't require me to learn too many new technologies. Any help would be greatly appreciated!
Parse.com, the API is fairly easy to use. The free plan has a lot of functionality and it scales up well.
That's really a tough question. You first want to research each company and weigh the pros and cons with selecting each service. The Google Cloud and Google App Engine (while they do work extremely well together) are going to be a little less "centralized" since they are essentially marketed as separate services. Parse does have that "centralized" feeling since all of their services are designed to work together.
Another nice thing about Parse is that it has build in support for iOS local datastore which means even if your users don't have an internet connection the request will be queued until a connection is made. If you go with a service like the Google Cloud then you would have to implement that on your own or just not have offline functionality.
While Parse looks like a good solution for you, it would be hard for someone to answer your question with a definitive solution as that is up to you exactly how you want your product to work. Just continue to research other solutions as there may be something better and more suited for your exact needs. You may want to build a small prototype on one platform before dedicating all of your development to that platform.

hybrid mobile app development features

I am developing one mobile app, the requirement is as follows.
1.The app should work offline and online.
2.It should have database in both local device and in the server.
3.When internet is on data has to be synced between local and server.
4.At any point of time local data and server data should be the same.
I have done lot of research on this but not able to find whether hybrid app development supports or not. Some one says we can do but other link says it's difficult and might not be possible.
Please help to me sort out this issue.Thanks in advance
for sure it is possible to have those features in an hybrid app. All depend what you choose to use to deal with that or how you choose to program it.
Remember than an hybrid app have almost all features that a web application could have as it could use almost all technologies, tricks, frameworks and libraries out there.
I have already developed an hybrid mobile app using cordova, jquery and jquery mobile that meet points 1 to 3. Though I am not saying you need to use jquery, or any of the other tools. I described the solutions I use for that app, however they are maybe not the best but it was the most practical and easiest solutions given the time frame and budget.
Was achieved by mirroring the server "data base" the first time the app is installed with WiFi access. When no internet is available the the app use the local data, when it is available then it take the data from the server and update the local data.
The local database was not a formal one, just JSON data files, very similar to the ones provided by the web service.
You can be checking for an active internet connection with the cordova network functions, once detected try to reach the server to check if the actual connection is working, on success then proceed to request mirroring the data. Just be sure to check if the local data is newer to the server one and instead of overriding you should first update the changes in the server.
I think this point is a bit difficult given the fact that you want to work offline. When you are offline you couldnĀ“t do too much to reflect the server data into the app, as you are offline. Then having an exact mirror at any time is not feasible. However having a mirror when you have connection then that is another story.
Having a perfect data sync should be done carefully and instead of programming you own solution try to use a service or tools for that, like http://www.couchbase.com/mobile.
Hope it helps.
Hybrid applications are, at core, websites packaged into a native wrapper. They look and feel like a native app. Hybrid app have main features are portability (one code base, multiple platforms), Access to various hardware/software capabilties, cheaper orginigation costs, faster speed to market.

Native Windows Phone app vs Jquery Mobile + PhoneGap?

I am new to mobile programming, and I want to build a mobile app to fill few forms, offline, and then sync them later, when internet access is available, with a database on an online server through a VPN connection.
At first, I thought about learning Windows8 Phone App development, but then I heard/read about Phonegap and Jquery Mobile! and I am a bit confused which one would be better to use, considering two things:
1- Which one you think would be good for my app's functionality
2- Which tool would be more beneficial on the long run (in the mobile programming world).
Any advice would be very much appreciated.
With these functionality I don't thing you don't need many mobile dependent features rather you need more web features. For your first question, answer could be that technology in which you are more comfortable. But it also depends how you want to sync your data. In background or when the app is open. If you want to sync data in background that means app is closed, you have some data to send in server, and internet access is there, then you'll need some native windows phone code. In that case if you use phonegap ultimately you will need some native code to deal with it, may be you'll need to write a plugin to communicate between phonegap and native code. And if you don't need background process, if you want to send data to server only when your app is opened,phonegap can work like a charm. It'll be easy to communicate between 2 web technology.
For your second question, ofcourse phonegap is great technology to learn to deal with cross platform. If you need to make apps not only for WP rather for all platforms then phonegap is great. Having said that it's necessary to mention phonegap has it's quirks too. Native code always has it's benefit. Phonegap can't completely overcome native code. But if you are willing to compromise a bit, then it's easy to learn phonegap,a familiar tech than all those platform dependent techs like objective-c, android etc.
(N.B. I'm not an expert, it's just my experience so far)

Resources