Forked project from MHNotificationHelper, with support for iOS8 (the instructions are different) and translation to some languages.
Steps with iOS7 (left), and steps with iOS8 (right)
en, es, de, fr, id, it, pl, pt, ru, sv, zh-Hant.
If you want to contribute and translate to another language, make me a pull request or contacte me by Twitter / Email. I will answer asap.
Is very easy to add this library to your project using CocoaPods, you must add this line to your Podfile, and then make pod install
.
pod 'STNotificationHelper'
##Usage First you have to include the library to your code:
#import <STNotificationHelperViewController.h>
And then add this code to show the view controller helper:
NSString *title = NSLocalizedString(@"Take advantage of MySuperApp", nil);
NSString *description = NSLocalizedString(@"MySuperApp is better with Push Notifications. We will spam you a lot! :)", nil);
STNotificationHelperObject *notificationObject = [STNotificationHelperObject objectWithTitle:title description:description];
STNotificationHelperViewController *notificationHelper = [STNotificationHelperViewController.alloc initWithNotification:notificationObject];
[self presentViewController:notificationHelper animated:YES completion:nil];
Or you can set your own app icon and app name:
NSString *title = NSLocalizedString(@"Take advantage of MySuperApp", nil);
NSString *description = NSLocalizedString(@"MySuperApp is better with Push Notifications. We will spam you a lot! :)", nil);
UIImage *icon = [UIImage imageNamed: @"myLogo.png"];
NSString *appName = @"My app name";
STNotificationHelperObject *notificationObject = [STNotificationHelperObject
objectWithTitle:title
description:description
appIcon:icon
appName:appName];
STNotificationHelperViewController *notificationHelper = [STNotificationHelperViewController.alloc initWithNotification:notificationObject];
[self presentViewController:notificationHelper animated:YES completion:nil];
- Mario Hahn, https://github.com/mariohahn (author of the original forked Pod)
- Nestor, https://github.com/nmaletm
STNotificationHelper is available under the MIT license. See the LICENSE file for more info.
Support this project via gittip.