If one of the two has to be selected, use the ! (complement) of the value returned with Allow to process for Don't Allow.
For example, if Allow returns a value boolean true, if the value is not true implies Don't Allow has been selected.
Implies Don't Allow is selected.
Thank you for that insight Mystery Man "dvohra21". LOL.
I have a detailed implementation question=> what is the syntax to capture the value(whether allow or !allow) I am trying to find how to capture the user's selection. Phonegap takes control for a brief second. It is outside the control of my app for a moment. In this period of time the User is prompted if they agree to "allow access".
How do I access the result returned by phonegap? Is the Contact newContact = device.createContact(contact); call automatically populating a callback method? Or setting a variable somewhere I can access. If so can you offer some direction on where to look for the details?
Contact newContact = device.createContact(contact); <- the command that calls Phonegap to interact with the device's OS.
Thank You for all your help!
But my question here specifically refers to capturing the result of the Phonegap UI alert "Allow App to Access Contacts?". 2 buttons are displayed. "Allow", "Don't Allow". If the user always selects "Allow" my code works as designed. However, I am coding for the other scenario=> the user selects "Don't Allow".
My Essential Question: How do I access the users selection to the Phonegap alert? This seems to happen outside ADF Mobile's control(as a blocking call to Phonegap)
It seems if the user selects "Don't Allow" the contact should not get added to their device's contact list. && I need to reset the phone gap parameter, so that same user gets prompted next time they want to add a contact. (right now the user's selection is final)
I appreciate you sharing your knowledge with me!
All notifications provide a callback function.
confirmCallback: Callback to invoke with index of button pressed (1, 2, or 3) or when the dialog is dismissed without a button press (0).
alertCallback: Callback to invoke when alert dialog is dismissed. (Function)
promptCallback: Callback to invoke when a button is pressed. (Function)
I believe the correct issue is here that if the user disallows access to contacts then how do we detect that? The prompt in question regarding access to Contacts is displayed by iOS and it's response cannot be captured similar to an alert response.
IS there a call or way we can hook into PhoneGap to discover if the user has disallowed access to contacts before performing contact related operations? This way we can diplay a message asking user to first enale access to contacts rather than attempt the operation and fail.
That's right. Thank you for that clarification.
Phonegap interaction (including user response) has been brought into MAF.