How to fetch only WhatsApp Contacts from iPhone Contacts? - ios

How can I fetch only WhatsApp contacts from iPhone contact list using swift.
I fetched contacts information from my phone got following response:
whats app contact
<CNContact: 0x13bd92310: identifier=04B80557-011F-4437-B132-43E2B0D70CD9, givenName=Tech, familyName=.vijaykart, organizationName=, phoneNumbers=("<CNLabeledValue: 0x170661e80: identifier=579A8A18-F113-4C6E-878A-68D18BFE4A8B, label=_$!<Mobile>!$_, value=<CNPhoneNumber: 0x17023f420: countryCode=in, digits=+919791291980>>"), emailAddresses=(not fetched), postalAddresses=(not fetched)>
Non WhatsApp contact
<CNContact: 0x13bd808d0: identifier=E09E916A-7829-4288-8731-A3789FA75F18, givenName=Kcm, familyName=Milk, organizationName=, phoneNumbers=("<CNLabeledValue: 0x174264bc0: identifier=CCF42FEB-2062-4425-81B9-1BF9EABE771C, label=_$!<Mobile>!$_, value=<CNPhoneNumber: 0x17422ddc0: countryCode=in, digits=+919443551702>>"),emailAddresses=(not fetched), postalAddresses=(not fetched)>
But not able to detect if it's WhatsApp contact or not.

Yes according to #Bittoo who have commented above is rit, It is not possible to get only WhatsApp contact, IOS Not allowed you to get others data within the app without the apps permission, if suppose WhatsApp provides their sdk like FB or instagram then it may allowed you through their sdk, if user phone has whatsapp installed, then through their sdk, they may allow you to get their contacts.

Related

I can see/send invites to non-app user friends on canvas app but not on android/ios

I am using the facebook sdk for unity and testing out app requests using the following call:
FB.AppRequest(
FriendSelectorMessage,
null,
FriendSelectorFiltersArr,
excludeIds,
maxRecipients,
FriendSelectorData,
FriendSelectorTitle,
Callback
);
The above call returns a native invite dialog list of all my friends when testing in the canvas version of the app, however when I compile for android/Ios, I only get a list of friends who have played the app??
Is there anyway I can see all friends on ios/android as well?

UIActivityViewController not showing facebook and twitter in iOS 8

I need to share two things:
1. Audio file
2. Image file
I am passing local paths as items to the UIActivityViewController. Previously on iOS 7 it was showing all required options like SMS, Mail, Facebook, Twitter. If I choose SMS or Email it attaches photo and audio both. If I choose Facebook or Twitter it shares photo only that is fine to me.
Now on iOS 8 it just shows SMS and Email. Why here it is not showing Facebook and Twitter like iOS7?

Facebook Unity SDK ,me?fields=invitable_friends not working on iOS

My facebook sdk 5.1.0, Unity 4.5.2f1
Platform is iOS.
I want invite my facebook friend to use my app just like "Candy Crush Saga" or "FarmVille 2"
can get my all friends ,display them on custom UI and invite them to play app.
But I have problem getting friend list and setting custom UI.
using facebook unity example, it can get friends and send invite, but I can't get these info and it can't custom UI;
when facebook login , i get user_friends permission.
I can't use invitable_friends to get friend list,
but "me?fields=friends" can get friends already use my app.
My login and get invitable_friend code:
FB.Login("email,publish_actions,user_about_me,user_friends,basic_info", LoginCallback);
...
FB.API("me?fields=invitable_friends.limit(10)", Facebook.HttpMethod.GET, InvitableFriendsCallBack);
How do i get friends not play my app then send app invite?
edit:
when login on ios, I get error "FBLogin error".
You can't get friends, who doesn't play your game with iOS game. https://developers.facebook.com/docs/games/invitable-friends/v2.2
The invitable_friends API is only available for games that have a Facebook Canvas app implementation using version 2.0 of the Graph API.
You may use FB.AppRequestto invite friends in game. https://developers.facebook.com/docs/unity/reference/current/FB.AppRequest

How to Show Tweet via [MyAppName] in Twitter when I tweet via SLComposeViewController iOS sdk

I have implemented to tweet by default ios sdk using SLComposeViewController ,
But In twitter , Its Shows via iOS by default,
How I can set my Appname, that it will show "via [MyAppName]" in twitter
I have already create app with same name of ios app in twitter and its only 5 character name,
My App is live on app store. Still It doesn't show via[My App name]
Please give feedback of any other suggestion or any idea you have.
I don't think you can do that using SLComposeViewController.
You'll need to have registered an "application" (AKA obtain an API key) on dev.twitter.com to use custom name in "via [MyAppName]" on Twitter.
After that, you can create your own custom view to post to Twitter.

iOS - How to have all facebook friends pre-selected for app request?

I have facebook app request implemented in my iOS app and I want all friends to be selected by default and let the user to deselect friends instead. Can we do that in iOS ?
Thanks in advance.

Resources