java.lang.SecurityException: Requires VIBRATE permission on Jelly Bean 4.2

前端 未结 3 1062
粉色の甜心
粉色の甜心 2020-12-08 13:26

Since yesterday I have an issue on Android 4.2 when I receive push notifications it requires the permission even if i don\'t set it to vibrate

Notification n         


        
3条回答
  •  遥遥无期
    2020-12-08 14:20

    Since this bug only occurs on Android 4.2 and 4.3 you might use this as a workaround (i.e. include the maxSdkVersion):

    
    

    Note: the maxSdkVersion attribute was only added in API level 19, which in this case is luckily exactly the minimum we want! In theory we could put any value <= 18 to get the same effect, but that would be nasty.

提交回复
热议问题