https://github.com/inket/mbawssnsmanager
Receive Push notifications from Amazon Web Services
https://github.com/inket/mbawssnsmanager
Last synced: 3 months ago
JSON representation
Receive Push notifications from Amazon Web Services
- Host: GitHub
- URL: https://github.com/inket/mbawssnsmanager
- Owner: inket
- Created: 2014-11-07T08:07:31.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2014-11-07T09:49:20.000Z (about 11 years ago)
- Last Synced: 2025-02-01T11:42:10.987Z (12 months ago)
- Language: Objective-C
- Size: 117 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## MBAWSSNSManager
Is a small class that makes it easy to do the basic AWS SNS-related tasks:
- Register for notifications:
1. Request device token from Apple
- Create platform endpoint with SNS
- Subscribe to SNS Topic
- Delete platform endpoint
This allows you to receive broadcast Push notifications from Amazon Web Services' Simple Notification Service (AWS SNS).
## Usage
Add `pod AWSiOSSDKv2` to your Podfile then run `pod install`
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[self registerForNotifications];
}
- (void)registerForNotifications {
MBAWSSNSManager* manager = [MBAWSSNSManager sharedManager];
manager.acceptsNotificationTypeAlert = YES;
manager.acceptsNotificationTypeBadge = YES;
manager.acceptsNotificationTypeSound = YES;
manager.awsAccessKey = @"";
manager.awsSecretKey = @"";
manager.awsRegion = ;
manager.awsApplicationArn = @"";
[manager registerForNotifications];
}
- (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken {
MBAWSSNSManager* manager = [MBAWSSNSManager sharedManager];
manager.deviceToken = deviceToken;
[manager subscribeToTopics:@[
@""
]];
}
- (void)application:(UIApplication*)application didFailToRegisterForRemoteNotificationsWithError:(NSError*)error{
NSLog(@"Failed to register with error : %@", error);
}
For more details see the blog post @ [Interfirm's blog](http://blog.interfirm.co.jp/entry/2014/11/07/184629)