Skip to content

ferdielik/push-notification-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This github repo is implementation of com.notnoop.apns.ApnsService.

Firstly you need create aps certification here. After that install certificate and export p12 file with Keychain app.

And change password and cert file in ApplePushNotificationServiceImpl;

send a push ios notification

private static String deviceToken = "7f5efa476a8ac25bc1fe48488520724835c86aa4d3fe50ad5a2975650a1ad0c1";

private static void testAppleNotification()
{
    NotificationService notificationService = ApplePushNotificationServiceImpl.getInstance();
    Notification notification = buildTestNotification();
    notificationService.push(deviceToken, notification);
}

private static Notification buildTestNotification()
{
    Notification notification = new Notification();
    notification.setTitle("Apple Push Notification Service");
    notification.setSubTitle("Lorem simply dummy");
    notification.setBody("Lorem Ipsum is simply dummy text of the printing and typesetting industry.");
    notification.setCategory(NotificationCategory.DEFAULT);
    return notification;
}