Fetching and Caching Users in IOS - swift

I'm building an app that includes real-time group chat where each chat has a "details page" that includes information like group name, time, location (mapview) and a tableview that lists all the participants. The app works like Whatsapp where your "friends" come from your local contacts, so when you login for the first time, all your local friends are saved to Realm. What I'm having a hard time with is how to manage the details page where there is a mix of users stored in Realm and some that need to be fetched (Eg. if you're added to a group with some people you don't know). My current solution loads the Realm users first then loads the others when they are fetched, and this happens each time the view appears. It's very clunky and isn't a very user-friendly experience.
Looking at Whatsapp, when viewing the details page for a group I have not opened before, the page has a slight delay before opening and then displays all the users in unison. After the initial viewing of the details page, any subsequent viewing does not have any delay and all the users are displayed right away (local friends or otherwise).
I'm sure there is some sort of caching involved but I'm not sure what type and where to start. Any input would be great, thanks!

Related

Different auth dialogs depending on user

I have created a new application and configured an "App on Facebook". The auth dialog looks different depending on the user trying to access the app.
The issue seems to be with different settings for the different users, but what is the cause?
I want every user to be presented with the first dialog.
Stackoverflow's login with Facebook is now showing the second type also. One issue I am seeing with this is that if you trigger a post to feed after getting the second dialog, the permissions are always set to "Me Only", no matter what is set in your app settings.
Facebook has a habit of testing out new changes across random users, so it may be that this is the explanation for some users seeing one dialog or the other.
In fact, half the people tested at my office received one dialog, and half the other.
This may be related: http://allfacebook.com/separate-screens-mobile-app-permission-requests_b115132

Facebook app how to post on users wall

I've developed an Facebook app: http://ek2012spel.startpagina.nl/. I've developed one before and the last time I've included the option to post a message on your wall whenever you scored a point.
But I noticed Facebook changed it's policy to prevent spamming to a wall. And I salute them for it. So I wanted to try something else.
Include a Like Button.
Only the people that press the Like button get news updates in their stream.
The news updates won't be automated. It will be me telling them a new round has started or something similar.
I'm pretty sure this is (or at least was) possible. Question is; how?
Should I create a seperate Facebook user for my app?
A new page (or is it called tab)? And link the Like button on my app to that page?
Sub issue: My current Like Button is linked to an (old) URL. The URL redirects to the new one. Any chance I can change the URL without losing all the likes?
That document was referring to an old App Profile page - these were removed in February -I've updated that doc to show the current way to create a page for your app (the option is now in the 'Advanced' tab of the app settings.)
Based on what you've said above, you should do one of the following:
Create a page for the app and get users to like it, and then use the page to post updates for the game's user
Use app to user requests to alert the user that something has happened - this will increment a counter in the user's bookmark for your app to bring them back to it
Obtain the user's email address from the API (needs the email permission) and email them directly.
Posting to user's timelines (/USER_ID/feed) automatically each time you have news to share will result in the spam filters shutting down your app very quickly indeed (bear in mind this will appear to all their friends as a message 'from' that user)

Steps for creating a facebook app that will allow our users to add the app as a tab on their page, provide an id and fetch the data from our server

I've had a hard time finding anything like what I'm trying to accomplish, seems as though FB updates their way of doing things every 6 months. The documentation I have found is hard to follow and I'm sure this can't be too hard. Here's what I'm trying to accomplish:
We operate a SaaS (in simple terms:) need to allow the user to provide a Form ID and return them a form via iFrame
Product management wants to be able to provide our customers with an app on Facebook where they would need to only add in their Form ID + Title, don't care about actual authentication with our product, just an ID to fetch.
The app would show up as a tab on their Facebook Page (and/or profile?) with the title of the tab showing what they entered and an iframe with the formId as the parameter to the source.. ie: the contents of that page tab would be a loaded iFrame: <iframe src="http://gotomyserver.com/fetch?FormId=123">
The idea is that our customers customers will see this form loaded up if they click on that tab on the page.
This doesn't seem like it should be overly complicated, however I'm having a lot of trouble finding information / understanding the documentation, or maybe I'm approaching it in the wrong manner?
Thanks
What you're trying to achieve is not possible at least because the same app can't have different titles depending on the page it is shown.
I would recommend you to make web application that serves the forms. Creating app everytime a user wants takes 5 minute. You will just need to insert in page tab url the corresponding address: http://gotomyserver.com/fetch?FormId=123 and set the title. Even your clients can do that by themselves.
Displaying an app to a facebook page takes an url copy/paste.

Is there a way to publish stories with links without a user being forced to add the content to the user's timeline?

I'm interested in creating an app on an external website that will publish logged-in user's article reads to their timeline. However, I've noticed that when a story is published to timeline, other users who are not connected with your app, are forced to "Add to Timeline". To me, this defeats the purpose because I want users who are not associated with our brand to discover our content and then add it to the timeline if they are a fan of ours. Is there a way to turn off this setting? or is everyone FORCED to add an app to the timeline before they can see the content?
for instance, when I click on a story posted by the Washington Post on someone's timeline, I get this screen -> http://dl.dropbox.com/u/1169963/timeline.png when I expected it to just bring me straight to the article. Most users are going to abandon the app at this point and never click on a Washington Post article again
and it looks like people are making browser plugins to stop this from happening:
http://techcrunch.com/2011/12/01/frictionless-kills-facebook-social-article-readers-dead/
so, is there a way for developers to prevent this all together?
What do you mean about FORCED ? If i give permissions, after app produces timeline posts, it will combine and show as an application box in my timeline. But before it, i can see my friends timeline apps without installing them. Also same in newsticker in news feed...
For example in my profile http://facebook.com/chaylock , you should see my NIVEA Mega Kutu timeline app without interacting app..

App insights drop for all games on 14-15th Sept?

I noticed that across all of my facebook apps there was a significant drop in users between 14th-15th September. After spending some time investigating any possible cause (as I had launched an update that day), and finding nothing, I looked on appdata.com and it seems that almost every game has this big drop on the same dates.
I have checked the blog and couldn't see anything obvious to say why this might be. Does anyone know the cause of this change in insights data? Or is this a bug?
They changed the way that the number of active users was calculated. According to here:
Facebook has changed the way it calculates the total monthly and daily active users (MAU and DAU) for apps on the social network, sending figures plummeting.
The adjustment means that users who choose not to authenticate after a permission dialog box is clicked, and those who visit an app but do not log in, will no longer be contribute towards active user counts.
As a result of the changes, some games have seen more than half of their previously reported user figures drop away (though these changes have made no difference to the actual traffic each game sees).
facebook changed how user's bookmarks appear on sept 13th, which meant that a lot of users that used to see your bookmark on the left side of their homepage no longer could. As of that date facebook seems to use way less space to list bookmarks, only showing bookmarks for apps you use a lot or have just used. The only way to counter this is to educate your users to set the bookmark for your app as a favorite, which gives that bookmark a permantent position (hopefully) forever in the top section of the left margin of their homepage.