Hello,
I'm trying to run an app with sdk 26 and Android V 7. The same app that runs in android V6 with the sdk 26 is showing the error:
android.os.FileUriExposedException: file:///storage/emulated/0/notification/msgting.mpeg exposed beyond app through Notification.sound
I use notificationbuilder lib from @barx . The code is:
The error occurs in Nb.Notify(20), #ONLY# with Android 7 AND Sdk 26 (Android 6.x and SDK 26 OR Android 7 and SDK 21 runs normally).
How can I fix this?
I'm trying to run an app with sdk 26 and Android V 7. The same app that runs in android V6 with the sdk 26 is showing the error:
android.os.FileUriExposedException: file:///storage/emulated/0/notification/msgting.mpeg exposed beyond app through Notification.sound
I use notificationbuilder lib from @barx . The code is:
B4X:
Dim SoundFile As String = "file:///sdcard/notification/msgting.mpeg"
Nb.SmallIcon = "notification_whatpro"
If File.Exists(File.DirInternal,UserImage) Then
Nb.LargeIcon = NativeMe.RunMethod("getRoundBitmap",Array(LoadBitmap(File.DirInternal,UserImage)))
Else
Nb.LargeIcon = NativeMe.RunMethod("getRoundBitmap",Array(LoadBitmap(File.DirAssets,"ic_person_black_48dp.png")))
End If
Nb.ContentTitle = "Nova Mensagem"
Nb.ContentText = NotifyText
Nb.SubText = "Clique aqui para visualizar "
Nb.CustomSound = SoundFile
Nb.setActivity(chats)
Nb.DefaultVibrate = True
Nb.OnGoingEvent = False
Nb.AutoCancel = True
Nb.Priority = 100
Nb.Notify(20)
The error occurs in Nb.Notify(20), #ONLY# with Android 7 AND Sdk 26 (Android 6.x and SDK 26 OR Android 7 and SDK 21 runs normally).
How can I fix this?