Permissions for Notification Vibrate ?

Kim Rowden

Member
Licensed User
Longtime User
I'm using the sample code as provided in the doc to see how notifications work.

It seems that Vibrate is set to TRUE by default - and when I run the sample code I get an error on the n.notify(1) statement:

java.lang.SecurityException: Requires VIBRATE permission

Where do I set / obtain this permission?

(as might be expected, if I set Vibrate to FALSE the app runs fine)

B4X:
Dim n As Notification
n.Initialize
n.Icon = "icon"
n.SetInfo("This is the title", "and this is the body.", "") 
n.Notify(1)
 

Kim Rowden

Member
Licensed User
Longtime User
I had not - thank you Erel, all ok now.

I HAD marked the manifest as Read Only because I am also using AdMob (and those instructions mention the manual way of retaining the manifest - I am now using the preferred "Do not overwrite manifest file" option).

I'm still feeling/finding my way in this environment - is there a suggested frequency for which I should check the example manifest?

Thanks,
-Kim
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
If the only change required is for AdMob then I recommend you to use the automatic manifest file during development and only when you are before release, add the AdMob related modifications.
Note that you can also compare your manual manifest file with AndroidManifest-Example.xml which is created in the same folder.
 
Upvote 0
Top