The old extension works fine. I am using Two Letter Codes like PK, IN etc and it works fine
Thanks , Iâve sent you a modified version.
P.S: this
Was a problem at my end while testing
Version 1.1
A small update that hopefully fixes all of the bugs reported
Bug Fixes
1- Fixed null pointer exception when using GetContactImageList and GetContactsImageListAsync block.Thanks to @bodymindpower and @sherif
2- Fixed that the FormatPhoneNumber block wasnât working in apis older then 21, now it works with all versions.
Changes
1- Reorganized and removed many useless classes, however, extension size increased to 23 mb
2- Now the extension ask for the READ_CONTACTS permission ( for all required blocks ) without needing to ask it manually.Thanks to @bodymindpower , BUT, the permission would be added to the manifest when you add the extension to your project even without using any of its blocks.
3- Now GetContactImage
, GetContactUri
, GetContactId
and GetContactNames
, would trigger an event instead of returning the value directly, as i canât block the user interface thread until the user allows or denies the permission.
4- The extension now returns the phone numbers without any extra or unused spaces. thanks to @bodymindpower
5- Now it almost all blocks remove all extra spaces at the start or the end of the given numbers.
6- The extension validates the phone number before doing operations with it.Except with IsValidNumber
, FormatPhoneNumber
and NormalizeNumber
blocks.
7- Some blocks were returning null values instead of empty values when something went wrong.
8- Fixed some blocks descriptions spelling errors
New Blocks
Some new events that would get fired when the GetContactImage
, GetContactUri
, GetContactId
and GetContactNames
gets the result:
Deprecated blocks
As some blocks are deprecated or changed, your project might got broken if you imported the new version, i would suggest you to have a backup for it
Those blocks are deprecated due to that they might not return the result at all, if the extension needed to ask a permission , use the Asynchronous version of them instead
The first topic got updated
Thatâs all for now Thanks.
please add get dual sim card numberâŚ
Version 2
New Blocks
1- GetGroupsList
Gets all of the groups stored on the device, or in any account registered on the device.
2- GetContactGroups
Get the list of groups the contact is added to.
3- GetGroupContacts
Get the list of contacts added to a group
4- GetContactEmail
Gets the the contact email, the corresponding event isnât called if there isnât any email found for the contact.
5- New events for the added blocks, called when the result is found :
Thanks!
Version 2.1
Bugs Fixed
1- The extension wasnât working in the compiled APK, since the extension wasnât properly declaring the READ_CONTACTS permission in the appâs manifest, and therefore, the permission wasnât requested. (Thanks to @Sirajul_Haque )
New Blocks
1-
Strips separators from a phone number string.
2-
Returns a list of all of the phone numbers in the string given.
3-
Called when an error occurs, with the error and its message, instead of showing an undefined runtime error. Itâs also called when an empty or invalid input is given.
The updated AIX can be found in the first post
Many many thanks Tamer. I am facing a problem to get contactUri to open a contact directly to edit or delete that contact with contacts app. But there is a problem described below.
Using âContactPickerâ I got contactUri âcontent://com.android.contacts/contacts/lookup/3877i41d55ef28b7e8bb9/21**â
But when I got contactUri using âPhoneNumberToolsâ that returns"content://com.android.contacts/phone_lookup/01* 16422 **"![blocks (17)|690x154]
(upload://uVujAU6KSZUABjU1rqr3dZyBupl.png)
why difference?
When I use âActivityStarterâ then it works if I use ContactPicker contactUri but PhoneNumberTools contactUri not work.!
I want to get contactUri using phone number and which contactUri able to work in ActivityStarter to open that contact directly.
Please help.
Thanks again.
âGetContactIdâ block returns same ID for two different contacts.!
Will you tell the reason please?
Tested with MIT AI2 Companion
I have a favor to ask. Could you make the block GetContactName a function instead of a call? It would be so much easier to use the block when you donât have to keep track of an event anymore.
Hello,
The reasoning behind it was made an event block, is because of the fact the block might need to ask for permissions first, thatâs being said, it will not be a good idea to block other blocks from executing until getting the response from user.
Nevertheless, itâs possible you could switch to version 1, where blocks were returning values directly instead of using an event block, you will just need to ask for the permission READ_CONTACTS
manually in that case.
Thank you.
Thank you for your reply. That really clarifies things. Iâd like to ask further. How do I properly ask for permission.
Neither this one:
nor this one:
worked when I tried.
The problem is that when it is the first time I open my app, it doesnât ask the READ_CONTACTS permission.
Now since I use my app to send SMS, I also need the SEND_SMS permission. My app asks for it automatically the first time I open my app although I did not explicitly ask for this permission. Why does it ask for the SEND_SMS permission but not the READ_CONTACTS permission when I even asked for it explicitly in my blocks? Is it a problem of the app asking for two permissions during screen initialization? Is this not supposed to be done? If so, how do I properly ask for the READ_CONTACTS permission so that I get it the first time I open my app?
Can you try this AIA please:
phonenumbertoolstest.aia (16.9 KB)
It asks for the permission properly for me, testing on the companion and APK.
You should make sure that:
1- The permission hasnât been already granted before ( this can be done manually from the settings app )
2- You have added the extension to your screen ( so that the permission is declared in the apkâs manifest ), this is more specifically for building as apk as the companion declares it by default.
I suppose you are using the texting component, it would automatically ask for the SEND_SMS
permission, so explicitly asking permissions isnât needed in that case.
As said, the older version of this extension doesnât automatically request permissions, and so it was needed to ask it manually.
Can we create phone verify login system to use this extension.
Please give also Aia file.
Welcome @Cash_Ads ,
If you mean to send a SMS verification code to a phone number, so this extension has nothing to do with it. You might want to search the community for methods to achieve this. You could possibly use Firebase Authentication.
I have already provided a test project ( AIA file ) in the first post:
Official language is English. You are violating the policy. Either translate it or delete your post before it is marked as spam
Why are there not some languages such as Arabic and French, which helps this community to facilitate communication and learning?