A Flutter plugin to retrieve and manage contacts on Android and iOS devices. Maintainer: @lukasgit

Overview

contacts_service

pub package Build Status Coverage Status

A Flutter plugin to access and manage the device's contacts.

Usage

To use this plugin, add contacts_service as a dependency in your pubspec.yaml file.
For example:

dependencies:  
    contacts_service: ^0.6.3

Permissions

Android

Add the following permissions to your AndroidManifest.xml:

<uses-permission android:name="android.permission.READ_CONTACTS" />  
<uses-permission android:name="android.permission.WRITE_CONTACTS" />  

iOS

Set the NSContactsUsageDescription in your Info.plist file

<key>NSContactsUsageDescription</key>  
<string>This app requires contacts access to function properly.</string>  

Note
contacts_service does not handle the process of asking and checking for permissions. To check and request user permission to access contacts, try using the following plugins: flutter_simple_permissions or permission_handler.

If you do not request user permission or have it granted, the application will fail. For testing purposes, you can manually set the permissions for your test app in Settings for your app on the device that you are using. For Android, go to "Settings" - "Apps" - select your test app - "Permissions" - then turn "on" the slider for contacts.

Example

// Import package  
import 'package:contacts_service/contacts_service.dart';  
  
// Get all contacts on device
List<Contact> contacts = await ContactsService.getContacts();  

// Get all contacts without thumbnail (faster)
List<Contact> contacts = await ContactsService.getContacts(withThumbnails: false);

// Android only: Get thumbnail for an avatar afterwards (only necessary if `withThumbnails: false` is used)
Uint8List avatar = await ContactsService.getAvatar(contact);
  
// Get contacts matching a string
List<Contact> johns = await ContactsService.getContacts(query : "john");

// Add a contact  
// The contact must have a firstName / lastName to be successfully added  
await ContactsService.addContact(newContact);  
  
// Delete a contact
// The contact must have a valid identifier
await ContactsService.deleteContact(contact);  

// Update a contact
// The contact must have a valid identifier
await ContactsService.updateContact(contact);

// Usage of the native device form for creating a Contact
// Throws a error if the Form could not be open or the Operation is canceled by the User
await ContactsService.openContactForm();

// Usage of the native device form for editing a Contact
// The contact must have a valid identifier
// Throws a error if the Form could not be open or the Operation is canceled by the User
await ContactsService.openExistingContact(contact);

Contact Model

// Name
String displayName, givenName, middleName, prefix, suffix, familyName;

// Company
String company, jobTitle;

// Email addresses
List<Item> emails = [];

// Phone numbers
List<Item> phones = [];

// Post addresses
List<PostalAddress> postalAddresses = [];

// Contact avatar/thumbnail
Uint8List avatar;

Example

Contributions

Contributions are welcome! If you find a bug or want a feature, please fill an issue.

If you want to contribute code please create a pull request under the staging branch.

Credits

Heavily inspired from rt2zz's react native plugin

Comments
  • Definition of birthday is wrong ?

    Definition of birthday is wrong ?

    [I'm new to this, I might be totally wrong.]

    contacts.birthday is defined as a single field, but in the standard Contacts app on my Android 9 phone it seems there is a collection Dates of which Birthday is one member.

    Setting contacts.birthday through contacts_service doesn't work; the new value does not appear in the Contacts app.

    I've tried versions 0.4.6 and 0.5.0-nullsafety.0

    wontfix 
    opened by BillDietrich 15
  • java.lang.NullPointerException: Attempt to invoke virtual method 'android.net.Uri android.content.Intent.getData()' on a null object reference

    java.lang.NullPointerException: Attempt to invoke virtual method 'android.net.Uri android.content.Intent.getData()' on a null object reference

    Whenever I call await ContactsService.openDeviceContactPicker() and return (using bottom right button) without any selection in contact list, the following exception occurs ( App dies. )

    --EXCEPTION------------------------------------------ E/AndroidRuntime( 7385): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=52943, result=1100, data=null} to activity { / }: java.lang.NullPointerException: Attempt to invoke virtual method 'android.net.Uri android.content.Intent.getData()' on a null object reference E/AndroidRuntime( 7385): at android.app.ActivityThread.deliverResults(ActivityThread.java:5360) E/AndroidRuntime( 7385): at android.app.ActivityThread.handleSendResult(ActivityThread.java:5401) E/AndroidRuntime( 7385): at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51) E/AndroidRuntime( 7385): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) E/AndroidRuntime( 7385): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) E/AndroidRuntime( 7385): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2267) E/AndroidRuntime( 7385): at android.os.Handler.dispatchMessage(Handler.java:107) E/AndroidRuntime( 7385): at android.os.Looper.loop(Looper.java:237) E/AndroidRuntime( 7385): at android.app.ActivityThread.main(ActivityThread.java:8167) E/AndroidRuntime( 7385): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime( 7385): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496) E/AndroidRuntime( 7385): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100) E/AndroidRuntime( 7385): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.net.Uri android.content.Intent.getData()' on a null object reference E/AndroidRuntime( 7385): at flutter.plugins.contactsservice.contactsservice.ContactsServicePlugin$BaseContactsServiceDelegate.onActivityResult(ContactsServicePlugin.java:268) E/AndroidRuntime( 7385): at io.flutter.embedding.engine.FlutterEngineConnectionRegistry$FlutterEngineActivityPluginBinding.onActivityResult(FlutterEngineConnectionRegistry.java:739) E/AndroidRuntime( 7385): at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.onActivityResult(FlutterEngineConnectionRegistry.java:426) E/AndroidRuntime( 7385): at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onActivityResult(FlutterActivityAndFragmentDelegate.java:652) E/AndroidRuntime( 7385): at io.flutter.embedding.android.FlutterActivity.onActivityResult(FlutterActivity.java:618) E/AndroidRuntime( 7385): at net.e4net.CherryTalk.MainActivity.onActivityResult(MainActivity.java:133) E/AndroidRuntime( 7385): at android.app.Activity.dispatchActivityResult(Activity.java:8300) E/AndroidRuntime( 7385): at android.app.ActivityThread.deliverResults(ActivityThread.java:5353) E/AndroidRuntime( 7385): ... 11 more I/Process ( 7385): Sending signal. PID: 7385 SIG: 9 Lost connection to device.

    public class MainActivity extends FlutterActivity { :: @Override protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { super.onActivityResult(requestCode, resultCode, data); <-- dies if data == null ( no selection in contact list ) } } --ENVIRONMENT---------------------------------------

    contacts_service 0.4.6 / Android 10

    flutter doctor -v [√] Flutter (Channel dev, 1.24.0-10.2.pre, on Microsoft Windows [Version 10.0.19041.630], locale ko-KR) • Flutter version 1.24.0-10.2.pre at C:\flutter • Framework revision 022b333a08 (12 days ago), 2020-11-18 11:35:09 -0800 • Engine revision 07c1eed46b • Dart version 2.12.0 (build 2.12.0-29.10.beta)

    [√] Android toolchain - develop for Android devices (Android SDK version 30.0.2) • Android SDK at C:\Users\dklee\AppData\Local\Android\sdk • Platform android-30, build-tools 30.0.2 • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01) • All Android licenses accepted.

    [√] Chrome - develop for the web • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

    [√] Android Studio (version 4.1.0) • Android Studio at C:\Program Files\Android\Android Studio • Flutter plugin can be installed from: https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

    [√] Connected device (3 available) • SM N960N (mobile) • 2958a1d5be1c7ece • android-arm64 • Android 10 (API 29) • Web Server (web) • web-server • web-javascript • Flutter Tools • Chrome (web) • chrome • web-javascript • Google Chrome 86.0.4240.183

    • No issues found!

    bug help wanted Android 
    opened by kyounglee 15
  • Are there standard labels for collections such as Phone ?

    Are there standard labels for collections such as Phone ?

    I have a phone running Android 9.

    Using 0.4.6, I found that if my app created an item in the Phone collection with label "private", the new phone number did not show up in my phone's standard Contacts app. If I created an item with label "other", the new number did show up tagged s "Other".

    Now with 0.5.0-nullsafety.0, this seems to have changed. If my app creates an item labeled "other", the number does not appear in the Contacts app. If it creates an item labeled "custom", the number shows up in the Contact app tagged as "Home".

    Is there a standard set of labels ? Please document it. Thanks.

    wontfix 
    opened by BillDietrich 14
  • Deprecation in Android 11 stops the plugin from working

    Deprecation in Android 11 stops the plugin from working

    Due to the deprecation of AsyncTask on Android 11 the plugin is not working anymore

    [deprecation] Registrar in PluginRegistry has been deprecated [deprecation] AsyncTask() [deprecation] executeOnExecutor [deprecation] doInBackground [deprecation] onPostExecute(Result)

    wontfix 
    opened by andrlange 13
  • problem with xcode build

    problem with xcode build

    got error when build using xcode

    Module 'contacts_service' not found

    ╰─➤ flutter doctor Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, v1.12.13+hotfix.8, on Mac OS X 10.15.3 19D76, locale en-GB)

    [✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2) [✓] Xcode - develop for iOS and macOS (Xcode 11.3.1) [✓] Android Studio (version 3.5) [✓] IntelliJ IDEA Community Edition (version 2019.3.3) [✓] VS Code (version 1.43.1) [✓] Connected device (2 available) Screenshot 2020-03-29 at 6 56 59 PM

    iOS 
    opened by mdnurfikriabdghani 11
  • Empty array returned on iOS 13

    Empty array returned on iOS 13

    The following method in iOS 13 returns an empty array. ContactsService.getContacts()

    In iOS 13, developers are unable to access the notes portion of contacts. I was thinking that this could be the cause of the problem.

    in review 
    opened by darrylong 11
  • flutter.plugins.contactsservice.contactsservice.ContactsServicePlugin.getCursor

    flutter.plugins.contactsservice.contactsservice.ContactsServicePlugin.getCursor

    Getting following error:

    java.lang.NullPointerException

    flutter.plugins.contactsservice.contactsservice.ContactsServicePlugin.getCursor

    Fatal Exception: java.lang.RuntimeException: An error occurred while executing doInBackground()
           at android.os.AsyncTask$3.done(AsyncTask.java:355)
           at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
           at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
           at java.util.concurrent.FutureTask.run(FutureTask.java:271)
           at java.util.concurrent.ThreadPoolExecutor.processTask(ThreadPoolExecutor.java:1187)
           at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
           at java.lang.Thread.run(Thread.java:784)
    Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'android.database.Cursor android.content.ContentResolver.query(android.net.Uri, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String)' on a null object reference
           at flutter.plugins.contactsservice.contactsservice.ContactsServicePlugin.getCursor(ContactsServicePlugin.java:104)
           at flutter.plugins.contactsservice.contactsservice.ContactsServicePlugin.access$500(ContactsServicePlugin.java)
           at flutter.plugins.contactsservice.contactsservice.ContactsServicePlugin$GetContactsTask.doInBackground(ContactsServicePlugin.java:81)
           at flutter.plugins.contactsservice.contactsservice.ContactsServicePlugin$GetContactsTask.doInBackground(ContactsServicePlugin.java)
           at android.os.AsyncTask$2.call(AsyncTask.java:334)
           at java.util.concurrent.FutureTask.run(FutureTask.java:266)
           at java.util.concurrent.ThreadPoolExecutor.processTask(ThreadPoolExecutor.java:1187)
           at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
           at java.lang.Thread.run(Thread.java:784)
    
    opened by Veargan 9
  • java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.AssetFileDescriptor android.content.ContentResolver.openAssetFileDescriptor(android.net.Uri, java.lang.String)' on a null object reference

    java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.AssetFileDescriptor android.content.ContentResolver.openAssetFileDescriptor(android.net.Uri, java.lang.String)' on a null object reference

    I am getting the following exception:

    Fatal Exception: java.lang.RuntimeException: An error occurred while executing doInBackground()
           at android.os.AsyncTask$3.done(AsyncTask.java:354)
           at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
           at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
           at java.util.concurrent.FutureTask.run(FutureTask.java:271)
           at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
           at java.lang.Thread.run(Thread.java:764)
    Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.AssetFileDescriptor android.content.ContentResolver.openAssetFileDescriptor(android.net.Uri, java.lang.String)' on a null object reference
           at android.provider.ContactsContract$Contacts.openContactPhotoInputStream(ContactsContract.java:2142)
           at flutter.plugins.contactsservice.contactsservice.ContactsServicePlugin.loadContactPhotoHighRes(ContactsServicePlugin.java:647)
           at flutter.plugins.contactsservice.contactsservice.ContactsServicePlugin.access$700(ContactsServicePlugin.java:54)
           at flutter.plugins.contactsservice.contactsservice.ContactsServicePlugin$GetContactsTask.doInBackground(ContactsServicePlugin.java:434)
           at flutter.plugins.contactsservice.contactsservice.ContactsServicePlugin$GetContactsTask.doInBackground(ContactsServicePlugin.java:405)
           at android.os.AsyncTask$2.call(AsyncTask.java:333)
           at java.util.concurrent.FutureTask.run(FutureTask.java:266)
           at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
           at java.lang.Thread.run(Thread.java:764)
    

    Following the stack tree it seems that the problem occurs in the frameworks/base/core/java/android/provider/ContactsContract.java when the content resolver is null

                    try {
                        AssetFileDescriptor fd = cr.openAssetFileDescriptor(displayPhotoUri, "r");
                        if (fd != null) {
                            return fd.createInputStream();
                        }
                    } catch (IOException e) {
                        // fallback to the thumbnail code
                    }
    

    Looking at the plug-in code there is one place on the onDetachedFromEngine method where this is set to null:

      @Override
      public void onDetachedFromEngine(FlutterPluginBinding binding) {
        methodChannel.setMethodCallHandler(null);
        methodChannel = null;
        contentResolver = null;
        this.delegate = null;
      }
    

    I am getting crash reports for this problem but I cannot simply reproduced them in my app. My best guess is that it might be related with the running the getContacts call in the background and then closing the app.

    Is this a known issue? Anyone else having the same problem?

    Thanks for the support

    wontfix 
    opened by ManuelRosa 9
  • [Bug] NullPointerException when accessing contacts via a Dart Isolate (Background | Android)

    [Bug] NullPointerException when accessing contacts via a Dart Isolate (Background | Android)

    Hey all, I'm in the process of migration from Flutter v1 to v2, and one of the things that seems like it broke is my Dart Background Isolate that handles Google FCM notifications. When a notification is received, the isolate gets spun up and the notification is handled, i.e., contacts get fetched, avatars get loaded, etc.

    The issue I'm running into is when I fetch contacts from the isolate (even if permissions are granted), I get this error. This error does not occur when the app is open, only when the app is closed and the contacts service is used within the isolate.

    There is a similar ticket to this, but it was for iOS. My issue is with Android: https://github.com/lukasgit/flutter_contacts/issues/200

    Here is the error

    2021-07-02 10:05:41.473 14769-14814/com.bluebubbles.messaging E/AndroidRuntime: FATAL EXCEPTION: pool-8-thread-1
        Process: com.bluebubbles.messaging, PID: 14769
        java.lang.RuntimeException: An error occurred while executing doInBackground()
            at android.os.AsyncTask$4.done(AsyncTask.java:415)
            at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
            at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
            at java.util.concurrent.FutureTask.run(FutureTask.java:271)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
            at java.lang.Thread.run(Thread.java:923)
         Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.CharSequence android.content.res.Resources.getText(int)' on a null object reference
            at android.provider.ContactsContract$CommonDataKinds$Phone.getTypeLabel(ContactsContract.java:6288)
            at flutter.plugins.contactsservice.contactsservice.Item.getPhoneLabel(Item.java:42)
            at flutter.plugins.contactsservice.contactsservice.ContactsServicePlugin.getContactsFrom(ContactsServicePlugin.java:579)
            at flutter.plugins.contactsservice.contactsservice.ContactsServicePlugin.access$300(ContactsServicePlugin.java:55)
            at flutter.plugins.contactsservice.contactsservice.ContactsServicePlugin$GetContactsTask.doInBackground(ContactsServicePlugin.java:444)
            at flutter.plugins.contactsservice.contactsservice.ContactsServicePlugin$GetContactsTask.doInBackground(ContactsServicePlugin.java:420)
            at android.os.AsyncTask$3.call(AsyncTask.java:394)
            at java.util.concurrent.FutureTask.run(FutureTask.java:266)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
            at java.lang.Thread.run(Thread.java:923) 
    

    Here is a log showing some prints for when we fetch the contacts from the isolate, and showing that permissions are granted, the the error:

    I/flutter (15487): Database Opened
    I/flutter (15487): ContactManager -> Checking Permissions...
    I/flutter (15487): ContactManager -> We are checking access
    I/flutter (15487): ContactManager -> Status: PermissionStatus.granted
    I/flutter (15487): ContactManager -> Fetching contacts
    E/AndroidRuntime(15487): FATAL EXCEPTION: pool-14-thread-1
    E/AndroidRuntime(15487): Process: com.bluebubbles.messaging, PID: 15487
    

    Here is my flutter doctor:

    [√] Flutter (Channel stable, 2.2.2, on Microsoft Windows [Version 10.0.19043.1081], locale en-US)
        • Flutter version 2.2.2 at E:\src\flutter
        • Framework revision d79295af24 (3 weeks ago), 2021-06-11 08:56:01 -0700
        • Engine revision 91c9fc8fe0
        • Dart version 2.13.3
    
    [√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
        • Android SDK at E:\AppData\Local\Android\Sdk
        • Platform android-30, build-tools 30.0.3
        • ANDROID_SDK_ROOT = E:\AppData\Local\Android\Sdk
        • Java binary at: C:\Program Files\Java\jdk1.8.0_291\bin\java
        • Java version Java(TM) SE Runtime Environment (build 1.8.0_291-b10)
        • All Android licenses accepted.
    
    [√] Chrome - develop for the web
        • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
    
    [!] Android Studio (not installed)
        • Android Studio not found; download from https://developer.android.com/studio/index.html
          (or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).
    
    [√] VS Code (version 1.57.1)
        • VS Code at C:\Users\zach\AppData\Local\Programs\Microsoft VS Code
        • Flutter extension version 3.24.0
    
    [√] Connected device (3 available)
        • sdk gphone x86 arm (mobile) • emulator-5554 • android-x86    • Android 11 (API 30) (emulator)
        • Chrome (web)                • chrome        • web-javascript • Google Chrome 91.0.4472.124
        • Edge (web)                  • edge          • web-javascript • Microsoft Edge 91.0.864.59
    
    ! Doctor found issues in 1 category.
    
    
    opened by zlshames 8
  • Can't update contacts

    Can't update contacts

    I am trying to update a contact using ContactsService.updateContact(contact); however there is no change to the contacts. I have actually tried using the ContactsService.addContact(contact); method which when I change the birthday it adds the new birthday but keeps the original as well, it also clones every other part of the contact and it doensn't happen with the name. I am not recieving any errors on the console, but nothing is changing. By the way I have checked the contact object that I am passing as the value and it seems correct I will post the values of it here.

    `androidAccountName:"I am censoring this part"

    androidAccountType:AndroidAccountType (AndroidAccountType.google)

    androidAccountTypeRaw:"com.google"

    avatar:_Uint8ArrayView ([])

    birthday:DateTime (2000-05-20 00:00:00.000)

    company:null

    displayName:"Changed"

    emails:MappedListIterable (())

    familyName:"Test"

    givenName:"Brian"

    identifier:"200"

    jobTitle:null

    middleName:null

    phones:MappedListIterable ((Instance of 'Item', Instance of 'Item'))

    postalAddresses:MappedListIterable (())

    prefix:null

    suffix:null

    hashCode:134729209

    runtimeType:Type (Contact)`

    Please could someone help me or let me know if this is an issue with the package. Thanks.

    wontfix 
    opened by Snowworm3000 8
  • Fetching contact groups

    Fetching contact groups

    Users can define different groups of contacts on their phones like (family, coworkers, friends and etc) and assign contacts to those groups.

    It will be great if we can fetch groups of contacts that user has defined on his/her phone.

    help wanted wontfix 
    opened by easazade 8
  • Update contact and delete contact not working

    Update contact and delete contact not working

    Update contact not working properly

    I am getting bizarre issues while updating the contact, I am not getting any errors but my mobile number is getting removed when I update it. my code is like this

    Contact? duplicateContact = <old contact>;
    
    duplicateContact.givenName = "new name";
    duplicateContact.company = "new company name";
    duplicateContact.phones = [
          Item(value: "9876738211", label: "mobile")
    ];
    
    await ContactsService.updateContact(duplicateContact);
    

    so in contact data - the mobile number is getting removed even if I specified the mobile number in the newly updated object.

    Delete contact not working

    when I am trying to delete the contact, I am getting an error message from the application system

    IMG_20230105_200843

    so overall I am not able to update or delete contact service i am stuck into this for last 10 to 15 days, so anyone can help, it will be appreciated

    opened by logispire 0
  • Initial load with top 10, 20, 30, ... contacts list

    Initial load with top 10, 20, 30, ... contacts list

    Can you add the initial first load and then scroll to load more contacts or search for the name later? Now we have loaded too long when who have too many contacts on the phone.

    opened by Boualytpv 1
  • AsyncTask has been deprecated

    AsyncTask has been deprecated

    E:\develop\flutter\.pub-cache\hosted\pub.dartlang.org\contacts_service-0.6.3\android\src\main\java\flutter\plugins\contactsservice\contactsservice\ContactsServicePlugin.java:679: warning: [deprecation] onPostExecute(Result) in AsyncTask has been deprecated
        protected void onPostExecute(final byte[] avatar) {
                       ^
      where Result is a type-variable:
        Result extends Object declared in class AsyncTask
    20 warnings
    
    E:\develop\flutter\.pub-cache\hosted\pub.dartlang.org\contacts_service-0.6.3\android\src\main\java\flutter\plugins\contactsservice\contactsservice\ContactsServicePlugin.java:69: warning: [deprecation] Registrar
     in PluginRegistry has been deprecated
      private void initDelegateWithRegister(Registrar registrar) {
                                            ^
    
    E:\develop\flutter\.pub-cache\hosted\pub.dartlang.org\contacts_service-0.6.3\android\src\main\java\flutter\plugins\contactsservice\contactsservice\ContactsServicePlugin.java:673: warning: [deprecation] doInBack
    ground(Params...) in AsyncTask has been deprecated
        protected byte[] doInBackground(final Void... params) {
                         ^
      where Params,Result are type-variables:
        Params extends Object declared in class AsyncTask
        Result extends Object declared in class AsyncTask
    
    

    information about android:

    buildscript {
        ext.kotlin_version = '1.7.10'
        ext {
            compileSdkVersion = 30
            targetSdkVersion = 30
            appCompatVersion = "1.1.0"
        }
        repositories {
            google()
            mavenCentral()
        }
    
        dependencies {
            classpath 'com.android.tools.build:gradle:7.3.1'
            classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    //        classpath 'com.google.gms:google-services:4.3.14'
        }
    }
    
    opened by pishguy 0
  • [request] add phoneticFirst and phoneticLast

    [request] add phoneticFirst and phoneticLast

    We are using this package. In addition to familyName and givenName, we would like to add "PHONETIC". Is this possible with the current package?

    opened by tomoshin 0
  • [Android] java.lang.IllegalStateException: Reply already submitted

    [Android] java.lang.IllegalStateException: Reply already submitted

    Repro steps:

    Run an app that uses contacts_service and image_picker, then 1.) Get a Contact using "final Contact? contact = await ContactsService.openDeviceContactPicker();" 2.) Get an image from the gallery using " Uint8List bytesImage =await pickImage(ImageSource.gallery, context);" 3.) After image is selected, App crashes. Note: Crashes only on Android, not on iOS. Note: Crash happens only if contact has been picked before. If image is picked immediately there is no crash. Note: Workaround to prevent crash: Comment out line 267 "this.result.success(result);" in ContactsServicePlugin.java

    contacts_service: version 0.6.3 You can find output of flutter doctor and logs below.

    Excerpt of crash log (full log below) D/AndroidRuntime(12318): Shutting down VM E/AndroidRuntime(12318): FATAL EXCEPTION: main ..E/AndroidRuntime(12318): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=2342, result=-1, data=Intent { dat=content://com.android.providers.media.documents/document/image:83 flg=0x1 }} to activity {removed}. .. E/AndroidRuntime(12318): Caused by: java.lang.IllegalStateException: Reply already submitted ... E/AndroidRuntime(12318): at flutter.plugins.contactsservice.contactsservice.ContactsServicePlugin$BaseContactsServiceDelegate.finishWithResult(ContactsServicePlugin.java:267) E/AndroidRuntime(12318): at flutter.plugins.contactsservice.contactsservice.ContactsServicePlugin$BaseContactsServiceDelegate.onActivityResult(ContactsServicePlugin.java:302)

    -- [✓] Flutter (Channel stable, 3.3.4, on macOS 12.6 21G115 darwin-arm, locale de-DE) Checking Android licenses is taking an unexpectedly long time...[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3) [✓] Xcode - develop for iOS and macOS (Xcode 14.0.1) [✓] Chrome - develop for the web [✓] Android Studio (version 2021.3) [✓] VS Code (version 1.72.0) [✓] Connected device (3 available) [✓] HTTP Host Availability

    -- ... D/permissions_handler(12318): No android specific permissions needed for: 9 D/AndroidRuntime(12318): Shutting down VM E/AndroidRuntime(12318): FATAL EXCEPTION: main E/AndroidRuntime(12318): Process: removed, PID: 12318 E/AndroidRuntime(12318): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=2342, result=-1, data=Intent { dat=content://com.android.providers.media.documents/document/image:83 flg=0x1 }} to activity {removed*****.MainActivity}: java.lang.IllegalStateException: Reply already submitted E/AndroidRuntime(12318): at android.app.ActivityThread.deliverResults(ActivityThread.java:5368) E/AndroidRuntime(12318): at android.app.ActivityThread.handleSendResult(ActivityThread.java:5407) E/AndroidRuntime(12318): at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:67) E/AndroidRuntime(12318): at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45) E/AndroidRuntime(12318): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) E/AndroidRuntime(12318): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) E/AndroidRuntime(12318): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2253) E/AndroidRuntime(12318): at android.os.Handler.dispatchMessage(Handler.java:106) E/AndroidRuntime(12318): at android.os.Looper.loopOnce(Looper.java:201) E/AndroidRuntime(12318): at android.os.Looper.loop(Looper.java:288) E/AndroidRuntime(12318): at android.app.ActivityThread.main(ActivityThread.java:7870) E/AndroidRuntime(12318): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime(12318): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) E/AndroidRuntime(12318): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003) E/AndroidRuntime(12318): Caused by: java.lang.IllegalStateException: Reply already submitted E/AndroidRuntime(12318): at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:430) E/AndroidRuntime(12318): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.success(MethodChannel.java:267) E/AndroidRuntime(12318): at flutter.plugins.contactsservice.contactsservice.ContactsServicePlugin$BaseContactsServiceDelegate.finishWithResult(ContactsServicePlugin.java:267) E/AndroidRuntime(12318): at flutter.plugins.contactsservice.contactsservice.ContactsServicePlugin$BaseContactsServiceDelegate.onActivityResult(ContactsServicePlugin.java:302) E/AndroidRuntime(12318): at io.flutter.embedding.engine.FlutterEngineConnectionRegistry$FlutterEngineActivityPluginBinding.onActivityResult(FlutterEngineConnectionRegistry.java:805) E/AndroidRuntime(12318): at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.onActivityResult(FlutterEngineConnectionRegistry.java:428) E/AndroidRuntime(12318): at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onActivityResult(FlutterActivityAndFragmentDelegate.java:807) E/AndroidRuntime(12318): at io.flutter.embedding.android.FlutterActivity.onActivityResult(FlutterActivity.java:724) E/AndroidRuntime(12318): at android.app.Activity.dispatchActivityResult(Activity.java:8388) E/AndroidRuntime(12318): at android.app.ActivityThread.deliverResults(ActivityThread.java:5361) E/AndroidRuntime(12318): ... 13 more I/Process (12318): Sending signal. PID: 12318 SIG: 9 Lost connection to device. Exited

    opened by Bevantos 2
Owner
Lukas Dickie
@changefly • Google Cloud • Google Flutter
Lukas Dickie
Page Turn Widget - Add a page turn effect to widgets in your app. Maintainer: @rodydavis

Page Turn Widget Add a page turn effect to widgets in your app. Created by Simon Lightfoot @slightfoot Screenshots Example import 'package:flutter/mat

Flutter Community 177 Dec 29, 2022
Compact representation of a placeholder for an image. Encode a blurry image under 30 caracters for instant display like used by Medium. Maintainer: @Solido

Flutter BlurHash Compact representation of a placeholder for an image. Generation You can use https://blurha.sh/ for testing or use any official api o

Flutter Community 408 Dec 30, 2022
Android application that manage all the information of Pandemic Covid-19 in Vietnam.

COVID-19 Health-care Management Android application that manage all the information of Pandemic Covid-19 in Vietnam. Overview Here is the detail and t

null 0 Dec 4, 2021
Exemplo em Flutter, para trabalhar com as câmeras dos devices

Fotografe e compartilhe! Como rodar: Clone the project to your Machine. Import the project to Android Studio. Run directly on Android or iOS device. A

null 3 Aug 23, 2021
A multi-plateform (Flutter) application for reading your emails, with your favorite devices, using the JMAP protocol!

A multi-plateform (Flutter) application for reading your emails, with your favorite devices, using the JMAP protocol!

LINAGORA 119 Jan 2, 2023
Easy to use open source Hub 🕸️ to control your smart devices from one app.

CyBear Jinni Hub Welcome! This repository is in charge of controlling smart devices and is part of the CyBear Jinni Smart Home system. The software is

CyBear Jinni 26 Nov 23, 2022
Easy to use open source Hub 🕸️ to control your smart devices from one app.

CyBear Jinni Hub Welcome! This repository is in charge of controlling smart devices and is part of the CyBear Jinni Smart Home system. The software is

CyBear Jinni 13 Jul 22, 2021
Your grades across all your devices.

Gradely 2 A Grade Calculator App, that syncs all your Grades across all your devices, built with Flutter and with the amazing backend Appwrite. Screen

Elias Schneider 16 Dec 8, 2022
Transform your smart devices to intelligent communicators.

Donna According to a survey of 601 people, 57.9 % of participants experienced communication difficulties, with 23.5 % reporting severe difficulties. O

Betaoverflow 9 Dec 19, 2022
A Markdown-based note-taking app for mobile devices.

Noteless A markdown-based note-taking app for Android Compatible with notes saved in Notable Features Markdown-optimized editor with syntax highlighti

null 460 Dec 31, 2022
Kee Vault 2 - a password manager for multiple devices.

Kee Vault 2 is a password manager for multiple devices. Password databases (Vaults) are encrypted using the KeePass storage format (KDBX) before being stored on the local device or sent to a remote server for synchronisation purposes.

Kee 11 Jan 6, 2023
The Device Fingerprint tool collects thorough insight about the devices associated to a user.

The Device Fingerprint tool collects thorough insight about the devices associated to a user. Account takeovers and multiple account signups, payments can easily be avoided by applying the Device Fingerprinting module.

Shahin Sefidgaran 6 Nov 28, 2022
A Flutter plugin for handling Connectivity and REAL Connection state in the mobile, web and desktop platforms. Supports iOS, Android, Web, Windows, Linux and macOS.

cross_connectivity A Flutter plugin for handling Connectivity and REAL Connection state in the mobile, web and desktop platforms. Supports iOS, Androi

MarchDev Toolkit 29 Nov 15, 2022
A Flutter plugin that supports Pangle SDK on Android and iOS.

Thanks for non-commercial open source development authorization by JetBrains. 穿山甲 Flutter SDK `pangle_flutter`是一款集成了字节跳动穿山甲 Android 和 iOS SDK的 Flutter

null 121 Dec 2, 2022
A robust Flutter plugin for making payments via Paystack Payment Gateway. Completely supports Android and iOS

?? Paystack Plugin for Flutter A Flutter plugin for making payments via Paystack Payment Gateway. Fully supports Android and iOS. ?? Installation To u

Wilberforce Uwadiegwu 165 Jan 4, 2023
A Flutter plugin for playing music on iOS and Android.

Stereo plugin for Flutter A Flutter plugin for playing music on iOS and Android. Features Play/pause Stop Duration / seek to position Load track from

2find 67 Sep 24, 2022
A flutter plugin for integrating razorpay payment gateway. Supports Android and iOS.

Flutter Razorpay Plugin A flutter plugin for razorpay integration for both android and ios. If you use this library in your app, please let me know an

Chetan Kaushik 28 Dec 13, 2022
A flutter IM plugin for android and ios

flutter_openim_sdk Download demo flutter_openim_widget A flutter IM plugin for android and ios. Getting Started 1,Add dependency in yaml flutter_op

kostia7alania 1 Dec 3, 2021
Video player-2.2.10 - A Flutter plugin for iOS, Android and Web for playing back video on a Widget surface

Video Player plugin for Flutter A Flutter plugin for iOS, Android and Web for pl

null 2 Sep 29, 2022