I have an app with partial copying of native Contacts app functionality. Then, I meet such bug: on some devices, I create new contact, add phone number with kABPersonPhoneIPhoneLabel, save it and read later, the number has no label! When investigated, I found that issue occurs only if Exchange account contacts sync (Google in my case) is turned on. Also, check the list of labels to choose in cases when Exchange sync is ON and OFF. (please note, that you should have no contacts in address book)
Exchange is OFF, phone numbers available labels are:
mobile, iPhone, home, work, main, home fax, work fax, other fax,
pager, other
and user can add custom labels.
Exchange is ON, the labels are:
mobile, home, work, home fax, work fax, pager, assistant, car,
company main, radio
and user CAN NOT add custom labels
My app handle only standard labels, mentioned in first case.
So, the question is: how can I retrieve available labels list, and how to know is user allowed to add custom labels or no?
Thank you for answer, or any related info about this.
You can add labels with:
bool ABMultiValueAddValueAndLabel (
ABMutableMultiValueRef multiValue,
CFTypeRef value,
CFStringRef label,
ABMultiValueIdentifier *outIdentifier
);
Related
I'm doing a project where the Google Assistant generates a list of cards about information on research articles. Each card on the list would have the title and URL to the research article. The Google Assistant would ask what subject you wants to research about and the user would reply with the subject matter in one or two words. I have the following questions
I understand that the app.buildList() command requires an alias and key variable. Could I level them as blank or null in my code because I don't think I need them
If the user clicks on the URL in a card, will the browser automatically open the link? I remember reading that Google must filter and approve URLs in Google assistant apps
Any help would be appreciated
You should probably populate the relevant fields for each API call in order to handle various types of user inputs. The key is used to identify the item that is being said. If a list is shown, you will need to use the key to identify which is clicked. The user may click on the list item to select it. However, they could also say the thing they want. That is where the aliases are useful.
Let's say you were grabbing a list of scholarly articles. While long articles may not lend themselves well to voice, it could be designed like:
function list () {
const app = new DialogflowApp({request, response});
app.askWithList('Alright! Here are some articles about memristors! Which do you want?',
// Build a list
app.buildList('Memristor Research')
// Add the first item to the list
.addItems(app.buildOptionItem('TITLE_OF_FIRST_PAPER',
['title of first paper', 'first'])
.setTitle('Title of First Paper')
.setDescription('S. Smith, Ph. D')
// Add the second item to the list
.addItems(app.buildOptionItem('TITLE_OF_SECOND_PAPER',
['title of second paper', 'second'])
.setTitle('Title of Second Paper')
.setDescription('H. Paul, Ph. D')
)
);
}
In this snippet, if I say I want the first article, it will give me that one without me having to give the full title while still keeping the interaction hands-free. The key will let me identify the article that should be read.
You can use the title of the paper or perhaps the link URL in order to handle it and present a card with more information including the URL.
You do not need to have each URL manually approved. The documentation states:
Links to sites outside the developer's domain are allowed.
Link text cannot be misleading. This is checked in the approval process.
As long as you are being straightforward about it, users will be able to directly open the paper in a browser by clicking on the link in the card.
More information is available in the documentation
You can create list in action on google should have minimum of two values and maximum of 30 values.
For sample code here :
https://developers.google.com/actions/assistant/responses#sample_code_2
I want to delete contact of iphone manually(with number by number). Can anyone help me to do the same. I have done with deleting contact using method
ABAddressBookRemoveRecord(addressBook, record, nil);
This method makes me to delete a single contact with all of its record but I want to do delete manually means want to delete single number of the existing contact if it has multiple numbers. The given image says the requirement.
You Can refer following links which will be helpful to you......
http://www.xprogress.com/post-56-best-example-of-how-to-add-entry-to-contacts-using-addressbookui-framework-on-iphone-sdk/
http://www.modelmetrics.com/tomgersic/iphone-programming-adding-a-contact-to-the-iphone-address-book/
iOS - add contact into Contacts?
With the help of these links you can know to add contact to iphone OS programatically...
To resolve this problem you have to get the existing contact object(ABRecordRef object) which you have to update ,get the number property label object which contains all the numbers,remove the number which u want to delete from the ABMutableMultiValueRef of the numbers which u have to prepare.Then after doing all the stuffs... use following code...
ABRecordSetValue(person, kABPersonPhoneProperty, multiPhone,nil);
Then save the addressbook using following code....
ABAddressBookSave(iPhoneAddressBook, &error);
This code is on the basis of my R&D, try this it must work....Thanks!!!
In order to delete all contacts form iPhone, you have them syncing with another source (gmail, windows contacts, Yahoo, etc.) then in iTunes, select your iPhone under devices (left side), go to Info (top), deselect "Sync contacts with".
When you do this, it will ask you to remove your contacts or not. Click on "Remove Contacts", and then Apply (botton right).
If you don't have your contacts sync'd, then you can either setup a temporary sync to what service you have access to and then do the above, or do them one at a time.
I program with PHP and I'm familiar with getting data from PayPal's IPN. I need to send custom data to ebay and get it back when payment is made. For example, if sold 1 Widget on ebay and that widget has a stock number of 12345A, I receive data back from PayPal. I get things like customer's name, address, item name, etc. But, unless I include that stock number in my title, I don't see any way to get that data back from PayPal. I don't want to use ebay's limited title space for including my stock numbers. I realize I could do it if I had another database to store ebay's item numbers and cross reference them with my stock numbers, but I don't want to do that.
I have noticed that when data comes back from PayPal after an ebay sale, it includes the custom variable and that variable has a large number in assigned to it. I have no idea what that is. I've also tried using ebay's custom label feature that's found in Turbo Lister and Selling Manager Pro. I was hoping that would be sent back in PayPal's custom variable, but no luck. Any ideas?
As you've discovered, it looks like it's some internal id number uniquely identifying each eBay order. You can probably forget about specifying a value for this field as it isn't documented anywhere.
The best solution to your problem is to use the eBay API. GetSingleItem will return information about an item given the item id.
The ItemSpecifics list will contain any item specific data that the seller has entered about the product. In my case, I added a custom field called SKU to the eBay item. Just add itemspecifics to your include selector. The call can be executed with a GET request:
http://open.api.ebay.com/shopping?callname=GetSingleItem&IncludeSelector=ItemSpecifics&appid=YOURAPPID=515&ItemID=ITEMIDOFINTEREST
What you get back will contain those custom fields you added to your item:
..
<ItemSpecifics>
<NameValueList>
<Name>MPN</Name>
<Value>MyPartModelA</Value>
</NameValueList>
<NameValueList>
<Name>SKU</Name>
<Value>123-456</Value>
</NameValueList>
</ItemSpecifics>
..
I'm using the variables found on this page: https://developer.paypal.com/webapps/developer/docs/classic/paypal-payments-standard/integration-guide/Appx_websitestandard_htmlvariables/#id08A6HI0J0VU
to try to pre-populate the form data for buyers when they purchase things on my site. The trouble is, some of the fields are getting filled in, while others are not. First name, last name, telephone number, and email address work without a problem.
However, the country is always set to the USA, and address1, address2, city, and zip are left blank. I'm sure my code is correct. I'm currently using the sandbox for testing. Has anyone else experienced this problem and can tell me what the solution is? Any help would be appreciated.
Make sure you pass over all the address fields. If you do not pass over one of the variables, the address will not be displayed. If this still does not work, can you provide an example of what you are sending over and list what is not getting displayed when you test this and I will look into it further. However, make sure you are passing over all of the address fields.
I am trying to get the default phone number for sending a text message for an iPhone Address Book contact using ABPerson. I understand that ABMultiValue is to be used. But I cannot find out if there is a way to determine the default text message phone number (or for that manner, the default phone call phone number, email or address). I am about to grab the first object for each, but I am concerned that, for a text message, the phone may be a land line or otherwise unable to receive texts. Any advice on how to approach this matter would be appreciated.
You can extract specific values for home, work and cell phone number from the ABMultiValue. You will probably want to use the value corresponding to kABPersonPhoneMobileLabel and/or kABPersonPhoneIPhoneLabel to send a text message. If neither of those values exist, choose the first available phone number.