I can see I get the custom notification after I deny the permission and 
then trigger the location requirement again. For some reason I was 
convinced that this message should appear when the Location called, not 
only when the permission is denied. 
This works with android.permission.ACCESS_FINE_LOCATION.
However,  android.permission.ACCESS_BACKGROUND_LOCATION still doesn't show 
custom messages - after you denied it, and then tried to use Location 
again, it's asking default "Allow background location".

I created a simple dialog for the moment when the permission will be asked. 

On Wednesday, July 7, 2021 at 10:02:36 PM UTC-4 Shai Almog wrote:

> What about android.permission.ACCESS_FINE_LOCATION ?
> Do you have the exact text of the message you're getting? I can search the 
> source code for it and see where it's coming from.
>
> On Wednesday, July 7, 2021 at 4:12:09 PM UTC+3 [email protected] wrote:
>
>> Thank you. 
>> I tried with the  ACCESS_BACKGROUND_LOCATION too, same result - no 
>> message is shown. 
>>
>> Am I missing something? 
>>
>> On Tuesday, July 6, 2021 at 10:47:06 PM UTC-4 Shai Almog wrote:
>>
>>> I don't see that permission in code. I see fine location and 
>>> android.permission.ACCESS_BACKGROUND_LOCATION 
>>> but not COARSE. I'll have to check.
>>>
>>> On Tuesday, July 6, 2021 at 10:05:07 PM UTC+3 [email protected] wrote:
>>>
>>>> Sorry, wrong link. 
>>>> Here is the one I followed:
>>>>
>>>> https://www.codenameone.com/blog/switching-on-android-marshmallow-permission-prompts.html
>>>>
>>>> On Tuesday, July 6, 2021 at 3:03:15 PM UTC-4 Hannah R wrote:
>>>>
>>>>> How to add custom permission messages? 
>>>>>
>>>>> I followed this blog (
>>>>> https://www.codenameone.com/blog/tip-intercept-incoming-sms-on-android.html)
>>>>>  
>>>>> and added 
>>>>> Display.getInstance().setProperty("android.permission.ACCESS_COARSE_LOCATION",
>>>>>  
>>>>> "We need access to your location"); into my init() method, but 
>>>>> nothing happened. I still get default dialogs when the permission is 
>>>>> requested.
>>>>>
>>>>> Thank you. 
>>>>
>>>>

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/fd11bf73-6a4a-4898-951b-f5692285db13n%40googlegroups.com.

Reply via email to