iOS Question How to show a local notification on iOS like WhatsApp?

Haris Hafeez

Active Member
Licensed User
Longtime User
The WhatsApp notification in iOS shows a two line notification. The first shows the contact name (in bold) and the second line shows the detailed message. Can we build local notifications like that using B4i alone or will it require some Objective C?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
(Whatsapp actually uses push notifications)

Local notifications:
B4X:
App.RegisterUserNotifications(True, True, True)
Dim n As Notification
n.Initialize(DateTime.Now + 5000)
n.AlertBody = "test"
If App.OSVersion >= 8.2 Then
   Dim no As NativeObject = n
   no.SetField("alertTitle", "This is the title")
End If
n.Register
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…