TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | Custom |
ReleasedLast Release | Apr 2017 |
Maintained by Daniel Kuhnke.
appfarms Push Notification Service is a web based portal to send remote push notifications to your app and collect important statistical data regarding your push notifications. This library is a drop-in static library that provides a simple way to integrate Urban Airship services into your iOS applications.
Features supported:
Enable Push Notifications: Enable remote push notifications for your mobile app. The library automatically registers the device token with the appfarms Push Notification Service so that you easily can send remote push notifications via the appfarms Push Notification Service web frontend.
Analytics: Developers can then use the appfarms Analytics reports to measure:
The number of active users are using their applications.
Adoption and usage of specific features.
And many other useful metrics...
This document contains the following sections:
We recommend integration of library via CocoaPods.
Objective-C
AppDelegate.m
file.import
statements:
#import "AFPushManager.h"
-application:didFinishLaunchingWithOptions:
:
NSString * apiKey = @"6fe...068"; // Your private apiKey from https://push.appfarms.com
AFPushEnvironment env = AFPushEnvironmentLive; // or `AFPushEnvironmentDebug` or `AFPushEnvironmentStaging`
[AFPushManager configureWithApiKey:apiKey
environment:env
enableTracking:YES
autoTrackingMode:AFPushAutoTrackingModeOptIn];
[AFPushManager handleLaunchOptions:launchOptions];
// Register for remote notifications
if ([application respondsToSelector:@selector(registerUserNotificationSettings:)])
{
UIUserNotificationSettings * settings = nil;
settings = [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeBadge|UIUserNotificationTypeSound|UIUserNotificationTypeAlert categories:nil];
[application registerUserNotificationSettings:settings];
}
else
{
[application registerForRemoteNotifications];
}
AppDelegate.m
:
- (void) application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings
{
if (notificationSettings.types != UIUserNotificationTypeNone)
{
[application registerForRemoteNotifications];
}
}
- (void) application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
{
[AFPushManager setDeviceToken:deviceToken];
}
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
{
[AFPushManager handlePush:userInfo];
}
TODO
Our documentation can be found on appfarms Push Notification Service.
Copyright 2015 - 2016 appfarms GmbH & Co KG. All rights reserved.
If you have further questions or are running into trouble that cannot be resolved by any of the steps here, feel free to open a Github issue here or contact us at [email protected]