What’s nice about Pushwoosh is they have a free offering with basic push features to get you started and their service applies to multiple platforms in general as well as offering plugins and samples for PhoneGap applications targeting iOS, Android, and Windows Phone 7. I noticed there also appears to be a plugin available and supported with PhoneGap Build. With all the PhoneGap support it seemed like a great service to blog about in addition to my recent push notification posts.

...

I was very impressed with the support I received while trying out this service. They were quick to respond with meaningful information and went out of their way to add some additional code to aid in some specific testing I was doing to try out their geozones offering which I will be posting about specifically next.

Holly Schinsky

Senior Application Developer

www.devgirl.org

READ TESTIMONIAL

Native iOS SDK

Download SDK Download Sample

To integrate Pushwoosh into your application you need to do simple following steps:

1. For the truly seamless integration all you have to do is to simply add Push NotificationsSDK to your project!

2. In your Info.plist add the following key Pushwoosh_APPID with your Pushwoosh Application ID string value

3. To handle push notifications add the following function to your App Delegate.m file

#import "PushNotificationManager.h"

- (void) onPushAccepted:(PushNotificationManager *)pushManager withNotification:(NSDictionary *)pushNotification {
	NSLog(@"Push notification received");
}
That’s it! Easy, isn’t it?

You might need to add -ObjC flag to the Linker Flags in your project.

See this guide on how to do that: http://developer.apple.com/library/mac/#qa/qa1490/_index.html

See the sample project here: https://github.com/shaders/pushwoosh-sdk-samples/tree/master/iPhone

NOTE: Simulator is not able neither to subscribe nor receive push notifications. Push Notifications SDK supports iOS 4.0 and higher.


Note: If your device is connected to the Internet via WiFi, and messages don’t get through to the device, please make sure APNs ports are not blocked by your firewall.

Push providers, iOS devices, and Mac computers are often behind firewalls. To send notifications, you will need to allow inbound and outbound TCP packets over port 2195. Devices and computers connecting to the push service over Wi-Fi will need to allow inbound and outbound TCP packets over port 5223.

The IP address range for the push service is subject to change; the expectation is that providers will connect by hostname rather than IP address. The push service uses a load balancing scheme that yields a different IP address for the same hostname. However, the entire 17.0.0.0/8 address block is assigned to Apple, so you can specify that range in your firewall rules.


Push Notifications SDK API:

@protocol PushNotificationDelegate

@optional
//By default this method displays alert and calls onPushAccepted if user has pressed OK button.
//If this method is implemented in the App Delegate, "onPushAccepted" method will not be called and notification alert will not be displayed
- (void) onPushReceived:(PushNotificationManager *)pushManager withNotification:(NSDictionary *)pushNotification onStart:(BOOL)onStart;

//user pressed OK on the push notification alert
- (void) onPushAccepted:(PushNotificationManager *)pushManager withNotification:(NSDictionary *)pushNotification;
@end


@interface PushNotificationManager

//Initializes Push Notifications Manager
+ (void)initializeAppCode:(NSString *)appCode appName:(NSString *)appName;

//Sends tags to server. Accepts dictionary of tags names/values
- (void) setTags: (NSDictionary *) tags;

//Returns push notifications token
- (NSString *) getPushToken;

//gets apn payload from the notification
- (NSDictionary *) getApnPayload:(NSDictionary *)pushNotification;

//gets user data from the push payload
- (NSString *) getCustomPushData:(NSDictionary *)pushNotification;

//send geolocation to the server for the geo pushes
- (void) sendLocation: (CLLocation *) location;

@end