Skip to content

Does this support Unity 2021+? #32

@khoa-nguyen

Description

@khoa-nguyen

I've noticed this project has not been updated in a while. Does anyone know if this is still supported in Unity 2021+?

I have tried downloading the project and running it, but crashes when trying to fetch the contacts list.

Testing on android, logcat prints out missing permissions so I went in and added them to the androidManifest. For example, adding the READ_PHONE_NUMBERS:

And then using a different project to handle calling these permissions at runtime:

async void RequestPermission()
{
	AndroidRuntimePermissions.Permission result = await AndroidRuntimePermissions.RequestPermissionAsync( "android.permission.READ_CONTACTS" );
	AndroidRuntimePermissions.Permission result2 = await AndroidRuntimePermissions.RequestPermissionAsync( "android.permission.READ_PHONE_NUMBERS" );

	if( result == AndroidRuntimePermissions.Permission.Granted &&
	    result2 == AndroidRuntimePermissions.Permission.Granted)
	{
		Debug.Log( "We have permission to Read Contacts and phone number" );
		// DO STUFF 
                Contacts.LoadContactList( OnDone, OnLoadFailed );
	}
	else
	{
		Debug.Log( "Permission state: " + result + result2 );
	}
}

And logcat prints out Permission state: GrantedGranted

But these issues still show up:
TelephonyPermissions: reportAccessDeniedToReadIdentifiers
java.lang.SecurityException: getIccSerialNumber: The uid 10387 does not meet the requirements to access device identifiers.

The last lines to get printed out before the app closes down are:
at com.aliessmael.contactslist.ContactList.LoadInformation_thread(ContactList.java:81)
at com.aliessmael.contactslist.ContactList$1.run(ContactList.java:66)
at java.lang.Thread.run(Thread.java:1012)

It seems the contact list is trying to run but not all (or enough) permissions have been granted.

I do hope we can get this up and running again. Searching several years later for Unity display phone contact list still shows very few results.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions