Downloading content on app's first launch - ios

Working on an app which is relying heavily to download content (images and sound files) from the server while the app is launched for the first time. It may take awhile depending on the connection speed. Just wondering if that delay may cause my app to be rejected by AppStore review team? Though, be assured that I will display proper user feedback view to show progress indicator while the content is being downloaded. Kindly, share your valuable insights. Thanks

What you should do is show a first view in which you show the status of the download. Once the download is complete yo move to the firs controller of your app. You could save a variable to know that the initial download has already been done, and int future openings not go
through the downloading view.

Related

Without publishing the app on appstore, how to push updates for my iOS application?

After publishing the app on appstore, is there a way to push the changes in the view/layout, also the underlying functionality of the settings screen(or any other screen) without having user to update the app from app store.
No , there is no way to accomplish this you have to create and upload a new build for every view/layout update , your issue is possible if you previously embed that logic inside the uploaded version and dynamically do this according to server responses which is not a recommended way
Think of it this way: There are many, many apps that download changing data and display it in a tableview or collection view. Different text, images, etc. That is, in effect, changing the app without submitting an update.
Depending on what exactly you want to do, it may be fairly straight-forward or it may be complex.
For example, you may have a section of code that lays out an "options" screen, and you decide to add a new option. Your app could connect to a server, download a "configuration" file, and then have your code re-layout the screen as needed.
So, sure, it's possible - you just need to plan ahead and code your app for that flexibility.
One note, however: if you're thinking of significant changes to your app's design and/or functionality, you may run into issues with Apple's guidelines. For example, don't use that idea to try and "get around" having your app rejected for inappropriate content (such as having a "hidden" gambling section that would only be revealed after the app has been published).

How to periodically clear NSCache in swift?

I'm struggling to think of a good solution here. So, in my app, I have a UITableView that loads user data, and each cell has a profile image UIImageView. So, every single time it's looping through the cells, it's individually downloading the profile pic for each user. For THIS reason, I started using NSCache to store the profile pics. This worked tremendously, and now the lag is gone.
However, what if someone changes their profile pic? The profile pics are uploaded in backend one per user. I use User ID to reference these profile pics. If someone changes their profile pic, it will just load the image I have in the cache, and not their new image. So, I want to have the entire cache on the IOS device cleared like once every 3 hours, or so. That will cure everything. How do you clear the entire NSCache at intervals?
TL;DR:
How would I clear the whole NSCache for an app at time intervals? (example: have the app cache cleared every 3 hours)
You could use the app delegate methods and implement a check every time the user enters foreground of the app. You could keep a variable that holds the last time the user opened the app and if the current time is 3 hours past then, clear the cache.
As stated in the comments, most users will not have 3 hour sessions.
On a side note: Most users may understand images not updating immediately, For instance, I know twitter takes awhile to update. In my app, I leave the cache alone and re-download all images any time the app is completely quit. If you compress the images before putting them on the server this won't hurt data usage to bad.

Make changes to app w/o update

I was wondering how it works to make changes to an app without re-uploading the binary and go through the whole process again. I have got an example for it:
The developer of Whatsapp made changes to his app twice already, just today for the second time. This "update" included the blue indicators which show wether the chat-partner read your message or not. The 1st time I noticed changes to the app without an update was when he introduced voice messages.
Does anyone have an idea how this works?
You can use Google Tag Manager to make simple tweaks to your app without having to update the entire app. Here is an overview of how it can work (I've used this on Android apps)
Suppose your app's interface is supplied in whole or in part from a server - i.e., it's really a web view showing HTML that you are serving. Then you can just change the code on the server.

Sending screenhots to server immediately on background

I have two questions:
Is it possible to create an app that upload screenshots to a server when the user takes one? It should also upload screenshots when another app is active.
If an app like this is possible, will apple allow this to their appstore?
I want to create an app like this to provide remote support to users so that we know what the user see on their device.
You can detect when a screenshot is done: https://stackoverflow.com/a/18158483/1034126
And then programatically take another one and upload to the server: https://stackoverflow.com/a/2203293/1034126
But I don't think that's a good approach. You shouldn't need to take an screenshot to upload one, you can use a UIButtonto trigger the programatic screenshot and then upload it to the server.

How to send in-app announcements to people using my iOS app?

I have a couple apps on the Apple App Store and would like some way to send announcements to users whenever I want. Basically, I want to remotely change the text of an IUAlertview and only trigger it to appear if I want it to (upon app opening and only if I updated the message).
So far I have no problem making the IUAlertview appear on when the app opens, and I can easily program an NSUserDefault flag to only make the IUAlertview appear under certain circumstances, but really have no idea how to dynamically change the UIAlertview text without resubmitting my app to Apple continuously.
Can someone please explain how this is done? Thanks!
One way to do this is to have your app periodically (or upon each launch) check a file on a website that you control and if there is changed text (or a version number, or newer date than the last time an alert was displayed) there, then display that changed text in your UIAlertView.

Resources