How to use "Source" property in VCard? - ios

I stumbled upon a seemingly awesome feature in the VCard Specification, specifically the "SOURCE" property as specified in https://www.rfc-editor.org/rfc/rfc6350#section-6.1.3. The claim is that you can provide a URI and that is the location where applications can sync the contact. I would like to use this feature in an app I am developing, but I can't seem to get it to work. Specifically, when I add a contact in my phone (iOS contacts app) with the "SOURCE" field, it doesn't appear to be used. When I change the data pointed to in the URL, my phone app never picks up the change. Does this mean that my developer friends at Apple did not implement this feature in the contacts app, or is the source field not what I think it is? Using an example from the wiki page:
BEGIN:VCARD
VERSION:4.0
N:Gump;Forrest;;Mr.;
FN:Forrest Gump
ORG:Bubba Gump Shrimp Co.
TITLE:Shrimp Man
PHOTO;MEDIATYPE=image/gif:http://www.example.com/dir_photos/my_photo.gif
TEL;TYPE=work,voice;VALUE=uri:tel:+1-111-555-1212
TEL;TYPE=home,voice;VALUE=uri:tel:+1-404-555-1212
ADR;TYPE=WORK;PREF=1;LABEL="100 Waters Edge\nBaytown\, LA 30314\nUnited States of America":;;100 Waters Edge;Baytown;LA;30314;United States of America
ADR;TYPE=HOME;LABEL="42 Plantation St.\nBaytown\, LA 30314\nUnited States of America":;;42 Plantation St.;Baytown;LA;30314;United States of America
EMAIL:forrestgump#example.com
SOURCE:http://directory.example.com/addressbooks/fgump/Forrest%20Gump.vcf
REV:20080424T195243Z
x-qq:21588891
END:VCARD
I thought that once I loaded this contact into the contact card, and then changed the name from "Forrest Gump" to "Jack Frost" that the card would eventually sync. However, I have seen no behavior. Is this some kind of placebo field?

I've always read the SOURCE property description in RFC6350 as being purely aspirational. To my knowledge (admittedly skimpy), no one has ever implemented an automated data store update using it. That's not to say that you couldn't implement the concept in your own code, but it might get unwieldy for more than a trivial number of contacts. As a place you can go to manually check for updates to contact information, though, it's a great property to have available.

Related

Best way to get user's country?

I'm about to start expanding my secondhand app, where people can put their used university books for sale.
Right now the app is only available in one country, but in the near future other scandinavian countries will follow.
As an example I want to expand to Sweden, the user should only be able to see/buy/sell books that are for sale in that country.
I have come up with 2 solutions, but none of them are quite good:
Location decides country.
User selects the country from a list.
I would like to hear your thoughts on this, since lots of apps do this - but I can't figure out how.
Why not a combination of both? Try the location services first, if for whatever reason they have location services turned off or don't allow it, have them select their country. The country selection should be one of the first prompts they are given when they open the app (if location services aren't on). Otherwise, before they are allowed to post any books for sale. In other words they shouldn't be allowed to put a book up for sales without the app knowing which country they are in.
Are you using swift (what version) or objective-c?
https://developer.apple.com/library/ios/documentation/CoreLocation/Reference/CLLocationManager_Class/
You'll need a list of countries: How do I get a list of countries in Swift ios?
If you are willing to pay some. You could look at a ip based Solution like the www.maxmind.com api. It Gives country info and more. And we bought 50.000 queries for 50 dollars. And as we check once per user, we did not even finísh our bought queries!
I believe your application should do a guesswork and provide easy-to-use alternative for the case when the guess was incorrect. Get the country by location or IP. When the user installs the app, show the selected country and make sure your user can easily change it both in the installer and in the app itself (if, for instance, one student moves from a country to the other).

How to get user's age category inside an iOS app?

The Apple App Store has some fairly strict requirements on what content an app can display and still meet the age ratings. I'd like to add a feature that can display content created by any 3rd party which means that, though "adult content" is not appropriate, it's not possible to guarantee that some spammer or vulgar person doesn't post inappropriate things.
I'm considering blocking access to that particular feature of the program for younger users.
How can an iOS app determine the age "category" of its user in order to choose what features to provide?
Other suggestions on how to deal with the issue of un-vetted 3rd party content is also welcome.
Ok so basically you want to know if there is a way to detect the users age and thus display certain features as is appropriate.
Well two ideas come to mind:
IDEA 1
You could try using the built in contacts API to see which contact the user has set themself as. If they have one, then check if it has a birth date. And thus figure out their age.
IDEA 2
Ask the user to enter their birth date in when they launch the app for the very first time. Then figure out the age and save it in a NSUserDefault. You can then use that value throughout the app to determine what features and posts to show the user.

Checking if app name is available

I'm trying to check if a certain app name is available on app store. I've tried it before and used this procedure: Related post
But it seems that they have made some changes to iTunes Connect (iCloud style), and now I'm not able to press "Create", without a bundle ID or SKU...
Has anyone found a workaround?
In terms of the specific name of the app, you can just search for the name on the store and see what comes up. Creating a unique name on the store is usually not difficult. Coming up with a unique name that does not violate anyone's trademark is the real challenge.
There is actually a benefit in making your app name detailed. For example, say you created an app for a concert hall called John's Concert Hall. The app could be named "John's Concert Hall - Tickets for Live Shows in Los Angeles". Your logo on the store and your in-app branding might just say "John's" but you choose the longer name for the store to make your app more searchable on the store. If you have a very strong brand like facebook, you might just name it "facebook" without any additional words. Just to be clear, your logo and branding might be different from what your app is actually called on the store.
You need to have a unique bundle identifier when submitting which is typically uses the app's name.
Just because your app's name is unique on the store does not necessarily mean it is legal for you to use. Your business' name needs to be unique in the business class that it is in per trademark law. So if there is another app named "John's Concerts," one could argue that your app's name creates confusion in the market place (i.e. someone looking for John's Concerts might stumble upon your app instead thinking it was the other app). Even if the owner of the other app does not have a formal trademark, if his app was on the store first he has a common law trademark by default, meaning you could receive a cease and desist letter. Say there was another app out there called "John's" involving music but not live performances. This could be a problem, but it is an unclear area of the law. The more general the class that you share with another app, the more murky it is, so the recommendation is always to make the core brand of the app (regardless of how it is named on the store) as unique as possible to avoid being sued later on. If you share any class with a similarly named app, you run the risk of being sued. A judge might rule in your favor, but you still run the risk of incurring a ton of legal fees.
To ensure your app is unique, the best advice is to run a ton of searches on google and at uspto.gov. A lawyer could charge you $500-$1,000 to do these searches for you and provide you with a book that informs you with all the potential problems for your name out there. No lawyer though will guarantee that your name is safe to use. What you are paying for is their expert opinion on how likely you are to being sued. Leave it to a lawyer to give you a non-answer ;-)
I did some poking at this, and found that the server will still tell you whether an app name is in use. You just have to work a little bit at it.
Go to iTunes Connect's create-an-app page/modal as normal.
Put the name you want to check in the name box, and select any of the language options:
Open Chrome's inspector (or whatever way your browser has to manipulate HTML).
Click the magnifying class icon (top left) and click the greyed-out 'submit' button, or find it manually (inside div.right-buttons). Remove the 'disabled' attribute:
Now click the submit button and find out whether the name is available - it'll be highlighted red (and show a tooltip when editing) if it isn't:

Custom replacement strings from third party app

Is there any ability to populate a learning module's content using data passed from a third party application. For example:
Third party data:
userid = 12, username = Sally, user_q1_answer = Jim, user_q2_answer
= 101
Module Content setup:
[[username]], since you are in room [[user_q1_answer]], you should
contact [[user_q2_answer]] in the event of the fire alarm going off.
Module Content Delivered:
Sally, since you are in room 101, you should contact Jim in the event of the fire alarm going off.
Thanks for any help
Currently, no facility in the LMS exists to do this kind of dynamic substitution at render time. A number of other questions here have covered this ground. As of Spring 2013, this kind of functionality is on the development roadmap but there is not yet a committed release vehicle for it.
It might be possible to use a client-side browser extension to detect specially formatted strings in page content and make Valence Learning Framework API calls to find values it can replace those strings with. However, this technique would probably only practically be able to replace values that are known about the current user and their relationship to the LMS. Through URL and page content examination, it might also be possible to gather knowledge about the user's current browsing context (i.e. what course or course section they're looking at), but we never recommend screen-scraping because you can't depend on meaningful tokens or data appearing reliably going forward (where as you can depend on the Learning Framework APIs to be able to get you information about the current operating user).

How does Path app know my phone number in the registration process

I started using Path, and noticed that in the registration process, they identified both my phone number and my email.
As far as I know, there is no way to programmatically get those values (without being rejected by apple), so how does path do it?
Moving my comments into an answer :)
As I've stated above, this is a duplicate of How does Square's CardCase app automatically populate the user's details from the address book?
Because Path asks beforehand for the first and last name it's easy to search for the contact in the address book. Of course one has to handle the case when a) no contact or b) multiple contacts are found. In both this cases I'd probably go with standard input fields, because for the "no contact found" case you need those anyway.
How common it is to have a contact with it's own name I don't know, but according to the Fact that Path and other apps are doing it the same way I suppose it's worth taking the risk :) AFAIK MacOS X automatically creates a contact with my name in the Address Book, but really can't recall if iOS has the same behavior.

Resources