Android Question (solved) Permission problems with android version 11 (Phone Number Verification google)

jose luis gudino

Active Member
Licensed User
Longtime User
Hi I have the following error and it only started to present with android 11, with previous versions it works perfect

an error has_ocurre in, security description:
getline1numberfordisplay : Neither user 10019 nor current proccess has
android.permision.READ_PHONE_STATE, android.permission.READ_SMS or
android.permission.READ_PHONE_NUMBER

error.jpg
 

jose luis gudino

Active Member
Licensed User
Longtime User
Make sure to read: SMS and CALL_LOG permissions are no longer available

Are you requesting the permissions at runtime?
yes, at runtime.

This is the code that is not working for me, I clarify that it only occurs in version 11 of andriod


B4X:
Sub getPhoneNumber As String
    '--------------------------------
    Dim pID As PhoneId
    Dim phonenumber As String
    phonenumber = pID.GetLine1Number
    phonenumber=""
    Return phonenumber
End Sub


B4X:
anywheresoftware.b4a.phone.Phone.PhoneId _pid = null;
String _phonenumber = "";
//BA.debugLineNum = 306;BA.debugLine="Sub getPhoneNumber As String";
//BA.debugLineNum = 308;BA.debugLine="Dim pID As PhoneId";
_pid = new anywheresoftware.b4a.phone.Phone.PhoneId();
//BA.debugLineNum = 309;BA.debugLine="Dim phonenumber As String";
_phonenumber = "";
//BA.debugLineNum = 310;BA.debugLine="phonenumber = pID.GetLine1Number";     / ******* LINE ERROR *********
_phonenumber = _pid.GetLine1Number();
//BA.debugLineNum = 311;BA.debugLine="phonenumber=\"\"";
_phonenumber = "";
//BA.debugLineNum = 312;BA.debugLine="Return phonenumber";
if (true) return _phonenumber;
//BA.debugLineNum = 313;BA.debugLine="End Sub";
return "";
}
 
Last edited:
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
For googles phone verification you need no single Permission.


 
Upvote 0

jose luis gudino

Active Member
Licensed User
Longtime User
For googles phone verification you need no single Permission.


Thanks for the help.
Yes, until version 10 of android everything works perfect, it only appeared on a phone with version 11
 
Upvote 0

MikeSW17

Active Member
Licensed User
Longtime User
Not sure you trimmed the project down properly:

B4X:
[IDE message - 10:33:15]
The following libraries are missing:
alerter
asratingbar
bitmapextended
dialogs2
firebaseauthphone
fusedlocationprovider
geocoder
googlemaps
googlemapsextras
inappupdate
net
ratingbar
simcard
stringfunctions
 
Upvote 0

jose luis gudino

Active Member
Licensed User
Longtime User
Not sure you trimmed the project down properly:

B4X:
[IDE message - 10:33:15]
The following libraries are missing:
alerter
asratingbar
bitmapextended
dialogs2
firebaseauthphone
fusedlocationprovider
geocoder
googlemaps
googlemapsextras
inappupdate
net
ratingbar
simcard
stringfunctions
Hello thanks for your time,
It was basic network due to the size of the file and I could upload it to the server.
for that I should upload all the library that I use
let me see how i can do
 
Upvote 0

jose luis gudino

Active Member
Licensed User
Longtime User
hi
I think the problem was occurring because the client did not have a simcard on the phone
I inserted it into a "try cath" and voila it worked
thank

B4X:
Sub getPhoneNumber As String
    '--------------------------------
    Dim pID As PhoneId
    Dim phonenumber As String
    Try
      phonenumber = pID.GetLine1Number
    Catch
        Log(LastException)
    End Try
     Return phonenumbe
End Sub
 
Upvote 0
Top