crossmob / CrossMobile

Create native iOS, Android, Windows Phone and Desktop applications in Java. Write it once, and produce sophisticated multiplatform applications.
GNU Lesser General Public License v3.0
53 stars 14 forks source link

Local notification #11

Open beyons opened 1 year ago

beyons commented 1 year ago

Hello how can i create a local notification

this is my code

UNUserNotificationCenter center = UNUserNotificationCenter.currentNotificationCenter(); UNMutableNotificationContent conten = new UNMutableNotificationContent(); conten.setTitle("Jurassic Park"); conten.setSubtitle("Lunch"); conten.setBody("Its lunch time at the park, please join us for a dinosaur feeding"); conten.setSound(UNNotificationSound.defaultSound()); UNTimeIntervalNotificationTrigger trigg = UNTimeIntervalNotificationTrigger.triggerWithTimeInterval(2.0,false); UNNotificationRequest req = UNNotificationRequest.requestWithIdentifier("ContentIdentifier",conten,trigg);

center.addNotificationRequest(req,nsError -> {

});

teras commented 1 year ago

I suspect that you need a local notification for Android?

If yes, right now local notifications are not supported yet.

Please explain your need and let's see what could be done.

beyons commented 1 year ago

Hello yes i need a local notification for android. for Ios is supported ?