What are READ_PHONE_STATE and READ_SMS Permission Names?

201 views
Skip to first unread message

ndrorian

unread,
Apr 1, 2019, 1:05:52 PM4/1/19
to MIT App Inventor Forum

I am getting a Runtime Error "getLine1NumberForDisplay:  Neither use nnnnn nor current process has android.permission.READ_PHONE_STATE or android.permission.READ_SMS." I added a PhoneCall to my designer but I have same issue. What are valid permission names for the AskForPermission block of AI2 and where are these documented in AI2?




Screen Shot 2019-04-01 at 9.55.49 AM.png


Evan Patton

unread,
Apr 2, 2019, 10:41:59 AM4/2/19
to MIT App Inventor Forum
While technically you need to use the fully qualified name of the permission, which is android.permission.NNNN, there is a shortcut I implemented where you can just pass the unqualified name and it will automatically prepend the android.permission prefix. So it should be sufficient to call the AskForPermission block with string "READ_PHONE_STATE".

Regards,
Evan
Reply all
Reply to author
Forward
0 new messages