How does Instagram check if the users contact are using the application? - swift

In the Instagram app you are able to sychronize your contacts and than the app shows which of them use the application. They are probably using the Contacts framework. Are they fetching the numbers of all contacts and than comparing them in their database?

Yes, once you allow to give access to your contacts. Step #1 is to sync your contacts with their server and they checkout in their database, if any of your contact already using the app (registered to app with that mobile number), they show it for you to better getting in touch with them, otherwise shows you an option to invite them to get started.

Related

Can you use CloudKit to access a user's contacts from a React/Django project?

I have a react/django project and we need to somehow access the contacts of our users. I was told to look into CloudKit's API in order to take care of this, however there seems to be no real information in their docs or in my Google searches on using this API to specifically access a user's contacts.
I am open to other suggestions as well. The ideal would be to access their contacts initially and then every so often compare their contacts to our list to see if any have been added.
You cannot access this data from a third-party app via a CloudKit API.
While Apple does store a user's contacts on CloudKit, they do so under these conditions:
The user opts-in to sync their contacts with iCloud (this isn't required for iOS users; they can be on-device only, or sync with another service like Google).
The contacts Apple stores on CloudKit are in a container that is private to Apple.
When you use CloudKit as a developer, you are creating a container for your app. You can only access data in containers you create.
Here's what you would have to do:
Create an iOS or macOS app that requests/manages access to the user's contacts.
Add the Contacts entitlement to your target in Xcode: Signing & Capabilities > App Sandbox > App Data > Contacts
Use Apple's Contacts framework to access contact data using Swift in your iOS/macOS app.
Once you have the data in your Swift app, communicate with your Django API to do what you need to.
One last thing. If you choose to go this route, you will have to reveal in your app privacy disclosures (in App Store Connect) what you are doing with the users' data.

Flutter: Get list of contacts only signed up in my flutter app using Firebase Auth (like WhatsApp)

I build an application similar to the chat applications, the user signup via the phone number using the Firebase Auth.
How I can create a list of the contacts stored by the user in their phone that is signed up in the application, such as those in the WhatsApp application.
How to fetch the phone contacts is already answered here Fetching contacts in flutter
Now you need think of your own way how you would create a list of those contacts which are also using the app. One option would be to make a query to your database for each phone number of the devices contact list and if its in the database you know this contact is also signed up, so you can add it to your list.

How do I open the Contacts app Swift

Is there a URL to open the contacts application from within my application? I know you can achieve this with the settings app by using the UIApplicationOpenSettingsURLString constant in Swift; however, I wasn't sure if I could do the same with the Contacts app.
There isn't a deep link for opening the Contacts App.
Apple is very picky when it comes to deep-linking. They have to provide one for Settings since many apps need services like Data, Location, Bluetooth, Wifi, etc.
Unfortunately they do not extend this to the Contacts App.
However if your app needs contact information then for that Apple has provided a Contacts framework to browse through your contacts within your app itself.
Read more about it here.
In order to add/update/delete/merge contacts directly from your app without using the Apple's Contact UI, use the CNSaveRequest APIs. More on that here.
The closest thing you can get to opening a contact is to write them a message in IMessage. From this screen the user can press the contact icon and open the contact page for that particular contact.
You can do this by opening the url sms://+44776382223 where the number is the number of the person that you would like to view the contact of.

How I verify that user installed an iPhone app?

We provide advertising capabilities to iPhone app customers, where they can advertise apps to millions of users on social network, and stand out among large number of apps in app store.
Now, to prove the ROI, we also want to provide statistics of how many users actually installed the app using our advertisements on social network.
My question is:
How do I verify whether user installed an app (when user clicks on advertisement and we take user to App Store (on mobile device) or itunes page (on PC/Mac) )
Is there a way to integrate with developer's interface to get this information?
Thanks in advance.
This is a broad question and there are some simple solutions which may require some work. Apple provides you no feedback for when an app is installed. Assuming you are storing the click of the ad on a server you will need to match to that click with something you send up when the app is opened for the first time.
(if the ad is shown in a native app on the phone) You can send up a unique key when the click happens and also send that same unique key when the app opens for the first time and match them on the server. This key can be a hashed mac address or something you save to the UIPasteboard. This requires integration on the side of your clients app because they will need to send a http request to you when the app launches.
If the social network is web based then your best bet is to match on IP address which isn't perfect but can give you a high percentage of accuracy.
I guess I'm assuming you are hosting the ads though. If you are not then you will have to rely on what the ad networks give you and many of them can provide some form of install tracking.
Well, you can always look at that persons phone and check if your app is present there :P
Just kidding.
You have some ways to get information such as these.
If you have registration in your app, you can monitor the userInfo, along with the UDID.
You can setup some webservice calls on applicationDidFinishLaunching for the first time events (using NSUserDefaults key to save the first time info) and use that.
Check out FLURRY for data analytics in your app. This is an awesome service, and allows you to track your users and how they interact with your app. I would recommend this !
Most ad networks have conversion tracking capabilities, but once you click an ad from the web and go to iTunes, all hope is lost tracking a conversion.
I guess you'd be able to track a conversion if you require the user to provide information (like an email address) before directing them to the appstore then requiring them to input that same email once the app is opened.

Send a message between application users

I want to write a facebook app in which I'll show a list of the people who gave permission to use the app.
Each user would be able to pick another user from the list and send them a message from the app.
Is there any facebook api call I can use? Or I have to develop a stand alone messaging system?