Hi Everyone,
All of my apps are using this coding to display a notification that lets the user know the app is running in the background. The coding was working correctly on my test phone running Android 7.
In the Starter module:
In the Process_Globals:
In the Service_Create:
In the InitializeObjects:
After upgraded to Oreo, all I see "My app name goes here" for both the title and the body in the notification area and the phones default notification sound is heard even though I told it not to play the sound with nNotify.Sound = False
Can you let me know what code changes I need to make so it will work in both Oreo and older versions as well?
Thanks.
All of my apps are using this coding to display a notification that lets the user know the app is running in the background. The coding was working correctly on my test phone running Android 7.
In the Starter module:
In the Process_Globals:
B4X:
Private nNotify As Notification
In the Service_Create:
B4X:
InitializeObjects
nNotify.SetInfo("My app name goes here", "Running in the background...", "")
Service.AutomaticForegroundNotification = nNotify
Service.AutomaticForegroundMode = Service.AUTOMATIC_FOREGROUND_ALWAYS
wakeState.PartialLock
In the InitializeObjects:
B4X:
nNotify.Initialize
nNotify.Icon = "icon"
nNotify.Sound = False
nNotify.Light = False
nNotify.Vibrate = False
tmrTimer.Initialize("Timer", 1000) ' Every second.
strShared = rp.GetSafeDirDefaultExternal("Settings")
kvs.Initialize(strShared, "Settings")
After upgraded to Oreo, all I see "My app name goes here" for both the title and the body in the notification area and the phones default notification sound is heard even though I told it not to play the sound with nNotify.Sound = False
Can you let me know what code changes I need to make so it will work in both Oreo and older versions as well?
Thanks.