-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Thumbnail photo #11
Comments
hey @ricksmelo, that would be great to have this feature if it does not impact the performances (on android at least). And it would be awesome if it could be an option too. thank you for contributing anyway 🍻 |
any updates @ricksmelo? |
So @dbaq, I did the feature, but, by now, is very simple. I only added a attribute in the object contact, labeled "thumbnailPhoto". It's a url string pointing to the android directory, virtual or not, where the photo is stored. If no photo is found, it returns a empty value. I didn't test the times, but it's still fast, on my Nexus 5 with ~110 contacts. I want to make a option, but I'm still working. If you want, I can already make a pull request :) PS: sorry for bad english, not my first language. |
No rush, thank you for working on it. You said: So that means we need to add an extra permission to access the file storage? How are you displaying the file in the UI? |
I guess not, at least I didn't add anymore permissions. Url comes like this: "content://com.android.contacts/contacts/739/photo". If we put in a img src, android makes the work for us, like this: The only thing that we might pay attention when working with this is the default sanitization, who adds "unsafe:" at the beginning of the url. On app.js we need to configure what types of protocols can be used: .config(['$compileProvider', function($compileProvider) { Besides that, no more worries. |
I like that! Have you thought about supporting iOS? |
Well, I never worked with iOS platforms, but I want to. Windows Phone is C#, isn't it? |
yes or visual basic, it would be nice to have the iOS support in the PR. |
Well, I'll give a look at the language, maybe I can do something. Knowledge is never too much |
@ricksmelo Please can you paste your code for some of us to follow. I have tried but still cannot get the photo to show. |
it is an awesome one Ricksmelo. I am not a developer (android or iOS). But can do a little bit on Js/Html. Could we add a filter like mobileNumber starting with some XYZ etc. (WIll add some flexibility for developers) ... I assume Cordova takes an arguments as one of its parameter on exec. Can we pass it ? I assume cr.query may need one extra condition in ContactsManager.java. But as i said i have been searching for this plugin for last 3 days. Thanks once again. |
@natanraj for feature request, open another issue thanks. |
Closing this one since #44 has been merged. |
I released a new version on npm https://www.npmjs.com/package/cordova-plugin-contacts-phonenumbers (v0.0.9) |
I know this is meant to be a light plugin, but we have not a way to retreive contact photos.
I will make this feature for my project, if you want, i can pull it.
The text was updated successfully, but these errors were encountered: