import PusherSwift
let pusher = Pusher(key: "YOUR_APP_KEY")
// register your deviceToken with Pusher
pusher.nativePush().register(deviceToken)
// subscribe for donut news
pusher.nativePush().subscribe("donuts")
// later, receive donut news
func application(
application : UIApplication,
didReceiveRemoteNotification
donutNotification : [NSObject : AnyObject]
) {
print(donutNotification)
}
// MainActivity.java
PusherAndroid pusher = new PusherAndroid("key");
PushNotificationRegistration nativePusher = pusher.nativePusher()
// start registering for Push Notifications with Pusher
nativePusher.registerGCM(this, getString(R.string.gcm_defaultSenderId));
// subscribe to donut news
nativePusher.subscribe("donuts");
nativePusher.setGCMListener(new GCMPushNotificationReceivedListener() {
@Override
public void onMessageReceived(String from, Bundle data) {
System.out.println(data);
}
});
// MainActivity.java
PusherAndroid pusher = new PusherAndroid("key");
PushNotificationRegistration nativePusher = pusher.nativePusher()
// start registering for Push Notifications with Pusher
nativePusher.registerFCM(this);
// subscribe to donut news
nativePusher.subscribe("donuts");
nativePusher.setFCMListener(new FCMPushNotificationReceivedListener() {
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
System.out.println(remoteMessage);
}
});
Unified API to build cross platform apps and send programmable Push
Notifications to iOS and Android devices.
Keep users engaged in your app and reengage them when it’s closed using the Data Delivery Network and Push Notifications APIs.
Send push notifications to iOS and Android devices through one unified Push Notifications API for Google Cloud Messaging (GCM), Firebase Cloud Messaging (FCM), and Apple Push Notification Service (APNs).
Send dynamic push notifications with full support for languages in your stack. No more running your own servers or dealing with different platform protocols.
Deliver high volume push notifications using our reliable platform trusted by 100,000+ developers.
Send photos, GIFs, and videos in notifications to boost user engagement.
With 30+ libraries, we make it easy for developers to build cross platform apps. Check out our API Documentation for Push Notifications.
Keep users engaged in your app with our Data Delivery Network — trusted by more than 100,000 happy developers, and re-engage them when it’s closed with our free Push Notifications API.